User forums > Help

crash when use wxsmith

<< < (5/6) > >>

oBFusCATed:
@Jens: Are you talking about windows or linux? Have you tried with wx-master?

Jenna:

--- Quote from: oBFusCATed on April 21, 2017, 08:17:25 pm ---@Jens: Are you talking about windows or linux? Have you tried with wx-master?

--- End quote ---
I tried wx3.0.2 and 2.8.12 on windows and wx3.1 (not latest) and 2.8.12 on linux.
All crash, not always, but this might depend on the value of m_parent in propgrid.cpp .

I try to dig into it deeper.

oBFusCATed:
I cannot crash it, but I've seen the crash in wxsmith.
What are the steps to reproduce it?

icequan233:

--- Quote from: oBFusCATed on April 21, 2017, 11:19:41 pm ---I cannot crash it, but I've seen the crash in wxsmith.
What are the steps to reproduce it?

--- End quote ---
I forget the last steps, After checking or changing the style, you need delete the page of wxs editor, It should be
crash. On my virtual machine, Ubuntu16.04, I can reproduce this crash, but not always.

stahta01:
I just finished building wxWidgets git master (Updated in the past 24 hours) and did NOT see the crash.
Too tired to double check my work tonight. If I confirm this; then, it is likely a wxWidgets problem that has already been fixed to git master.

Edit1: A quick search resulted in this being the change most likely to have fixed the bug.
Edit2: This is based on the guess that compiler optimization is causing the bug.


--- Quote ---SHA-1: 01ccff2e05128241827935646cbb275bab05223b

* Avoid comparing address of reference to NULL

As GCC 6 points out, the compiler is free to assume a reference is never
null, and remove such a check

--- End quote ---


--- Code: --- src/propgrid/property.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp
index f8973cd1f6..0e992becc1 100644
--- a/src/propgrid/property.cpp
+++ b/src/propgrid/property.cpp
@@ -515,13 +515,13 @@ void wxPGProperty::Init()
 
 void wxPGProperty::Init( const wxString& label, const wxString& name )
 {
-    // We really need to check if &label and &name are NULL pointers
-    // (this can if we are called before property grid has been initialized)
+    // wxPG_LABEL reference can be NULL if we are called before property
+    // grid has been initialized
 
-    if ( (&label) != NULL && label != wxPG_LABEL )
+    if ( sm_wxPG_LABEL && label != wxPG_LABEL )
         m_label = label;
 
-    if ( (&name) != NULL && name != wxPG_LABEL )
+    if ( sm_wxPG_LABEL && name != wxPG_LABEL )
         DoSetName( name );
     else
         DoSetName( m_label );

--- End code ---

Tim S.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version