I think I may meet a GCC issue which cause the crash I reported in this thread.
Now, I have just finishing building the wx3 library in debug mode with the command line:
mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=debug UNICODE=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-Wno-unused-local-typedefs -Wno-deprecated-declarations -fno-keep-inline-dllexport" >log-debug.txt 2>&1
Then I build C::B against this debug version of wx3 library.
By changing the codeblocks_30.cbp like below:
src/CodeBlocks_wx30.cbp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/CodeBlocks_wx30.cbp b/src/CodeBlocks_wx30.cbp
index 2b6a679..43c4e9b 100644
--- a/src/CodeBlocks_wx30.cbp
+++ b/src/CodeBlocks_wx30.cbp
@@ -700,7 +700,7 @@
</Target>
<Environment>
<Variable name="WX_CFG" value="" />
- <Variable name="WX_SUFFIX" value="u" />
+ <Variable name="WX_SUFFIX" value="ud" />
<Variable name="WX_VERSION" value="30" />
</Environment>
</Build>
@@ -725,6 +725,7 @@
<Add option="-DCB_PRECOMP" />
<Add option="-DWX_PRECOMP" />
<Add option="-DwxUSE_UNICODE" />
+ <Add option="-D__WXDEBUG__" />
<Add directory="$(#WX30.include)" />
<Add directory="$(#WX30.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
<Add directory="sdk/wxscintilla/include" />
After that, when testing the built C::B, I don't have any crash when disable or enable plugins. I even strip all the debug information(both the C::B related binaries and the wx3 library dll), it also works fine. So, I believe the crash bug comes from the mingw-build gcc 5.2.
Another issue I encountered is that after running the "update30.bat", I can't start codeblocks.exe from the output30 folder. I check the codeblocks.exe in output30 folder by dependency walker tool, it said the "dbghelp.dll" file is broken. How would that happen? (I think I use a wrong strip.exe?, because I put a strip.exe in a common folder, the strip.exe is quite old, the build time of the strip.exe was 2011-03-20, so maybe, I need to use the strip.exe come from the newer gcc suite), to solve the issue, I just copy the "dbghelp.dll" from the devel30 folder to output30 folder, and now, codeblocks.exe works fine.
EDIT:When using the BUILD=debug option to build wxWidgets 3.0.2, it actually use the "-O0" option for the G++ compiler, while BUILD=release uses the "-O2" option instead, thus I believe the "-O2" cause the crash issue.