Author Topic: SVN build crashes when trying to editing/adding new compiler flags  (Read 28774 times)

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2545
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #45 on: June 08, 2016, 09:30:46 pm »
I can confirm:
No crash with SVN revision 10856 wx2.8 TDM-GCC 4.9.2

Crash with wx2.8 TDM-GCC 5.1.0

preliminary backtrace:
Code: [Select]
In wxCheckDynamicCast(wxObject*, wxClassInfo*) () (\wxWidgets-2.8.12_51\lib\gcc_dll\wxmsw28u_gcc_custom.dll)

[debug]> bt 30
[debug]#0  0x03cdb345 in wxCheckDynamicCast(wxObject*, wxClassInfo*) () from \lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#1  0x0028d794 in ?? ()
[debug]#2  0xfeeefeee in ?? ()
[debug]#3  0xfeeefeee in ?? ()
[debug]#4  0xfeeefeee in ?? ()
[debug]#5  0xfeeefeee in ?? ()
[debug]#6  0xfeeefeee in ?? ()
[debug]#7  0xfeeefeee in ?? ()
[debug]#8  0xfeeefeee in ?? ()
[debug]#9  0xfeeefeee in ?? ()
[debug]#10 0xfeeefeee in ?? ()
[debug]#11 0xfeeefeee in ?? ()
[debug]#12 0xfeeefeee in ?? ()
[debug]#13 0xfeeefeee in ?? ()
[debug]#14 0xfeeefeee in ?? ()
[debug]#15 0xfeeefeee in ?? ()
[debug]#16 0xfeeefeee in ?? ()
[debug]#17 0xfeeefeee in ?? ()
[debug]#18 0xfeeefeee in ?? ()
[debug]#19 0xfeeefeee in ?? ()
[debug]#20 0xfeeefeee in ?? ()
[debug]#21 0xfeeefeee in ?? ()
[debug]#22 0xfeeefeee in ?? ()
[debug]#23 0xfeeefeee in ?? ()
[debug]#24 0xfeeefeee in ?? ()
[debug]#25 0xfeeefeee in ?? ()
[debug]#26 0xfeeefeee in ?? ()
[debug]#27 0xfeeefeee in ?? ()
[debug]#28 0xfeeefeee in ?? ()
[debug]#29 0xfeeefeee in ?? ()
[debug](More stack frames follow...)

EDIT: windows 7

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12073
    • Travis build status
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #46 on: June 08, 2016, 10:50:12 pm »
What happens if you execute bt -30 or bt -100 in the command prompt in the debugger's log panel?
(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!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #47 on: June 08, 2016, 11:33:52 pm »
What happens if you execute bt -30 or bt -100 in the command prompt in the debugger's log panel?

I will try that in a few minutes.
Here is a crash report in case it helps.

Code: [Select]
-------------------

Error occured on Wednesday, June 8, 2016 at 17:31:27.

codeblocks.exe caused an Access Violation at location 6FF5B345 in module wxmsw28u_gcc_510TDM.dll Reading from location 00000010.

Loading symbols... done.

Registers:
eax=00000000 ebx=0028e3c0 ecx=00000000 edx=00000000 esi=700c3ac8 edi=700c2e40
eip=6ff5b345 esp=0028ddc4 ebp=7009f580 iopl=0         nv up ei pl zr na po nc
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246

AddrPC   Params
6FF5B345 0028E3C0 700C3AC8 FFFFFFFF  wxmsw28u_gcc_510TDM.dll!wxCheckDynamicCast
6FDDCF5D 064093A0 0028DF08 0028DF0C  wxmsw28u_gcc_510TDM.dll!wxSizerXmlHandler::Handle_sizer
6FDFA8AA 03B371E8 0028E3C0 00000000  wxmsw28u_gcc_510TDM.dll!wxXmlResourceHandler::CreateResource
6FDFF635 03B371E8 0028E3C0 00000000  wxmsw28u_gcc_510TDM.dll!wxXmlResource::CreateResFromNode
6FE00641 0028E3C0 00000000 FFFFFFFF  wxmsw28u_gcc_510TDM.dll!wxXmlResourceHandler::CreateChildren
6FDB673E 064093A0 0028E178 0028E17C  wxmsw28u_gcc_510TDM.dll!wxDialogXmlHandler::DoCreateResource
6FDFA8AA 03B378A0 00000000 0028E3C0  wxmsw28u_gcc_510TDM.dll!wxXmlResourceHandler::CreateResource
6FDFF635 03B378A0 00000000 0028E3C0  wxmsw28u_gcc_510TDM.dll!wxXmlResource::CreateResFromNode
6FE004C7 00000000 0028E39C 0028E590  wxmsw28u_gcc_510TDM.dll!wxXmlResource::LoadObject
64B5A12A 0028EA40 00000FCC 003F7CE0  compiler.dll!OnFlagsPopup  [C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/svn-codeblocks-trunk/src/plugins/compilergcc/compileroptionsdlg.cpp @ 3028]
  3026:             }
  3027:         }
