Code::Blocks Forums

User forums => Help => Topic started by: bnilsson on October 22, 2006, 07:51:09 pm

Title: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 22, 2006, 07:51:09 pm
I am using rev 3126.

CodeBlocks crashes when I try to open menu Settings/Compiler and debugger.

I have deleted ~/.codeblocks to eliminate the possibility of corrupt settings, but the problem persists.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: Pecan on October 22, 2006, 09:05:45 pm
I am using rev 3126.

CodeBlocks crashes when I try to open menu Settings/Compiler and debugger.

I have deleted ~/.codeblocks to eliminate the possibility of corrupt settings, but the problem persists.


This can also happen when one of the zip files in ../share/codeblocks is corruped or out of date.

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 22, 2006, 09:41:14 pm
I removed the installation and did 'make install'.
Now CB says at startup: "The file CBProfiler.zip could not be found. Please check your installation."

It still crashes at Settings/Compiler and debugger.

I kept CBProfiler.zip from previous installs, and the error message is not coming up if I put it in.
Funny that it is needed if it not generated.

Still crashing at Settings/Compiler and debugger.

I will now do a 'make clean' and try again.

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: MortenMacFly on October 22, 2006, 10:00:55 pm
I'm not sure if this is of help: But since you compile it on your own, C::B should create a report file with a backtrace of the crash. Not sure if this works of MacOS too, but it should...
The content of this file (usually codeblock.rpt in the folder where C::B is) will give an insight in the root of the crash.
With regards, Morten.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 22, 2006, 10:11:09 pm
I am still building, so I have not found codeblocks.rpt yet, but this is a part of the crash log from OSX:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   org.codeblocks.app                  0x0000b228 CompilerSettingsDlg::CompilerSettingsDlg[in-charge](wxWindow*) + 1320
1   org.codeblocks.app                  0x0001821c MainFrame::OnSettingsCompilerDebugger(wxCommandEvent&) + 28
2   libwx_macu-2.6.0.dylib              0x015cc4c8 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 200
3   libwx_macu-2.6.0.dylib              0x015cc788 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 168
4   libwx_macu-2.6.0.dylib              0x015ccf14 wxEvtHandler::ProcessEvent(wxEvent&) + 212
5   libwx_macu-2.6.0.dylib              0x015ccf44 wxEvtHandler::ProcessEvent(wxEvent&) + 260
6   libwx_macu-2.6.0.dylib              0x015ccf44 wxEvtHandler::ProcessEvent(wxEvent&) + 260

Of what value this is, I could not judge.

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 22, 2006, 10:30:56 pm

After 'make clean' and rebuild including bootstrap and configure, the problem persists.
And no codeblocks.rpt cound be found at ~/bin or in the application bundle ~/Applications/CodeBlocks.app/Contents/MacOS.

It is intriguing that I need to copy share/codeblocks/profile.zip to share/codeblocks/CBProfile.zip to get rid of the startup error message.
Some fix for lib_finder.zip and profile.zip was completed today in rev 3126, could there be some leftovers from that work?
And could this have anything to do with the crash?

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: Pecan on October 22, 2006, 11:54:48 pm
Try running CB under GDB. Modify a run.sh to execute from the Terminal.
Something like:
Code
# ! / bin / sh <== take blanks out of this line

APP_DIR=/Users/pecan/devel/mac/trunk/src/devel
export LD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
export DYLD_LIBRARY_PATH=$APP_DIR:$LD_LIBRARY_PATH
CODEBLOCKS_DATA_DIR=`pwd`
export CODEBLOCKS_DATA_DIR
gdb  $APP_DIR/codeblocks 

When you get the crash, type "backtrace full"
and post the results.

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: _teo_ on October 23, 2006, 01:31:22 pm
Now CB says at startup: "The file CBProfiler.zip could not be found. Please check your installation."

It still crashes at Settings/Compiler and debugger.

I second that on Ubuntu 6.06; wxGTK 2.6.3 (PL2); C::B rev. 3126
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 23, 2006, 06:06:59 pm
Quote
I second that on Ubuntu 6.06; wxGTK 2.6.3 (PL2); C::B rev. 3126

