Author
Topic: crash when use wxsmith (Read 2591 times)

Hello, On windows10, the codeblocks built against wx30 and Tdm-gcc5.1, while I use wxSmith to change a control's style, cb crashing. So I debug codeblocks, and I attached the picture of call stack. It seems related to wx30(I guess this is the wx's bug), the similar question http://trac.wxwidgets.org/ticket/12552 . But it should be fixed. Then I debug the wxSmith, I can't trigger it in wxSmith, just as same as the picture. Therefore, I am yet not sure that it is the wx'problem or wxSmith'problem. Can Anyone helps me, Thanks verymuch.

can you post the exact steps to reproduce?Can you post the full backtrace? It would be cool if you can post it in text form. You can copy it from the debugger log tab.

You probably have to recompile codeblocks with the debugger symbols enabled so the backtrace is filled with readable function names:In Settings->Global Variables->cb_release_type->base add a "-g"then you have to rebuild all codeblocks:Build->Rebuild workspace

Edit: Using wxWidgets 3.0.2 with patch on it to build using GCC 6.3.0.Edit2: Now building wxWidgets WX_3_0_BRANCH to see if the problem has been fixed in that git branch.Edit3: Problem NOT fixed in WX_3_0_BRANCH git branch; so, likely NOT wxWidgets problem.Going to build using MinGW64 GCC 6.3.0 and see if problem goes away; I am better using GDB under MSys2.Note: I still am very bad at using gdb, I just might be able to do a back trace under MSys2.

You probably have to recompile codeblocks with the debugger symbols enabled so the backtrace is filled with readable function names:In Settings->Global Variables->cb_release_type->base add a "-g"then you have to rebuild all codeblocks:Build->Rebuild workspace

For rebuild/recompile do you mean compile+link C::B from sources or is because icequan says "the codeblocks built against wx30"?

Hi, guys. I found position where my steps in wxSmith, so I set breakpoints and trace it. Finally, I got the crash point,in codeblocks SDK, the editormanager.cpp and the cbauibook.cpp, I attach the call stack. And there is some debuginformation.

At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsstyle.cpp:132Continuing...At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:1441Continuing...At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:184Continuing...At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsitemeditor.cpp:295At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsitemeditor.cpp:299At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsitemeditor.cpp:300At D:\code\codeblocks_sf\src\plugins\contrib\wxSmith\wxwidgets\wxsitemeditor.cpp:301At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:193At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:200At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:186At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:202At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:203At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:668At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:1451At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:1452At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:1460At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:1479At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:1480At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:690At D:\code\codeblocks_sf\src\sdk\editorbase.cpp:184At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:668At D:\code\codeblocks_sf\src\sdk\editormanager.cpp:698At D:\code\codeblocks_sf\src\sdk\cbauibook.cpp:526Program received signal SIGSEGV, Segmentation fault.In wxPGProperty::GetY2(int) const () (D:\code\codeblocks_sf\src\devel30\wxmsw30u_gcc_custom.dll)Debugger finished with status 0I have some quesition. First, in editormanager.cpp:698, when running to this statement, cb was crushing. m_pNotebook->DeletePage(index), I noticed that the m_pNotebook was initialized to nullptr and NEW in constructor, I think which is no problem. Then I step into cbauibook.cpp, just derived form wxAuiNotebook, I also think there is no problem at this statement. I don't think it is the wx'problem, because I can delete thepage of code editor normally, and if I don't change the style, it is also deleted. So, in my opinion, the most probably reasons is m_pNotebook was released forward in constructor when called out of obeject. I means thatthe NEW operation is useless, beacause the resource of constructor was released, so actually we don't allocate resource for m_pNotebook, and the adress is nullptr, so will crash here. just my guess, can anyone helps debug orsee whether it ie right.

This is not the crash site as far as I can tell, isn't it?Please remove all breakpoints and let it crash.Then go to the call stack window, right click in the window and click on the copy to clipboard menu item.Then paste the callstack in a code or quote tags.

Logged

<debugger plugin maintainer>(most of the time I ignore long posts)[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

The crash happens because of an illegal pointer in propgrid.cpp (GetY2) in the for-loop.getParent returns 0xfeeefee.I can reproduce it with wx2.8 and wx3.It either tries to access an already deleted or an incorrect initialized pointer, looking at the address, the first is more likely.It might be an(other) optimization bug of gcc.