> 3028:         CompilerFlagDlg dlg(nullptr, &copt, categ, categoryName);
  3029:         PlaceWindow(&dlg);
  3030:         if (dlg.ShowModal() != wxID_OK)
6FA81272 003F7BF8 00000FCC 00000000  wxmsw28u_gcc_510TDM.dll!wxAppConsole::HandleEvent
6FF593EA 00000000 00000000 00000000  wxmsw28u_gcc_510TDM.dll!pthread_spin_unlock

codeblocks.exe 16.1.0.0
ntdll.dll    6.1.7601.23418
kernel32.dll 6.1.7601.23418
KERNELBASE.dll 6.1.7601.23418
COMCTL32.DLL 6.10.7601.18837
msvcrt.dll  7.0.7601.17744
GDI32.dll    6.1.7601.23418
USER32.dll  6.1.7601.19061
ADVAPI32.dll 6.1.7601.23418
sechost.dll 6.1.7600.16385
RPCRT4.dll  6.1.7601.23418
SspiCli.dll 6.1.7601.23418
CRYPTBASE.dll 6.1.7601.23418
LPK.dll      6.1.7601.19146
USP10.dll    1.626.7601.19054
SHLWAPI.dll 6.1.7601.17514
SHELL32.DLL 6.1.7601.18952
SHFOLDER.DLL 6.1.7600.16385
wxmsw28u_gcc_510TDM.dll 2.8.12.0
COMDLG32.DLL 6.1.7601.17514
OLE32.dll    6.1.7601.23392
OLEAUT32.DLL 6.1.7601.19144
WINMM.DLL    6.1.7601.17514
WINSPOOL.DRV 6.1.7601.17514
WSOCK32.DLL 6.1.7600.16385
WS2_32.dll  6.1.7601.17514
NSI.dll      6.1.7600.16385
codeblocks.dll
wxpropgrid.dll
exchndl.dll 0.7.7.0
mgwhelp.dll 0.7.7.0
dbghelp.dll 6.3.9600.17029
PSAPI.DLL    6.1.7600.16385
VERSION.dll 6.1.7600.16385
IMM32.DLL    6.1.7601.17514
MSCTF.dll    6.1.7601.18731
uxtheme.dll 6.1.7600.16385
dwmapi.dll  6.1.7601.18917
CRYPTSP.dll 6.1.7601.18741
rsaenh.dll  6.1.7600.16385
RpcRtRemote.dll 6.1.7601.17514
msftedit.DLL 5.41.21.2510
abbreviations.dll
astyle.dll
autosave.dll
classwizard.dll
codecompletion.dll
compiler.dll
debugger.dll
defaultmimehandler.dll
OccurrencesHighlighting.dll
openfileslist.dll
projectsimporter.dll
scriptedwizard.dll
todo.dll
xpmanifest.dll
apphelp.dll 6.1.7601.17514
msimg32.dll 6.1.7600.16385
WININET.dll 11.0.9600.18315
api-ms-win-downlevel-user32-l1-1-0.dll 6.2.9200.16492
api-ms-win-downlevel-shlwapi-l1-1-0.dll 6.2.9200.16492
api-ms-win-downlevel-version-l1-1-0.dll 6.2.9200.16492
api-ms-win-downlevel-normaliz-l1-1-0.dll 6.2.9200.16492
normaliz.DLL 6.1.7600.16385
iertutil.dll 11.0.9600.18315
api-ms-win-downlevel-advapi32-l1-1-0.dll 6.2.9200.16492
USERENV.dll 6.1.7601.17514
profapi.dll 6.1.7600.16385
Secur32.dll 6.1.7601.23418
api-ms-win-downlevel-advapi32-l2-1-0.dll 6.2.9200.16492
api-ms-win-downlevel-ole32-l1-1-0.dll 6.2.9200.16492
mswsock.dll 6.1.7601.18254
IPHLPAPI.DLL 6.1.7601.17514
WINNSI.DLL  6.1.7600.16385
wship6.dll  6.1.7600.16385
api-ms-win-downlevel-shlwapi-l2-1-0.dll 6.2.9200.16492
DNSAPI.dll  6.1.7601.17570
CLBCatQ.DLL 2001.12.8530.16385
netprofm.dll 6.1.7600.16385
nlaapi.dll  6.1.7601.18685
wshtcpip.dll 6.1.7600.16385
urlmon.dll  11.0.9600.18315
dhcpcsvc.DLL 6.1.7600.16385
WLIDNSP.DLL 6.500.3165.0
dhcpcsvc6.DLL 6.1.7600.16385
npmproxy.dll 6.1.7600.16385
rasadhlp.dll 6.1.7600.16385
fwpuclnt.dll 6.1.7601.18283