Settings/Compiler... Crash also?
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: _teo_ on October 23, 2006, 07:23:43 pm
Settings/Compiler... Crash also?
Yes, I get a message: "XRC resource 'dlgCBProfilerConfig' (class 'wxPanel') not found!"
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 23, 2006, 08:32:45 pm
Can you open Settings/Compiler and debugger without a crash?
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: mandrav on October 23, 2006, 08:39:44 pm
bnilsson, try disabling the profiler plugin and check again if you can open the compiler settings.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 23, 2006, 10:16:27 pm
I disabled profiler, libfinder, and symbol table and tested by every step, the crash persists.
I disabled ALL plugins except compiler and debugger, and the crash persists.
BTW, now Project/Build options also crashes, system crash report:

Exception:  EXC_BAD_ACCESS (0x0001)
Codes:      KERN_PROTECTION_FAILURE (0x0002) at 0x00000000

Thread 0 Crashed:
0   libcompiler.so                    0x0664cfd4 CompilerOptionsDlg::OnUpdateUI(wxUpdateUIEvent&) + 292
1   libwx_macu-2.6.0.dylib            0x015cc4c8 wxEvtHandler::ProcessEventIfMatches(wxEventTableEntryBase const&, wxEvtHandler*, wxEvent&) + 200
2   libwx_macu-2.6.0.dylib            0x015cc788 wxEventHashTable::HandleEvent(wxEvent&, wxEvtHandler*) + 168

I don't know if this came at the same time as the Settings/Compiler.. crash.

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: _teo_ on October 23, 2006, 11:32:39 pm
Can you open Settings/Compiler and debugger without a crash?
No, I can't. However, please note, that I am new here. Maybe I've done something wrong.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 12:26:58 am
Pecan,

About backtrace:

If I do
 cd ~/Applications/CodeBlocks.app/Contents/MacOS
 ./CodeBlocks --prefix=/Users/bnilsson
I can get CB to run recieving events and respond to mouseclicks.

I have a hard time executing your suggested script inside the bundle, since CB always say "Cannot find resources... --was configured to be installed in
/opt/local/share/codeblocks.. please use --prefix or set CODEBLOCKS_DATA_DIR..."

gdb does not take the second argument --prefix, and setting CODEBLOCKS_DATA_DIR apparently has no effect.

