Author Topic: C::B segfault on startup (~2387)  (Read 6804 times)

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
C::B segfault on startup (~2387)
« on: April 26, 2006, 09:37:04 pm »
C::B 2387 and below to (if i remember correctly) 236x.
Quote
gcc (GCC) 4.1.0 (Gentoo 4.1.0),

GNU Make 3.81,

glibc 2.4 - Available extensions:
        The C stubs add-on version 2.1.2.
        crypt add-on version 2.1 by Michael Glad and others
        GNU Libidn by Simon Josefsson
        GNU libio by Per Bothner
        NIS(YP)/NIS+ NSS modules 0.19 by Thorsten Kukuk
        Native POSIX Threads Library by Ulrich Drepper et al
        Support for some architectures added on, not maintained in glibc core.
        BIND-8.2.3-T5B
Thread-local storage support included.

wxGTK 2.6.3.2 Unicode (wx_gtk2u)
C::B compiled with flags that i use in emerge:
Quote
--enable-contrib CXXFLAGS="-O2 -march=athlon-xp -mtune=athlon-xp -m3dnow \
-mmmx -mfpmath=387 -pipe -fomit-frame-pointer -fno-rename-registers -fno-ident \
-fvisibility-inlines-hidden -s"
Quote
(gdb) run
Starting program: /usr/local/bin/codeblocks
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1231894864 (LWP 21084)]
[New Thread -1252234336 (LWP 21169)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1231894864 (LWP 21084)]
0xb7dc6bf1 in copyloop () from /usr/local/lib/libcodeblocks.so.0
(gdb) bt
#0  0xb7dc6bf1 in copyloop () from /usr/local/lib/libcodeblocks.so.0
#1  0xb7da4470 in scWxString::scWxString () from /usr/local/lib/libcodeblocks.so.0
#2  0xb7dc79cf in CallSystemFunction () from /usr/local/lib/libcodeblocks.so.0
#3  0xb7de8dd7 in asCContext::ExecuteNext () from /usr/local/lib/libcodeblocks.so.0
#4  0xb7dea3ab in asCContext::Execute () from /usr/local/lib/libcodeblocks.so.0
#5  0xb7d84292 in ScriptingManager::Compile () from /usr/local/lib/libcodeblocks.so.0
#6  0xb58c0424 in Wiz::OnAttach () from /usr/local/share/codeblocks/plugins/libprojectwizard.so
#7  0xb7c90cee in cbPlugin::Attach () from /usr/local/lib/libcodeblocks.so.0
#8  0xb7d451a0 in PluginManager::LoadAllPlugins () from /usr/local/lib/libcodeblocks.so.0
#9  0x08083f40 in MainFrame::OnToggleStatusBar ()
#10 0x08090c27 in MainFrame::OnPluginLoaded ()
#11 0x08063420 in CodeBlocksApp::OnAppActivate ()
#12 0x0806422f in CodeBlocksApp::OnAppActivate ()
#13 0x0806520f in CodeBlocksApp::OnAppActivate ()
#14 0xb74872c2 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#15 0xb74873a7 in wxEntry () from /usr/lib/libwx_baseu-2.6.so.0
#16 0x0805fc0f in ?? ()
#17 0xb72ca8bf in __libc_start_main () from /lib/libc.so.6

Clean install, ~/.codeblocks dir deleted. I dont know why but it segfaults on splashscreen.
Did i do something wrong here? If more info is needed then please tell me what,
and i will try to put it here.
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: C::B segfault on startup (~2387)
« Reply #1 on: April 26, 2006, 09:46:19 pm »
For some reason it fails when running the new project wizard's script. A temporary fix is to disable it by moving away or renaming <install_prefix>/share/codeblocks/templates/wizard/config.script.
Be patient!
This bug will be fixed soon...

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: C::B segfault on startup (~2387)
« Reply #2 on: April 26, 2006, 10:24:24 pm »
Thanks, it works :)
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline tiger683

  • Multiple posting newcomer
  • *
  • Posts: 20
  • o_0
Re: C::B segfault on startup (~2387)
« Reply #3 on: May 05, 2006, 12:57:57 pm »
Any progress with this one?
Where I work :P

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: C::B segfault on startup (~2387)
« Reply #4 on: May 05, 2006, 01:57:02 pm »
Any progress with this one?