Windows 6.1.7601
DrMingw 0.7.7

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #48 on: June 08, 2016, 11:40:48 pm »
EDIT: I am building SVN Revision: 10862 using gcc (tdm-1) 5.1.0 32 bit on Windows 7 64 bit.

output of "bt -100" below.

Code: [Select]
A whole lot of lines just like the next ones.
#21824 0xfeeefeee in ?? ()
#21825 0xfeeefeee in ?? ()
#21826 0xfeeefeee in ?? ()
#21827 0xfeeefeee in ?? ()
#21828 0xfeeefeee in ?? ()
#21829 0xfeeefeee in ?? ()
#21830 0x303e3dc5 in ?? ()
#21831 0x1c42f1d3 in ?? ()
---Type <return> to continue, or q <return> to quit---
#21832 0x00000001 in ?? ()
#21833 0x00000016 in ?? ()
#21834 0x00000023 in ?? ()
#21835 0x004b0048 in __static_initialization_and_destruction_0 (
    __initialize_p=<error reading variable: Cannot access memory at address 0xfe
eefef6>,
    __priority=<error reading variable: Cannot access memory at address 0xfeeefe
fa>)
    at C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/svn-codeblo
cks-trunk/src/include/logger.h:19

Tim S.
« Last Edit: June 08, 2016, 11:44:18 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2545
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #49 on: June 09, 2016, 12:41:42 am »
funnily i tried it without contrib plugins and i got this backtrace:

Code: [Select]
[debug]> bt 30
[debug]#0  0x0000002b in ?? ()
[debug]#1  0x03d05cc4 in wxProgressDialog::sm_eventTable () from \wxWidgets-2.8.12_51\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#2  0x000001b0 in ?? ()
[debug]#3  0x039c81e0 in wxScrollHelper::wxScrollHelper(wxWindow*) () from \wxWidgets-2.8.12_51\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#4  0x03dc3990 in wxPanel::sm_eventHashTable () from \wxWidgets-2.8.12_51\lib\gcc_dll\wxmsw28u_gcc_custom.dll
[debug]#5  0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:

nothing more... (also with bt -100)
debug symbols for codeblocks are enabled (-g3 ) but not for wx... Was not  able to  build cb against the debug build of wx (get always library mismatch, although the libraries in the build log are correct... )

this seems to be a odd bug -.-

Offline ssawgift

  • Multiple posting newcomer
  • *
  • Posts: 67
    • My personal website
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #50 on: June 09, 2016, 04:01:21 am »
So after a long time you finally tried this yourself. I believe you did not trust my report.
I've tried it right after it has been reported, but I'm running linux and there is no problem. If you re-read the topic you should find a message from me stating it.

I have no problem with my custom build on Fedora which has gcc 5.3.1. It seems it's specific only to Windows platform.
Do you have custom build on windows or not?

The level of misunderstanding is pretty high in this topic. :(

If you read the 3rd post in this topic, you will see I was reporting against win32 binaries.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #51 on: June 09, 2016, 04:02:05 am »
Testing using "-g" to build Code::Blocks linked to debug wxWidgets. Not building Contrib. Plugins.

Tim S.

SVN Diff
Code: [Select]
Index: CodeBlocks.cbp
===================================================================
--- CodeBlocks.cbp      (revision 10862)
+++ CodeBlocks.cbp      (working copy)
@@ -701,8 +701,8 @@
                                </ExtraCommands>
                        </Target>
                        <Environment>
-                               <Variable name="WX_CFG" value="" />
-                               <Variable name="WX_SUFFIX" value="u" />
+                               <Variable name="WX_CFG" value="510TDM" />
+                               <Variable name="WX_SUFFIX" value="ud" />
                                <Variable name="WX_VERSION" value="28" />
                        </Environment>
                </Build>
@@ -728,6 +728,7 @@
                        <Add option="-DCB_PRECOMP" />
                        <Add option="-DWX_PRECOMP" />
                        <Add option="-DwxUSE_UNICODE" />
+                       <Add option="-D__WXDEBUG__" />
                        <Add directory="$(#WX.include)" />
                        <Add directory="$(#WX.lib)/gcc_dll$(WX_CFG)/msw$(WX_SUFFIX)" />
                        <Add directory="sdk/wxscintilla/include" />

Code: [Select]
gdb32 codeblocks.exe
run --user-data-dir=C:/SourceCode/test/cb
bt -100

Edit: I had no PROBLEM with the build this time using debug wxwidgets; I think I might have had a dirty SVN repo.
Trying once more with release wxWidgets library to see if the problem only happens with release lib.
« Last Edit: June 09, 2016, 04:06:01 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #52 on: June 09, 2016, 04:24:18 am »
Problem happened again using release wxWidgets lib.
Going to try a few times using wxWidgets debug and see if I can get a crash.

Code: [Select]
#22684 0xfeeefeee in ?? ()
#22685 0xfeeefeee in ?? ()
#22686 0xfeeefeee in ?? ()
#22687 0xfeeefeee in ?? ()
#22688 0xfeeefeee in ?? ()
#22689 0xfeeefeee in ?? ()
#22690 0x7c767c9b in ?? ()
#22691 0x1c45b11b in ?? ()
#22692 0x00000001 in ?? ()
#22693 0x00000016 in ?? ()
#22694 0x00000023 in ?? ()
#22695 0x004b0048 in __static_initialization_and_destruction_0 (
    __initialize_p=<error reading variable: Cannot access memory at address 0xfeeefef6>,
    __priority=<error reading variable: Cannot access memory at address 0xfeeefefa>)
    at C:/SourceCode/OpenSourceCode/Apps/IDEs/CodeBlocks/cb_misc-git/svn-codeblocks-trunk/src/include/logger.h:19
Backtrace stopped: Cannot access memory at address 0xfeeefef2
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #53 on: June 09, 2016, 05:12:18 am »
What is the proper CB options for building wxWidgets 2.8.12 using TDM 5.1 GCC compiler?
In case, the error changes based on the build options.

