Author Topic: Compilation successfull but cant start.  (Read 17080 times)

Offline eASy

  • Single posting newcomer
  • *
  • Posts: 3
Compilation successfull but cant start.
« on: July 27, 2005, 08:30:52 pm »
Hello,

I just compiled CodeBlocks from the CVS agains the wx2.6 Library. All is ok. But If I start it, i got a segfault. :(
How have I change the Makefile to compile with Debugger-Infos, so I can see in gdb whats wrong?

Or there are other ways to see whats wrong?


eASy

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compilation successfull but cant start.
« Reply #1 on: July 27, 2005, 08:45:45 pm »
Hello,

I just compiled CodeBlocks from the CVS agains the wx2.6 Library. All is ok. But If I start it, i got a segfault. :(
How have I change the Makefile to compile with Debugger-Infos, so I can see in gdb whats wrong?

I 'm afraid CVS HEAD is not currently working with wx-2.6.1. I 'm investigating it but can't give you any direction yet...
If you want to debug it and maybe find a solution, use gdb. Here's how:

1) copy devel/run.sh to devel/dbg.sh
2) edit devel/dbg.sh and edit the last line to read like this:
Code
gdb $APP_DIR/codeblocks.exe $@

Now run devel/dbg.sh. This will drop you in the gdb command line where issuing "run" (or just "r") will start C::B under gdb.

Yiannis.
Be patient!
This bug will be fixed soon...

Offline eASy

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compilation successfull but cant start.
« Reply #2 on: July 27, 2005, 08:59:33 pm »
Hello,

well the Problem is, that the Binary is not compiled with debugger infos. So gdb does not show useful infos:

Code
(gdb) r
Starting program: /usr/src/apps/codeblocks-1.0-RC1/CVS/codeblocks/src/output/codeblocks.exe
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread -1228272832 (LWP 345)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1228272832 (LWP 345)]
0xe08da5e0 in ?? ()
(gdb) bt
#0  0xe08da5e0 in ?? ()
#1  0xb7c6a52a in wxWindowBase::GetClientSize () from /usr/lib/libwx_gtk2_core-2.6.so.0
#2  0x080642ef in Configurations::operator[] ()
#3  0x080636cf in Configurations::operator[] ()
#4  0x0805d5e7 in ?? ()
#5  0x0805da5c in ?? ()
#6  0x0805eddc in wxAppConsole::CallOnInit ()
#7  0xb791689c in wxEntry () from /usr/lib/libwx_base-2.6.so.0
#8  0x0805cce4 in ?? ()
#9  0xb7444fe7 in __libc_start_main () from /lib/tls/libc.so.6
#10 0xbff06d84 in ?? ()
#11 0xbff06d8c in ?? ()
#12 0xb7f0a694 in ?? ()
#13 0xb755aff4 in ?? () from /lib/tls/libc.so.6
#14 0xbff06d10 in ?? ()
#15 0x08083700 in wxLayoutAlgorithm::~wxLayoutAlgorithm ()
Previous frame inner to this frame (corrupt stack?)
(gdb) q
The program is running.  Exit anyway? (y or n) y

So here my Question again: How have I change the Makefile that codeblocks is compiled with Debugger Infos? ;)


eASy

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compilation successfull but cant start.
« Reply #3 on: July 27, 2005, 09:58:43 pm »
I told you to work under devel/
You 're working under output/
These files are stripped from debugging symbols. Please work with the files under devel/

Yiannis.
Be patient!
This bug will be fixed soon...

Offline eASy

  • Single posting newcomer
  • *
  • Posts: 3