What progress? It works just fine in any 32bit distro I tested it (scripting is not supported for 64bit currently), I can't see any errors. I don't have a Gentoo system to test though nor can I provide support for ebuilds (don't know about them), sorry.
Be patient!
This bug will be fixed soon...

Offline tiger683

  • Multiple posting newcomer
  • *
  • Posts: 20
  • o_0
Re: C::B segfault on startup (~2387)
« Reply #5 on: May 05, 2006, 02:16:26 pm »
Any progress with this one?


What progress? It works just fine in any 32bit distro I tested it (scripting is not supported for 64bit currently), I can't see any errors. I don't have a Gentoo system to test though nor can I provide support for ebuilds (don't know about them), sorry.

Thanks for fast reply.

Then i guess i'll just dig into the code myself (since i use C::B for my current project and update C::B pretty often, it is worth spending these few moments on fixing it).
Thanks for your hard work :)

Regards,

Rafael
« Last Edit: May 05, 2006, 02:17:57 pm by tiger683 »
Where I work :P

Offline tiger683

  • Multiple posting newcomer
  • *
  • Posts: 20
  • o_0
Re: C::B segfault on startup (~2387) [SOLVED]
« Reply #6 on: May 11, 2006, 03:03:13 pm »
This seems to be a CXXFLAGS problem.
I added a flag-stripping directive into the ebuild in my overlay
and now the problem seems to be gone (I can start C::B with wizard enabled :D)

Could anyone confirm or neglect that the -fvisibility-inlines-hidden cxxflag causes such misbehaviour?
I'll test this myself too, but maybe someone has a faster machine to recompile and look for breakage.
EDIT: This would in particular be useful to just filter THE offending flag instead of stripping them all :]

mandrav, sorry for wasting your time with bugging you about this problem  :?

Thanks for an awesome IDE,

T
« Last Edit: May 11, 2006, 03:11:47 pm by tiger683 »
Where I work :P

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: C::B segfault on startup (~2387)
« Reply #7 on: May 11, 2006, 06:31:53 pm »
Hi,
i removed
Quote
-fvisibility-inlines-hidden
flag, and C::B still segfault in copyloop(). I will check other flags.
best regards,
p7
 Free open source UML modeling tool: ArgoUML

Offline tiger683

  • Multiple posting newcomer
  • *
  • Posts: 20
  • o_0
Re: C::B segfault on startup (~2387)
« Reply #8 on: May 11, 2006, 07:06:55 pm »
Hi,
i removed
Quote
-fvisibility-inlines-hidden
flag, and C::B still segfault in copyloop(). I will check other flags.

Now, who would have thought...
I went through everything i did before it started working and guess what...the problem is NOT C::B itself!
The winner of this puzzle is revealed by this cute little backtrace:
Code: "gdb"
(gdb) next
[New Thread -1241998432 (LWP 16121)]

Program received signal SIGSEGV, Segmentation fault.
0xb71f55df in inflateBack () from /lib/libz.so.1
(gdb) bt
#0  0xb71f55df in inflateBack () from /lib/libz.so.1
#1  0xbfe32c68 in ?? ()
#2  0xb7ab4411 in operator delete () from /usr/lib/gcc/i686-pc-linux-gnu/4.1.0-pre20060223/libstdc++.so.6
Previous frame inner to this frame (corrupt stack?)
(gdb)

So, stack corruption in call to a zlib function...huh...
It gets even better, if you recompile zlib _WITHOUT_ the -ftree-vectorize CFLAG (no, not CXXFLAG :P),
C::B will start without a problem  :shock: . Strange enough but worksforme :P
I knew there was something about the vectorizer, that's why i switched it off a while after having compiled my system...
but also after having compiled zlib last time  :lol:

I hope it helps you too ;)

Thanks

T
Where I work :P

Offline polygon7

  • Multiple posting newcomer
  • *
  • Posts: 104
    • Home site
Re: C::B segfault on startup (~2387)
« Reply #9 on: May 11, 2006, 09:52:32 pm »
I dont use -ftree-vectorize. I found bogus flag in my case: -fomit-frame-pointer. I removed this flag and now C::B run without problems. Strange thing is that flag works for older versions. Maybe somebody know why this flag triggers segfault?
best regards,
p7
 Free open source UML modeling tool: ArgoUML