I am pretty sure I used these options for my release build.
Code: [Select]
mingw32-make -f makefile.gcc BUILD=release UNICODE=1 MONOLITHIC=1 SHARED=1 USE_XRC=1 USE_OPENGL=1 CXXFLAGS="-fno-keep-inline-dllexport"

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #54 on: June 09, 2016, 06:59:08 am »
I have given up on this issue when using the TDM 5.1 compiler; going to see if an 5.3 compiler (not an TDM build) has the issue in a few days time. I could NOT get an debug version of the wxWidgets to have the bug; but, always saw it when using an wxWidgets release library.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ssawgift

  • Multiple posting newcomer
  • *
  • Posts: 67
    • My personal website
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #55 on: June 09, 2016, 12:07:53 pm »
I see you guys are busying fixing the issue. I want to make a suggestion. It may save much time by comparing changes regarding the dialog invoking code between the 16.01 release and current HEAD version to see what causes the crash.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5234
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #56 on: June 09, 2016, 01:47:26 pm »
I see you guys are busying fixing the issue. I want to make a suggestion. It may save much time by comparing changes regarding the dialog invoking code between the 16.01 release and current HEAD version to see what causes the crash.
I use git blame to check the changes of file: plugins\compilergcc\compileroptionsdlg.cpp, and I don't find any changes.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #57 on: June 09, 2016, 02:37:05 pm »
I see you guys are busying fixing the issue. I want to make a suggestion. It may save much time by comparing changes regarding the dialog invoking code between the 16.01 release and current HEAD version to see what causes the crash.
I use git blame to check the changes of file: plugins\compilergcc\compileroptionsdlg.cpp, and I don't find any changes.

When was option "-std=gnu++11" added to Windows project; my current thoery is using "-std=gnu++11" in CB requires building wxWidgets using "-std=gnu++11". Will know in a few hours if my theory is correct.


Edit SVN 10789
Quote
- c++11: Add the option for most of the windows projects (wx28 and wx30), unfortunately we have to use gnu++11 instead of c++11

Edit2: Theory appears to be invalid still crashed; when wxWidgets 2.8.12 release lib built with "-std=gnu++11".

Tim S.
« Last Edit: June 09, 2016, 03:18:20 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5234
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #58 on: June 09, 2016, 03:52:56 pm »
What is the proper CB options for building wxWidgets 2.8.12 using TDM 5.1 GCC compiler?
In case, the error changes based on the build options.

I am pretty sure I used these options for my release build.
Code: [Select]
mingw32-make -f makefile.gcc BUILD=release UNICODE=1 MONOLITHIC=1 SHARED=1 USE_XRC=1 USE_OPENGL=1 CXXFLAGS="-fno-keep-inline-dllexport"

Tim S.
I think your build option for the wx library is correct.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6666
    • My Best Post
Re: SVN build crashes when trying to editing/adding new compiler flags
« Reply #59 on: June 09, 2016, 04:50:39 pm »
Building release wxWidgets 2.8.12 using TDM 5.1 and compiler option "-O0" worked without the bug.
(Compiler likely defaults to "-O2")

So, I would consider this an Compiler optimization bug; once another person confirms the fix.

Note, Someone should see if option "-O1" also will cause a crash; I do NOT have the time.

Tim S.

My FLAGS used to create the wxWidgets release library that worked.
Code: [Select]
CPPFLAGS=-O0
CXXFLAGS=-fno-keep-inline-dllexport -Wno-unused-local-typedefs -Wno-deprecated-declarations

Edit: So, I used the code like below to build.
Code: [Select]
mingw32-make -f makefile.gcc BUILD=release UNICODE=1 MONOLITHIC=1 SHARED=1 USE_XRC=1 USE_OPENGL=1 CXXFLAGS="-fno-keep-inline-dllexport" CPPFLAGS="-O0"
« Last Edit: June 09, 2016, 07:50:20 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org