Author Topic: [Solved]Problem with svn 12446  (Read 6724 times)

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
[Solved]Problem with svn 12446
« on: May 11, 2021, 04:55:08 pm »
When I try to create a new project, my C::B svn 12446 crashes :
I open C::B normally, then File/New/Project... : crash.
when looking in the RPT file, it seems it's somewhere in sqstd_rex_getsubexp
may be related to svn 12332 or one of the following patches!
« Last Edit: June 20, 2021, 11:36:24 am by gd_on »
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 734
Re: Problem with svn 12446
« Reply #1 on: May 11, 2021, 05:35:34 pm »
I can't reproduce here. If I put a breakpoint in sqstd_rex_getsubexp() and follow your steps it is not reached, and there is no crash (with or without breakpoint).

My configuration is the same as yours, but I am using 32 bits.

EDIT: I've tested on Windows 7, tonight I will check on Windows 10.
« Last Edit: May 11, 2021, 05:45:35 pm by Miguel Gimenez »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #2 on: May 11, 2021, 05:50:04 pm »
Are you sure you've done a clean rebuild of everything?
(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 gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #3 on: May 11, 2021, 06:01:00 pm »
I think so. Before build, I also cleaned totally the devel31_64 directory.
I'll do this again, just to be sure ...
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #4 on: May 11, 2021, 07:09:13 pm »
Even after a full clean rebuild, my problem is still there ... :(
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #5 on: May 11, 2021, 07:36:56 pm »
(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: 7149
    • My Best Post
Re: Problem with svn 12446
« Reply #6 on: May 11, 2021, 07:42:32 pm »
I can't reproduce here. If I put a breakpoint in sqstd_rex_getsubexp() and follow your steps it is not reached, and there is no crash (with or without breakpoint).

My configuration is the same as yours, but I am using 32 bits.

EDIT: I've tested on Windows 7, tonight I will check on Windows 10.

I did not see the problem with win7 Home 64 bit. Built using GCC 8.1.0 and wxWidgets git master 6 to 10 days old.

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 Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 734
Re: Problem with svn 12446
« Reply #7 on: May 11, 2021, 08:50:33 pm »
Works OK on W10 H2, wx3.1.5, everything using 64 bits, MinGW_w64 compiler (x86_64-8.1.0-release-posix-seh-rt_v6-rev0)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9614
Re: Problem with svn 12446
« Reply #8 on: May 12, 2021, 06:53:46 am »
...I've deleted the "out-of-bound" discussion to close the moderator report.
Once all have calm-down, start again your Q&A. And always take it easy... 8)

My 2 cents: If you build C::B yourself you should have a debug build. So if you run that (in the develXX folder), the crash handler will provide information about code lines.
However, what confuses me is that the crash seems related to sorting a UI control. Why does Squirrel kick-in at all?
And also, am I getting it right that it works on Win10 and not on Win7? Anybody here with the same crash on Wind10?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 734
Re: Problem with svn 12446
« Reply #9 on: May 12, 2021, 09:43:49 am »
Quote
Am I getting it right that it works on Win10 and not on Win7?

Works for me on W10 (compiled in 32 and 64 bits) and W7 (compiled in 32 bits). I have not tested W7-64.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #10 on: May 12, 2021, 10:03:01 am »
I think it's a problem in relation with the gcc version on Windows. With gcc 8.1, 64 bits, as used by Killerbot or M. Gimenez, it's OK.
I use myself gcc 10.3, in mingw64 (so 64 bits) included with msys2 distribution. I had already some problems with this (but gcc 10.2) : problem with .chm files (now solved) or problem in filent.c (patch proposed in ticket 1086, but still not integrated in official version because need some verifications with other compilers) apparently caused by a wrong length of some pointers. gcc 8.1 seems to have no problems with this (but I think there is an error), but gcc 10.3 is more strict with that may be.
I'm triing to compile C::B in different configurations to try to better understand what happens.
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #11 on: May 12, 2021, 12:07:58 pm »
Well : here are two new RPT files.
The first one is compiled with giving -g as cb_release_type value. The second one by simply giving a space in that value (so no optimisations). My previous rpt was obtained with -O2.
Looking in those new versions, I see that the error does not seem to come from the same part of code, but from a sort.
More, in the -g version, I see a pointer to a wxIntPtr, but I'm not able to determine if it has the right length (a right click on it in newfromtemplatedlg.cpp does not give me it's declaration, though I suppose it's in wx/types.h). But those files are not recent, so I don't see why it's a problem now, and not before may 9th !
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #12 on: May 12, 2021, 01:22:29 pm »
Please use a debugger.
Also for unoptimized builds please use -g -O0. Looking at builds which doesn't have -g is a waste of time.
The I'm not 100% what are default optimization levels in GCC, so I wouldn't count on them being unoptimized/debugable.
(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 gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #13 on: May 14, 2021, 05:12:51 pm »
I continued my investigations by triing a few compilers, particularly those found on winlibs.
The last version which gives me a working C::B version (at least for this problem), even for svn 12446, is : build version gcc-10.2.0-mingw-w64-8.0.0-r5.
Starting with build version gcc-10.2.0-mingw-w64-8.0.0-r6, I have problems, even with older svn version of C::B. So the problem does not come from squirrel update.
The only difference between these 2 versions concern Gnu Binutils : switch from 2.35.1 to 2.36.
This was also with these versions I had a previous problem (solved for me in filent.c and discussed in https://forums.codeblocks.org/index.php/topic,24363.msg166172.html#msg166172).
Problem exist also with gcc 11.1 as found on winlibs, but also with gcc 10.3 as found with msys2.
I hope this will give some clues to debug C::B by itself. But this is for C::B gurus, not for me  :(
« Last Edit: May 14, 2021, 07:46:23 pm by gd_on »
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #14 on: June 07, 2021, 05:42:34 pm »
I also tried the new TDM compiler version based on gcc 10.3 in 64 bits. The problem is the same. No differences if I use svn 12458.
More, the executable codeblocks.exe is considered as containing a virus by my McAfee antivirus software >:(. A false positive, surely. Though I can tell McAfee to ignore this file, it's annoying.
I also tried to debug C::B, but without success : I can't identify the real problem :-[
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline Miguel Gimenez

  • Lives here!
  • ****
  • Posts: 734
Re: Problem with svn 12446
« Reply #15 on: June 07, 2021, 06:14:03 pm »
Looks like memory layout in Squirrel is flaky, see ticket 1102
You can try adding -fno-strict-aliasing to the Squirrel target.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #16 on: June 07, 2021, 08:12:44 pm »
I have added  -fno-strict-aliasing to the Squirrel target. Effectively, less warnings during the build (a full rebuild), but it's not sufficient: the problem is still there :(
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #17 on: June 07, 2021, 08:29:01 pm »
Are you still using rev 12446? There were major problems with the new squirrel binding API which I've since fixed.
Have you tried to build the latest trunk?
(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 gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #18 on: June 07, 2021, 11:28:03 pm »
I use now svn 12458 (as told in reply #14), but this does not change anything for this specific problem. RPT file is the same (except for addresses).

If you look also in my reply #13, you can see that the problem is not recent, and was already there before the new squirrel rewrite.
« Last Edit: June 08, 2021, 09:31:20 am by gd_on »
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline AndrewCot

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: Problem with svn 12446
« Reply #19 on: June 18, 2021, 06:48:05 am »
I have been able to reproduce the crash with the source from https://github.com/obfuscated/codeblocks_sf and it is crashing in the same spot as my RPT file looks like the same as post#11's codeblocks-g.RPT. The version is reporting as svn-r12459.


 

Offline AndrewCot

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: Problem with svn 12446
« Reply #20 on: June 18, 2021, 09:25:12 am »
My debugging shows the crash occurs in the in the SortTemplates() function in the \src\sdk\newfromtemplatedlg.cpp file, but the problem is hard to debug as the variables are wxWidget data types and are not shown in a readable format in the watch window. I have got the wxwidget pretty printing to work, but it is missing some of the structures... More work!!!!!

It looks like there may be some GCC bug as I have added a bunch of logging, but it does not work as my first line "if (data1->pt)" causes a crash. If I set a breakpoint on the line and watch the data1->pt is shows "Cannot access memory at address 0xffffffffd90246c0". When watching data1 is is also pointing to 0xffffffffd90246c0.

I suspect a GCC issue. Anyone got any ideas or any pointers on what to try next?

When I modify the newfromtemplatedlg.cpp the following is the relevant biuld log output:
-------------- Build: sdk in Code::Blocks wx3.1.x (64 bit) (compiler: MSYS2 GNU GCC Compiler)---------------

Running target pre-build steps
.objs31_64\autorevision +wx +int +t .. include/autorevision.h
g++.exe -Wall -std=gnu++11 -m64 -g -Og -pipe -mthreads -fmessage-length=0 -fexceptions -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DNOPCH -DwxUSE_UNICODE -D_WIN64 -Woverloaded-virtual -DEXPORT_LIB -DEXPORT_EVENTS -DWXMAKINGDLL_SCI -IF:\Andrew_Development\wxWidgets-3.1.5\include -IF:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Iinclude\tinyxml -Iinclude -Iinclude\tinyxml -Iinclude\scripting\include -Isdk\mozilla_chardet\include -Isdk\mozilla_chardet\include\mfbt -Isdk\mozilla_chardet\include\nsprpub\pr\include -Isdk\mozilla_chardet\include\xpcom -Isdk\mozilla_chardet\include\xpcom\base -Isdk\mozilla_chardet\include\xpcom\glue -Isdk\scripting\bindings -c F:\Andrew_Development\codeblocks_sf\src\sdk\newfromtemplatedlg.cpp -o .objs31_64\sdk\newfromtemplatedlg.o
g++.exe -shared  -Wl,--out-implib=devel31_64\libcodeblocks.a -Wl,--dll -LF:\Andrew_Development\wxWidgets-3.1.5\lib\gcc_dll -Ldevel31_64 <<<OBJECT LIST REMOVED>>>  -o devel31_64\codeblocks.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined -m64  -lshfolder -ltxml -lwxscintilla_cb -lsquirrel -lgdi32 -lwxmsw31u
Output file is devel31_64\codeblocks.dll with size 126.20 MB
Running target post-build steps
cmd /c if not exist devel31_64\share\CodeBlocks mkdir devel31_64\share\CodeBlocks
zip -jq9 devel31_64\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc
cmd /c "cd sdk\resources & zip -0 -q ..\..\devel31_64\share\CodeBlocks\manager_resources.zip images\*.png images\8x8\*.png images\10x10\*.png images\12x12\*.png images\16x16\*.png images\20x20\*.png images\24x24\*.png images\28x28\*.png images\32x32\*.png images\40x40\*.png images\48x48\*.png images\56x56\*.png images\64x64\*.png"


Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #21 on: June 18, 2021, 09:50:05 am »
Can you post a backtrace? Does it crash if you use night builds provided by us?
(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 AndrewCot

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: Problem with svn 12446
« Reply #22 on: June 19, 2021, 07:29:45 am »
If I use the nightly SVN12458 it does not crash.

Attached is the GDB backtrace and the codeblocks.rpt for the same exe.

Offline AndrewCot

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: Problem with svn 12446
« Reply #23 on: June 19, 2021, 08:02:35 am »
If I comment out the "list->SortItems(SortTemplates, (wxIntPtr)0);" line then the wizard is shown. I have not done any testing on the wizard to see if it works or not.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
Re: Problem with svn 12446
« Reply #24 on: June 19, 2021, 10:27:52 am »
Your .rpt file is similar to mine published in reply #11.
As you, I can say that the "official" nighly version published by killerbot works as it should. But, that quite normal, because the problem appears with last gcc compiler's version (after january/february 2021). As the nightly is compiled with gcc 8.1 (a 3 years old version), it is not concerned by this bug.
This bug appears only for windows and 64 bits compilers.
So, is it a gcc problem or a codeblocks one, that's not obvious : new gcc versions are more strict on pointers apparently. I tried to use the same approach than the one I have found for filent.c, but without success until now.
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #25 on: June 19, 2021, 01:33:00 pm »
I can reproduce this with gcc 11.1, but I'm not sure it is the compiler. Somehow the data items gets corrupted when they get to the sort function. Investigating.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13393
    • Travis build status
Re: Problem with svn 12446
« Reply #26 on: June 19, 2021, 09:45:30 pm »
Fixed in SVN. It is odd that the night build works...  ;D
(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 AndrewCot

  • Multiple posting newcomer
  • *
  • Posts: 86
Re: Problem with svn 12446
« Reply #27 on: June 20, 2021, 03:14:29 am »
I pulled the latest github changes and rebuilt the exe and it now does not crash on file->new->project.


Offline gd_on

  • Lives here!
  • ****
  • Posts: 656
[Solved]Re: Problem with svn 12446
« Reply #28 on: June 20, 2021, 10:45:30 am »
Cool. Nice work.
Many thanks  ;)
« Last Edit: June 20, 2021, 11:35:27 am by gd_on »
Windows 10 64 bits (21H1), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 10.3.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).