Re: Compilation successfull but cant start.
« Reply #4 on: July 28, 2005, 12:28:54 am »
Oh Im sorry. Misunderstodd you. :(

Here are now the Output of the devel-dir:

workstation devel $ cat run.sh
#!/bin/sh

APP_DIR=/usr/src/apps/codeblocks-1.0-RC1/CVS/codeblocks/src/devel
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
$APP_DIR/codeblocks.exe $@
workstation devel $ ./run.sh
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/tls/libthread_db.so.1".

(gdb) r
Starting program: /usr/src/apps/codeblocks-1.0-RC1/CVS/codeblocks/src/devel/codeblocks.exe
[Thread debugging using libthread_db enabled]
[New Thread -1227859136 (LWP 15792)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1227859136 (LWP 15792)]
0x00000013 in ?? ()
(gdb) bt
#0  0x00000013 in ?? ()
#1  0xb7ccf52a in wxWindowBase::GetClientSize () from /usr/lib/libwx_gtk2_core-2.6.so.0
#2  0x080642ef in MainFrame::CreateIDE (this=0x8159c18) at main.cpp:418
#3  0x080636cf in MainFrame (this=0x8159c18, parent=0x0) at main.cpp:362
#4  0x0805d5e7 in CodeBlocksApp::InitFrame (this=0x80ae178) at app.cpp:175
#5  0x0805da5c in CodeBlocksApp::OnInit (this=0x80ae178) at app.cpp:248
#6  0x0805eddc in wxAppConsole::CallOnInit (this=0x80ae178) at app.h:87
#7  0xb797b89c in wxEntry () from /usr/lib/libwx_base-2.6.so.0
#8  0x0805cce4 in main (argc=1, argv=0xbf86cd14) at app.cpp:78


Looks like a bug in wxGTK 2.6.1, or what do you mean?


eASy

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Compilation successfull but cant start.
« Reply #5 on: July 28, 2005, 01:05:27 am »
I recall there's some patch for wx2.6.1... now where was the patch guys?

darklordsatan

  • Guest
Re: Compilation successfull but cant start.
« Reply #6 on: July 28, 2005, 02:53:40 am »
I recall there's some patch for wx2.6.1... now where was the patch guys?

To the risk of sounding stupid, did you reffer to this? And its  fixes wxMSW only

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Compilation successfull but cant start.
« Reply #7 on: August 03, 2005, 03:41:45 pm »
I am working on the CVS version of codeblocks here, hopefully what I have found will be helpfull.
EDIT: RedHat Enterprise Linux WS wxGTK-2.6.1

I am sure Mandrav has already seen this, but I guess it would be good to post.  Here is the list of incompatibilities wxWidgets 2.6.1 has with wxWidgets 2.4.2.  I have also attached a log from valgrind 2.4.1, which does a really good job of chasing down memory errors and leaks, but only on linux.

There are also two mismatched delete/delete[] errors in wxZipMemory before this error occurs, but valgrind says they aren't related.  They stem from the InitXRCStuff (specifically the call to xmlResource::Get()->Load...) method which is called right before InitFrame call that sets off the creation of the MainFrame and the CreateIDE call.

Code
==882== Use of uninitialised value of size 4
==882==    at 0x1BD00845: wxWindowBase::GetClientSize() const (in /usr/local/lib/libwx_gtk2_core-2.6.so.0.0.0)
==882==    by 0x8064316: MainFrame::CreateIDE() (main.cpp:419)
==882==    by 0x8063832: MainFrame::MainFrame(wxWindow*) (main.cpp:362)
==882==    by 0x805D466: CodeBlocksApp::InitFrame() (app.cpp:176)
==882==    by 0x805D931: CodeBlocksApp::OnInit() (app.cpp:249)
==882==    by 0x805ED27: wxAppConsole::CallOnInit() (app.h:87)
==882==    by 0x1BEB61E0: wxEntry(int&, char**) (in /usr/local/lib/libwx_base-2.6.so.0.0.0)
==882==    by 0x805CAEE: main (app.cpp:79)
==882==
==882== Invalid read of size 4
==882==    at 0x1BD00845: wxWindowBase::GetClientSize() const (in /usr/local/lib/libwx_gtk2_core-2.6.so.0.0.0)
==882==    by 0x8064316: MainFrame::CreateIDE() (main.cpp:419)
==882==    by 0x8063832: MainFrame::MainFrame(wxWindow*) (main.cpp:362)
==882==    by 0x805D466: CodeBlocksApp::InitFrame() (app.cpp:176)
==882==    by 0x805D931: CodeBlocksApp::OnInit() (app.cpp:249)
==882==    by 0x805ED27: wxAppConsole::CallOnInit() (app.h:87)
==882==    by 0x1BEB61E0: wxEntry(int&, char**) (in /usr/local/lib/libwx_base-2.6.so.0.0.0)
==882==    by 0x805CAEE: main (app.cpp:79)
==882==  Address 0x320 is not stack'd, malloc'd or (recently) free'd
==882==
==882== Process terminating with default action of signal 11 (SIGSEGV)
==882==  Access not within mapped region at address 0x320
==882==    at 0x1BD00845: wxWindowBase::GetClientSize() const (in /usr/local/lib/libwx_gtk2_core-2.6.so.0.0.0)
==882==    by 0x8064316: MainFrame::CreateIDE() (main.cpp:419)
==882==    by 0x8063832: MainFrame::MainFrame(wxWindow*) (main.cpp:362)
==882==    by 0x805D466: CodeBlocksApp::InitFrame() (app.cpp:176)
==882==    by 0x805D931: CodeBlocksApp::OnInit() (app.cpp:249)
==882==    by 0x805ED27: wxAppConsole::CallOnInit() (app.h:87)
==882==    by 0x1BEB61E0: wxEntry(int&, char**) (in /usr/local/lib/libwx_base-2.6.so.0.0.0)
==882==    by 0x805CAEE: main (app.cpp:79)

EDIT: Just realized this should probably be in the dev forum, thats if I am helping.
« Last Edit: August 03, 2005, 03:54:05 pm by Game_Ender »

Offline Game_Ender

  • Lives here!
  • ****
  • Posts: 551
Re: Compilation successfull but cant start.
« Reply #8 on: August 03, 2005, 05:53:43 pm »
I got the wxZip error to go away by, they forgot to use "delete[]" instead of "delete" in the destructor of wxZipMemory on line line 488 of zipstrm.cpp.  The segfault is still there though, with an additional error that I forgot to mention before:
Code
==882== Conditional jump or move depends on uninitialised value(s)
==882==    at 0x805CD8F: CodeBlocksApp::LoadConfig() (app.cpp:92)
==882==    by 0x805D61C: CodeBlocksApp::OnInit() (app.cpp:222)
==882==    by 0x805ED27: wxAppConsole::CallOnInit() (app.h:87)
==882==    by 0x1BEB61E0: wxEntry(int&, char**) (in /usr/local/lib/libwx_base-2.6.so.0.0.0)
==882==    by 0x805CAEE: main (app.cpp:79)

I am trying to track down the cause right now, but it appears that m_HasDebugLog is used in the LoadConfig function of CodeBlocksApp before it is actually assigned a value.  It appears only to be assigned a value in CmdLineParse which isn't called till after that point.

EDIT: This rabbit whole is way deeper than I have time to fix right now. I got rid of the call to "GetClientSize" just to test, but I still gets lots of pointer errors (ie use of an unintialized value 4 bytes in size) related to GetSize.  Not to mention other errors related to conditional statements based on undefined values.  Later I think I will try to compile under wxGTK-2.4.2 and see how many of these errors are wxGTK 2.6.1 related.
« Last Edit: August 03, 2005, 06:33:57 pm by Game_Ender »

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Compilation successfull but cant start.
« Reply #9 on: August 03, 2005, 06:38:43 pm »
Game_Ender:

Please submit a bug report (or patch) to the wxWidgets project regarding the delete operator. (this doesn't concern the CB development team, but it's important to report it).

BTW, this valgrind looks really cool. I wish there was a windows version. Anyway, if m_HasDebugLog is initialized, try adding a default value (false) in the CodeblocksApp constructor. (I can't understand why it's not issued a warning on compilation - you're using CVS HEAD, right? I'm using VERSION_1_0 ).

Anyway, if this solves the crash, please submit a patch or bug report at SF.
« Last Edit: August 03, 2005, 06:40:19 pm by rickg22 »

BEEjay

  • Guest
Re: Compilation successfull but cant start.
« Reply #10 on: August 25, 2005, 04:54:41 pm »
hi there i've the VERION_1_= from the cvs an i can't start the programm too.

i use wxWidgets 2.4.x


here the debug
Code
NU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".

(gdb) r
Starting program: /usr/local/src/codeblocks/src/devel/codeblocks.exe
[Thread debugging using libthread_db enabled]
[New Thread 16384 (LWP 30177)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 16384 (LWP 30177)]
0xb7e91179 in wxWindowBase::FindWindow () from /usr/lib/libwx_gtk2-2.4.so
(gdb) bt
#0  0xb7e91179 in wxWindowBase::FindWindow () from /usr/lib/libwx_gtk2-2.4.so
#1  0xb7a82cda in EditorManager (this=0x82fa8f8, parent=0x812a920) at editormanager.cpp:176
#2  0xb7a822f4 in EditorManager::Get (parent=0x812a920) at editormanager.cpp:143
#3  0xb7a99e53 in Manager::GetEditorManager (this=0x81fa978) at manager.cpp:284
#4  0x08060ad6 in MainFrame::CreateMenubar (this=0x812a920) at main.cpp:524
#5  0x0806032e in MainFrame::CreateIDE (this=0x812a920) at main.cpp:457
#6  0x0805f0ef in MainFrame (this=0x812a920, lang=@0x80ce22c, parent=0x0) at main.cpp:370
#7  0x08057515 in CodeBlocksApp::InitFrame (this=0x80ce1d0) at app.cpp:176
#8  0x08057de8 in CodeBlocksApp::OnInit (this=0x80ce1d0) at app.cpp:301
#9  0xb7d30a38 in wxEntry () from /usr/lib/libwx_gtk2-2.4.so
#10 0x08056ba2 in main (argc=1, argv=0xbffff544) at app.cpp:79
(gdb)   



grv575

  • Guest
Re: Compilation successfull but cant start.
« Reply #11 on: August 25, 2005, 05:57:11 pm »
It's failing on:
   wxBitmapButton* myclosebutton = XRCCTRL(*m_pPanel,"ID_EditorManagerCloseButton",wxBitmapButton);

You sure you have XRC enabled in your wx2.4.2 build?
See the wiki about building wxWidgets.

BEEjay

  • Guest
Re: Compilation successfull but cant start.
« Reply #12 on: August 25, 2005, 06:31:39 pm »
It's failing on:
   wxBitmapButton* myclosebutton = XRCCTRL(*m_pPanel,"ID_EditorManagerCloseButton",wxBitmapButton);

You sure you have XRC enabled in your wx2.4.2 build?
See the wiki about building wxWidgets.


how can i Test ist waht are enabled in the build. because i use gentoo and don't see the configure details.


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: Compilation successfull but cant start.
« Reply #13 on: August 25, 2005, 07:19:42 pm »
Have you run './update' ?

Yiannis.
Be patient!
This bug will be fixed soon...

BEEjay

  • Guest
Re: Compilation successfull but cant start.
« Reply #14 on: August 25, 2005, 07:32:02 pm »
wuha thanks that's it!!! :)

Many many many thx ! :))))