Author Topic: Code::Blocks crashes often  (Read 3230 times)

Offline alexchen

  • Multiple posting newcomer
  • *
  • Posts: 84
Code::Blocks crashes often
« on: December 04, 2018, 03:29:25 am »
I am using Code::Blocks 17.2 on CentOS 7.4 with clang compiler.  I use the command line to do the build and it crashes very often.  This is what I get from the console:

*** Error in `/usr/bin/codeblocks': corrupted double-linked list: 0x0000000002082e40 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7b9e3)[0x7f759fb699e3]
/lib64/libc.so.6(+0x7c4fe)[0x7f759fb6a4fe]
/lib64/libcodeblocks.so.0(_ZN11ProjectFileD1Ev+0x446)[0x7f75a563a766]
/lib64/libcodeblocks.so.0(_ZN9cbProject13CloseAllFilesEb+0x165)[0x7f75a55837a5]
/lib64/libcodeblocks.so.0(_ZN14ProjectManager12CloseProjectEP9cbProjectbb+0x1b2)[0x7f75a5655c62]
/lib64/libcodeblocks.so.0(_ZN14ProjectManager16CloseAllProjectsEb+0x46)[0x7f75a5655e96]
/lib64/libcodeblocks.so.0(_ZN14ProjectManager14CloseWorkspaceEv+0xf1)[0x7f75a5656021]
/usr/bin/codeblocks[0x4a7c1a]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler21ProcessEventIfMatchesERK21wxEventTableEntryBasePS_R7wxEvent+0x56)[0x7f75a30e1746]
/lib64/libwx_baseu-2.8.so.0(_ZN16wxEventHashTable11HandleEventER7wxEventP12wxEvtHandler+0x6b)[0x7f75a30e17eb]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0xc7)[0x7f75a30e1b57]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_baseu-2.8.so.0(_ZN12wxEvtHandler12ProcessEventER7wxEvent+0x50)[0x7f75a30e1ae0]
/lib64/libwx_gtk2u_core-2.8.so.0(_ZN12wxWindowBase5CloseEb+0x6c)[0x7f75a3a6b6fc]
/usr/bin/codeblocks[0x44948e]
/lib64/libwx_baseu-2.8.so.0(_Z7wxEntryRiPPw+0x4c)[0x7f75a308a74c]
/usr/bin/codeblocks[0x436ee2]
/lib64/libc.so.6(__libc_start_main+0xf5)[0x7f759fb0fc05]
/usr/bin/codeblocks[0x443d78]
======= Memory map: ========
00400000-0053f000 r-xp 00000000 fd:00 2995030                            /usr/bin/codeblocks
0073f000-00750000 r--p 0013f000 fd:00 2995030                            /usr/bin/codeblocks
00750000-00756000 rw-p 00150000 fd:00 2995030                            /usr/bin/codeblocks
00756000-0075e000 rw-p 00000000 00:00 0
014f5000-02474000 rw-p 00000000 00:00 0                                  [heap]
7f7578000000-7f7578022000 rw-p 00000000 00:00 0
7f7578022000-7f757c000000 ---p 00000000 00:00 0
7f757c000000-7f757c022000 rw-p 00000000 00:00 0
7f757c022000-7f7580000000 ---p 00000000 00:00 0
7f7580000000-7f7580022000 rw-p 00000000 00:00 0
7f7580022000-7f7584000000 ---p 00000000 00:00 0
7f75877ff000-7f7587800000 ---p 00000000 00:00 0
7f7587800000-7f7588000000 rw-p 00000000 00:00 0                          [stack:125117]
7f7588000000-7f7588021000 rw-p 00000000 00:00 0
7f7588021000-7f758c000000 ---p 00000000 00:00 0
7f758caa1000-7f758caa2000 ---p 00000000 00:00 0
7f758caa2000-7f758d2a2000 rw-p 00000000 00:00 0                          [stack:125377]
7f758d2a2000-7f758d2de000 r--p 00000000 fd:00 103020741                  /usr/share/fonts/dejavu/DejaVuSansMono-Oblique.ttf
7f758d2de000-7f758d32b000 r--p 00000000 fd:00 103020739                  /usr/share/fonts/dejavu/DejaVuSansMono-Bold.ttf
7f758d32b000-7f758d3ab000 rw-s 00000000 00:04 8880142                    /SYSV00000000 (deleted)
7f758d3ab000-7f758d45b000 r--p 00000000 fd:00 103020757                  /usr/share/fonts/dejavu/DejaVuSans.ttf
7f758d45b000-7f758d51a000 r-xp 00000000 fd:00 3481629                    /usr/lib64/codeblocks/plugins/libcompiler.so
7f758d51a000-7f758d719000 ---p 000bf000 fd:00 3481629                    /usr/lib64/codeblocks/plugins/libcompiler.so
7f758d719000-7f758d720000 r--p 000be000 fd:00 3481629                    /usr/lib64/codeblocks/plugins/libcompiler.so
7f758d720000-7f758d722000 rw-p 000c5000 fd:00 3481629                    /usr/lib64/codeblocks/plugins/libcompiler.so
7f758d722000-7f758d725000 rw-p 00000000 00:00 0
7f758d725000-7f758d785000 rw-s 00000000 00:04 8781831                    /SYSV00000000 (deleted)
7f758d785000-7f758d78b000 r-xp 00000000 fd:00 101740694                  /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
7f758d78b000-7f758d98a000 ---p 00006000 fd:00 101740694                  /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
7f758d98a000-7f758d98b000 r--p 00005000 fd:00 101740694                  /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
7f758d98b000-7f758d98c000 rw-p 00006000 fd:00 101740694                  /usr/lib64/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so
7f758d98c000-7f758d98d000 ---p 00000000 00:00 0
7f758d98d000-7f758e18d000 rw-p 00000000 00:00 0                          [stack:125375]
7f758e18d000-7f758e18e000 ---p 00000000 00:00 0
7f758e18e000-7f758e98e000 rw-p 00000000 00:00 0                          [stack:125376]
7f758e98e000-7f758e98f000 ---p 00000000 00:00 0
7f758e98f000-7f758f18f000 rw-p 00000000 00:00 0                          [stack:125116]
7f758f18f000-7f758f191000 r-xp 00000000 fd:00 33624451                   /usr/lib64/libutil-2.17.so
7f758f191000-7f758f390000 ---p 00002000 fd:00 33624451                   /usr/lib64/libutil-2.17.so
7f758f390000-7f758f391000 r--p 00001000 fd:00 33624451                   /usr/lib64/libutil-2.17.so
7f758f391000-7f758f392000 rw-p 00002000 fd:00 33624451                   /usr/lib64/libutil-2.17.so
7f758f392000-7f758f3ca000 r-xp 00000000 fd:00 67266998                   /usr/lib64/gvfs/libgvfscommon.so
7f758f3ca000-7f758f5ca000 ---p 00038000 fd:00 67266998                   /usr/lib64/gvfs/libgvfscommon.so
7f758f5ca000-7f758f5cf000 r--p 00038000 fd:00 67266998                   /usr/lib64/gvfs/libgvfscommon.so
7f758f5cf000-7f758f5d0000 rw-p 0003d000 fd:00 67266998                   /usr/lib64/gvfs/libgvfscommon.so
7f758f5d0000-7f758f601000 r-xp 00000000 fd:00 91325                      /usr/lib64/gio/modules/libgvfsdbus.so
7f758f601000-7f758f800000 ---p 00031000 fd:00 91325                      /usr/lib64/gio/modules/libgvfsdbus.so
7f758f800000-7f758f801000 r--p 00030000 fd:00 91325                      /usr/lib64/gio/modules/libgvfsdbus.so
7f758f801000-7f758f803000 rw-p 00031000 fd:00 91325                      /usr/lib64/gio/modules/libgvfsdbus.so
7f758f803000-7f758f85d000 r-xp 00000000 fd:00 34746688                   /usr/lib64/libibus-1.0.so.5.0.503
7f758f85d000-7f758fa5c000 ---p 0005a000 fd:00 34746688                   /usr/lib64/libibus-1.0.so.5.0.503
7f758fa5c000-7f758fa5e000 r--p 00059000 fd:00 34746688                   /usr/lib64/libibus-1.0.so.5.0.503
7f758fa5e000-7f758fa5f000 rw-p 0005b000 fd:00 34746688                   /usr/lib64/libibus-1.0.so.5.0.503
/home/Alex/Linux/CodeBlocks_Build.sh: line 7: 125114 Aborted               /usr/bin/codeblocks --no-splash-screen --no-ipc --debug-log --build --target=Release64 my.workspace

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks crashes often
« Reply #1 on: December 04, 2018, 09:48:50 am »
Have you used packages to install this? Can you install the debug info package and post a backtrace from gdb?

I suppose you're hitting something similar to this bug: https://sourceforge.net/p/codeblocks/tickets/738/
(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 alexchen

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Code::Blocks crashes often
« Reply #2 on: December 04, 2018, 08:22:32 pm »
I get Code::Blocks package from SourceFource with wget:
wget --no-clobber https://sourceforge.net/projects/codeblocks/files/Binaries/17.12/Linux/CentOS%207/codeblock-17.12-1.el7.centos.x86_64.tar.xz

Expand the tar ball with tar:
tar -xf codeblock-17.12-1.el7.centos.x86_64.tar.xz

Install the RPM with yum:
sudo yum install -y codeblocks-libs-17.12-1.el7.centos.x86_64.rpm codeblocks-17.12-1.el7.centos.x86_64.rpm codeblocks-contrib-libs-17.12-1.el7.centos.x86_64.rpm codeblocks-contrib-17.12-1.el7.centos.x86_64.rpm

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks crashes often
« Reply #3 on: December 04, 2018, 08:26:38 pm »
Bleh, we're not providing the debuginfo rpms :(
(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 alexchen

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Code::Blocks crashes often
« Reply #4 on: December 04, 2018, 08:29:16 pm »
Where do I get the debug info package?  I do not know whether there is a crash dump,  I only get the output from the terminal when I run the batch script.

Offline alexchen

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Code::Blocks crashes often
« Reply #5 on: December 04, 2018, 08:38:53 pm »
Is the issue listed in https://sourceforge.net/p/codeblocks/tickets/738 resolved?  I am pretty sure the problem only happens in command line mode.
My build script uses a basic script to run Code::Blocks in command line mode for several workspaces and combine them into the final RPM. 
I do not see the problem if I run Code::Blocks in UI mode to build these workspaces.

The low level Code::Block build script itself is very simple:
/usr/bin/codeblocks --no-splash-screen --no-ipc --debug-log --build --target=Release64 ${WORKSPACE}.workspace, where $WORKSPACE is from the input.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Code::Blocks crashes often
« Reply #6 on: December 04, 2018, 09:15:00 pm »
I have a local fix for #738. It needs more testing, so it hasn't entered trunk/night builds yet.diff --git a/src/src/main.cpp b/src/src/main.cpp

If you're interested in rebuilding C::B this is the patch:
Code
index 886eead0f..7d4b74cc6 100644
--- a/src/src/main.cpp
+++ b/src/src/main.cpp
@@ -2720,7 +2720,6 @@ void MainFrame::OnApplicationClose(wxCloseEvent& event)

     CodeBlocksEvent evt(cbEVT_APP_START_SHUTDOWN);
     Manager::Get()->ProcessEvent(evt);
-    Manager::Yield();

     m_InitiatedShutdown = true;
     Manager::BlockYields(true);
(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 alexchen

  • Multiple posting newcomer
  • *
  • Posts: 84
Re: Code::Blocks crashes often
« Reply #7 on: December 04, 2018, 09:51:31 pm »
I think I will wait for the final RPM instead of building it myself since I do not have everything set up.
But I am willing to take the RPM if there is one I can try.
BTW, maybe we should consider building a RPM of the debug info in the future, too.

Thanks.