Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

cbThrow

(1/1)

Ceniza:
Well, well, well...

I started playing with the new macro cbThrow in the help_plugin and it works, but... Code::Blocks crashes really weirdly.

I tried to track the bug and it's even more weird.

The help_plugin throws the exception if it cannot find the resource file (it was added in the ctor).

The PluginManager in the SDK, member function LoadPlugin, catches the exception, but when it leaves the catch the crash arises (or at least that place signals the backtrace).

It's also "saying" the problem occurs in another file in line 52 but line 51 is the last one which happens to be an empty line, so how could it be happening there if that line doesn't even exist?

Oh, and it also says the problem is trying to read from a location which happens to be the same location it occurs.

Just take a look at this and check the files named:


--- Quote from: backtrace ---C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe caused an Access Violation at location 6f24a380 Reading from location 6f24a380.

Registers:
eax=6f24a380 ebx=02207c68 ecx=00000000 edx=02207c98 esi=618fa430 edi=00000001
eip=6f24a380 esp=0022f6cc ebp=0022f6d8 iopl=0         nv up ei pl nz na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00010202

Call stack:
6F24A380
618917FF  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.dll:618917FF  _ZNK9TiXmlText5BlankEv
618879F1  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.dll:618879F1  _GLOBAL__D__ZN9TiXmlBase11errorStringE  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/sdk/tinyxml/tinyxmlerror.cpp:52
61841548  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.dll:61841548  PluginManager::LoadPlugin(wxString const&)  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/sdk/pluginmanager.cpp:157
61841117  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.dll:61841117  PluginManager::ScanForPlugins(wxString const&)  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/sdk/pluginmanager.cpp:114
00415B9A  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:00415B9A  MainFrame::ScanForPlugins()  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/src/main.cpp:651
0041211C  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:0041211C  MainFrame::MainFrame(wxLocale&, wxWindow*)  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/src/main.cpp:393
00402782  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:00402782  CodeBlocksApp::InitFrame()  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/src/app.cpp:203
004037BD  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:004037BD  CodeBlocksApp::OnInit()  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/src/app.cpp:329
0044B9D4  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:0044B9D4
10044939  C:\WINDOWS\system32\wxmsw26_gcc_custom.dll:10044939  _onexit  d:/src/mingw/build/runtime/../../runtime/dllcrt1.c:183
100B236C  C:\WINDOWS\system32\wxmsw26_gcc_custom.dll:100B236C  _onexit  d:/src/mingw/build/runtime/../../runtime/dllcrt1.c:183
004013DA  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:004013DA  WinMain  C:/Documents and Settings/Ceniza/cvs/codeblocks/src/src/app.cpp:297
00446528  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:00446528
00401236  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:00401236  __mingw_CRTStartup  d:/src/mingw/build/runtime/../../runtime/crt1.c:226
00401288  C:\Documents and Settings\Ceniza\cvs\codeblocks\src\devel\codeblocks.exe:00401288  mainCRTStartup  d:/src/mingw/build/runtime/../../runtime/crt1.c:246
7C816D4F  C:\WINDOWS\system32\kernel32.dll:7C816D4F  RegisterWaitForInputIdle
--- End quote ---

Could it be a compiler mistake?

Just in case: I'm using MinGW (GCC 3.4.4), wxWidgets 2.6.2 and a recent Code::Blocks CVS.

mandrav:
That's the same behaviour I got with gcc 3.4.4. Might it be a compiler bug? I don't know and I left it for later. The only thing I can say for now is: don't throw from your plugin's constructor but from OnAttach(). I know it's not the answer, but until we have one...

Navigation

[0] Message Index

Go to full version