Any suggestions getting a backtrace from a MacOS bundle?


Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: afb on October 25, 2006, 12:36:23 am
Adding a resource fork (with: `wx-config --rezflags` /path/to/bin/codeblocks) is enough to make wxMac receive events and not launch in the background, and useful when debugging.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 01:11:34 am
Please clarify.
Is this something you do in configure or just on the fly?
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: takeshimiya on October 25, 2006, 01:24:39 am
Please clarify.
Is this something you do in configure or just on the fly?
Just go to the terminal and run `wx-config --rezflags` /path/to/bin/codeblocks
This one of the ways to be able to receive events in wxWidgets apps.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 07:36:49 am
I tried it and it had no effect.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: afb on October 25, 2006, 11:26:01 am
You should also be able to start your bundle up like so:
Code
(gdb) run --prefix=/Users/bnilsson
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 07:23:59 pm
Thanks, I can start it but it does not respond to clicks.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 07:37:04 pm
So, finally, I got a backtrace for the Settings/Compiler and debugger crash. (I didn't pay attention to the singlequotes in `wx-config --rezflags` before)

Reading symbols for shared libraries . done
Reading symbols for shared libraries ... done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_PROTECTION_FAILURE at address: 0x00000000
0x0000b228 in CompilerSettingsDlg::CompilerSettingsDlg ()
(gdb) backtrace full
#0  0x0000b228 in CompilerSettingsDlg::CompilerSettingsDlg ()
No symbol table info available.
#1  0x0001821c in MainFrame::OnSettingsCompilerDebugger ()
No symbol table info available.
#2  0x015cd4c8 in wxEvtHandler::ProcessEventIfMatches ()
No symbol table info available.
#3  0x015cd788 in wxEventHashTable::HandleEvent ()
No symbol table info available.
#4  0x015cdf14 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#5  0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#6  0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#7  0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#8  0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#9  0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#10 0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#11 0x015cdf44 in wxEvtHandler::ProcessEvent ()
No symbol table info available.
#12 0x016d2e0c in wxMenuBase::SendEvent ()
No symbol table info available.
#13 0x015f38f4 in wxMacAppEventHandler ()
No symbol table info available.
#14 0x93207554 in DispatchEventToHandlers ()
No symbol table info available.
#15 0x93206cac in SendEventToEventTargetInternal ()
No symbol table info available.
#16 0x9320da60 in SendEventToEventTarget ()
No symbol table info available.
#17 0x932862cc in SendHICommandEvent ()
No symbol table info available.
#18 0x932b6158 in SendMenuItemSelectedEvent ()
No symbol table info available.
#19 0x932b6060 in FinishMenuSelection ()
No symbol table info available.
#20 0x9329d56c in MenuSelectCore ()
No symbol table info available.
#21 0x9329d054 in MenuSelect ()
No symbol table info available.
#22 0x0164d7f0 in wxMacTopLevelMouseEventHandler ()
No symbol table info available.
#23 0x015f3e5c in wxMacAppEventHandler ()
No symbol table info available.
#24 0x93207554 in DispatchEventToHandlers ()
No symbol table info available.
#25 0x93206cac in SendEventToEventTargetInternal ()
No symbol table info available.
#26 0x9320da60 in SendEventToEventTarget ()
No symbol table info available.
#27 0x932992d4 in HandleMouseEvent ()
No symbol table info available.
#28 0x9320ddcc in ToolboxEventDispatcherHandler ()
No symbol table info available.
#29 0x932077a4 in DispatchEventToHandlers ()
No symbol table info available.
#30 0x93206cac in SendEventToEventTargetInternal ()
No symbol table info available.
#31 0x9320da60 in SendEventToEventTarget ()
No symbol table info available.
#32 0x015f144c in wxApp::MacHandleOneEvent ()
No symbol table info available.
#33 0x015f1544 in wxApp::MacDoOneEvent ()
No symbol table info available.
#34 0x015f15d8 in wxApp::MainLoop ()
No symbol table info available.
#35 0x00005290 in CodeBlocksApp::OnRun ()
No symbol table info available.
#36 0x0157be44 in wxEntry ()
No symbol table info available.
#37 0x00003e48 in main ()
No symbol table info available.
(gdb)
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: Pecan on October 25, 2006, 08:22:35 pm
Could you compile CB with the debugging option -g on?
That backtrace has no symbol tables.

or try this:

Try the following in your working copy:

Code
make clean-zipfiles // <- this is the important part
make
make install // (or whatever it is that you do on Mac)

(don't type the comments!)
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 08:28:45 pm
mandrav just fixed it all (at least for me) by:

     make clean-zipfiles

It fixed both the "Settings/Compiler and debugger" and "Project/Build options" crashes.

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 25, 2006, 08:30:55 pm
BTW: show me the command line that enables a compile with the debugging option -g.
Is it a configure option?
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: sethjackson on October 25, 2006, 08:34:49 pm
BTW: show me the command line that enables a compile with the debugging option -g.
Is it a configure option?

Code
g++ -g your_source_file.cpp
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 26, 2006, 08:41:47 am
Would I have to change to "g++ -g" in every Makefile?
It seems like a lot of work and to invite mistakes.
Is there a more semi-automatic way to setup the CB build to use this option?

Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: mandrav on October 26, 2006, 08:56:02 am
http://wiki.codeblocks.org/index.php?title=Debugging_with_Code::Blocks
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: bnilsson on October 26, 2006, 10:07:47 am
I was asking how to build CB with the debug option on, not how to use it.
I have not yet been able to build CB using CB.
Title: Re: MacOSX: CB crashes at Settings/Compiler and debugger
Post by: afb on October 26, 2006, 10:26:16 am
Strange, I instead find that I need to strip my binaries of debugging symbols afterwards ?
(i.e. that it does build with the -g symbols enabled by default, and is huge because of it)

But they might be talking about the extra Code::Blocks debug code, enabled by configure:
Code
  --enable-debug          turn on debugging (default is OFF)