Author Topic: crash: codeblocks wx2.6.1 unicode  (Read 18628 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: crash: codeblocks wx2.6.1 unicode
« Reply #15 on: August 27, 2005, 10:23:26 pm »
Well I see some issue here...

Apparently the saving of the sash position is an awful hack. I just fixed it, and made sure it wouldn't crash (null checks nearly everywhere :-P ).

Also, I made sure that the config reading is only done ONCE, so that'd save us a few clock cycles. I'm committing into CVS right now.

zieQ

  • Guest
Re: crash: codeblocks wx2.6.1 unicode
« Reply #16 on: August 29, 2005, 04:56:55 pm »
Hum, another crash on exit in HEAD and V1 with wx2.6.1 (no unicode), same bug here again about sash position :(

Anyway, I do not understand why event queues are not emptied when closing the application. May the problem be caused by the use of threads or processes? Seems to me that many bug fixes are just ugly hacks, IMHO there's a subtle problem that need to be fixed in C::B core! Any ideas?

I can't wait for the thread pool :wink:

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: crash: codeblocks wx2.6.1 unicode
« Reply #17 on: August 29, 2005, 06:05:10 pm »
Bug fixes aren't ugly hacks - some new features are (like the auto-hide message pane). Bug fixes are well... patches for the ugly hacks :-P Of course, good fixes involve a complete refactoring of certain modules.

Anyway, It's not that the event queues are not emptied on exit - it's that some event loops become recursive due to the use of wxYield, unless you enable the "crash protection" tweak. But then again, I'm not sure if you have it enabled.

Also, i think some gtk operations trigger a main event loop (not wxwidgets, but gtk's native), and this might mess up event handling (yes, gtk is ugly). Mind posting the backtrace, please?
« Last Edit: August 29, 2005, 06:10:14 pm by rickg22 »

zieQ

  • Guest
Re: crash: codeblocks wx2.6.1 unicode
« Reply #18 on: August 29, 2005, 07:17:44 pm »
Oh sorry, I was talking about windows version. Anyway, I expect no crash when I use a program, so I have not set crash protection "feature" which resemble to a ugly hack for me :lol: Can you explain the wxYield problem and its solution or point me to the thread which explain it?

Sorry but I just get bored with the crash on exit, I have seen many of them while bug fixing the wrong imports for quake3 project.

Agree that gtk is ugly but I was thinking: wxWidgets is supposed to handle all the ugly stuff, isn't it?

Code
Error occured on Monday, August 29, 2005 at 19:14:11.

C:\personel\projects\codeblocks\codeblocks-head\src\devel\codeblocks.exe caused an Access Violation at location 20776f64 Reading from location 20776f64.

Registers:
eax=20776f64 ebx=01838690 ecx=60571b60 edx=018ec508 esi=605aed60 edi=0022fa70
eip=20776f64 esp=0022f96c ebp=0022f988 iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=0038  gs=0000             efl=00010202

Call stack:
20776F64
60571BD9  C:\personel\projects\codeblocks\codeblocks-head\src\devel\codeblocks.dll:60571BD9  wxSplitPanel::OnUpdateUI(wxUpdateUIEvent&)  D:/projects/codeblocks/codeblocks-head/src/sdk/xtra_classes.cpp:94
100A77A8  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:100A77A8  _ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent
100A7B6C  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:100A7B6C  _ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler
100A8B49  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:100A8B49  _ZN12wxEvtHandler12ProcessEventER7wxEvent
10209ACC  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:10209ACC  _ZN12wxWindowBase14UpdateWindowUIEl
10106D64  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:10106D64  _ZN8wxWindow14OnInternalIdleEv
101828F1  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:101828F1  _ZN9wxAppBase14SendIdleEventsEP8wxWindowR11wxIdleEvent
10182926  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:10182926  _ZN9wxAppBase14SendIdleEventsEP8wxWindowR11wxIdleEvent
10182926  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:10182926  _ZN9wxAppBase14SendIdleEventsEP8wxWindowR11wxIdleEvent
10182926  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:10182926  _ZN9wxAppBase14SendIdleEventsEP8wxWindowR11wxIdleEvent
10182926  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:10182926  _ZN9wxAppBase14SendIdleEventsEP8wxWindowR11wxIdleEvent
101827EB  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:101827EB  _ZN9wxAppBase11ProcessIdleEv
100E872B  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:100E872B  _ZN11wxEventLoop3RunEv
1018241E  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:1018241E  _ZN9wxAppBase8MainLoopEv
1004318F  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:1004318F  _Z14wxUninitializev
100B077C  C:\dev\wxWidgets-2.6.1\lib\gcc_dll\wxmsw26_gcc_custom.dll:100B077C  _Z7wxEntryP11HINSTANCE__S0_Pci
004077DA  C:\personel\projects\codeblocks\codeblocks-head\src\devel\codeblocks.exe:004077DA  WinMain  D:/projects/codeblocks/codeblocks-head/src/src/app.cpp:297
0043BE08  C:\personel\projects\codeblocks\codeblocks-head\src\devel\codeblocks.exe:0043BE08
00401236  C:\personel\projects\codeblocks\codeblocks-head\src\devel\codeblocks.exe:00401236  __mingw_CRTStartup  d:/src/mingw/build/runtime/../../runtime/crt1.c:226
004012A8  C:\personel\projects\codeblocks\codeblocks-head\src\devel\codeblocks.exe:004012A8  WinMainCRTStartup  d:/src/mingw/build/runtime/../../runtime/crt1.c:260
77E9893D  C:\WINNT\system32\KERNEL32.dll:77E9893D  ProcessIdToSessionId

grv575

  • Guest
Re: crash: codeblocks wx2.6.1 unicode
« Reply #19 on: August 29, 2005, 07:22:27 pm »
Same results.  wx2.61, windows, nonunicode, latest cvs.  Two crashes

1. xtra_classes.cpp:94
-- if(w1 && w2 && w1->IsShown() && w2->IsShown())
IsShown() crashes things???

hard to debug as the OnUpdateUI() event fires every time the window is switched to.

2. compileroptionsdlg.cpp:1024
-- void CompilerOptionsDlg::OnAddVarClick(wxCommandEvent& event)
{
--

makes no sense :)

Code
#107 0xfeeefeee in ?? ()
#108 0xfeeefeee in ?? ()
#109 0xfeeefeee in ?? ()
#110 0xfeeefeee in ?? ()
#111 0x00350007 in ?? ()
#112 0x021c07cf in wxInvalidTextCoord ()
#113 0x105181c0 in vtable for wxWindowList ()
---Type <return> to continue, or q <return> to quit---
#114 0x00000000 in ?? () from
#115 0x00000000 in ?? () from
#116 0xbaadf000 in ?? ()
#117 0x00000000 in ?? () from
#118 0x00000000 in ?? () from
#119 0x00000001 in ?? ()
#120 0xabababab in ?? ()
#121 0xabababab in ?? ()
#122 0xfeeefeee in ?? ()
#123 0x00000000 in ?? () from
#124 0x00000000 in ?? () from
#125 0x00070007 in ?? ()
#126 0x021804c8 in CompilerOptionsDlg::OnAddVarClick (this=0x3e0328,
    event=@0x3e0328) at plugins/compilergcc/compileroptionsdlg.cpp:1024
Previous frame inner to this frame (corrupt stack?)


[attachment deleted by admin]

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: crash: codeblocks wx2.6.1 unicode
« Reply #20 on: August 30, 2005, 07:22:34 am »
The "crash protection" is not an ugly hack,, is how things actually should BE in the first place.
The wxYield() inserted in the message manager _IS_ the ugly hack. (Do a revision graph on messagemanager.cpp, the wxYield shouldn't be there).

So I added the "hack" to precisely prevent errors like this from happening. Events triggered in the wrong time. Getting rid of the infesting wxYield's is much more elegant than adding SANITY_CHECK's all around the code (you can do a grep and see what i mean. That's an ugly hack, too!)

so, please test the crash on exit with the "crash protection" enabled... it gives me the info that I really need. Otherwise, we're getting lots of noise from the backtrace, and that ain't helping.
« Last Edit: August 30, 2005, 07:24:53 am by rickg22 »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: crash: codeblocks wx2.6.1 unicode
« Reply #21 on: August 30, 2005, 09:35:45 am »
Heh. I found a double pointer deletion in my code... :P ironically, that was NOT causing the crash. I couldn't determine the cause!  :shock:  It must be somewhere in the wxWidgets code... but anyway, I found more or less what series of instructions triggered it. (Couldn't say which one exactly), and replaced the code with something much cleaner.

And doesn't crash now! :D

zieQ

  • Guest
Re: crash: codeblocks wx2.6.1 unicode
« Reply #22 on: August 30, 2005, 09:59:53 am »
No more crash on exit for me, HEAD non-unicode wx2.6.1

grv575

  • Guest
Re: crash: codeblocks wx2.6.1 unicode
« Reply #23 on: August 30, 2005, 03:30:07 pm »
Yeah looks like questionable wxWidgets behavior - it still returns object memory that was already freed or something - those GetWindow() calls should have returned null instead of crashing when trying to call a method on the returned object.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: crash: codeblocks wx2.6.1 unicode
« Reply #24 on: August 30, 2005, 06:07:41 pm »
Quote from: grv575
... those GetWindow() calls should have returned null instead of crashing when trying to call a method on the returned object...
no perfect world ...