• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: XCode debugger won't launch my app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XCode debugger won't launch my app


  • Subject: Re: XCode debugger won't launch my app
  • From: Jim Ingham <email@hidden>
  • Date: Thu, 6 May 2004 10:50:21 -0700

We have a bug which looks somewhat like this. The conditions of the bug are:

1) you have a framework with a default load address of 0x0 - this is the default when you don't specify anything with the -seg1addr linker flag.
2) You are setting a breakpoint in the framework.
3) The breakpoint is at a low address in the framework


The bug is that gdb writes its breakpoints into the debugee program right when the program starts up. But at startup, the framework & the main app both are loading at 0x0, so their code overlaps. So as the app starts up we are going to write the shared library's breakpoint onto what will be the main executable's code. Normally this doesn't matter, because when the framework actually loads, dyld will slide the framework somewhere else, and we will get the load notification and shift the breakpoint accordingly.

But if the breakpoint in the shared library is low enough that it overlaps the dyld load commands of the application (these are stored at the beginning of an executable or framework in Mach-O) then the breakpoint gets written on top of the dyld load commands of the executable as it is starting up, and the executable doesn't get as far as loading all its shared libraries, because the load information is corrupted. Generally it crashes somewhere in dyld like you are seeing.

The correct fix for the bug is for gdb to hold off setting breakpoints in shared libraries till it gets the load notification for them. But that's not going to help you much right now...

The short-term workaround for you is just to give your framework some load address that gets it out of the way of the main executable. Pretty much anything will do. For the other project I work on that has lots of shared libraries, we use

-seg1addr 0xa000000

for the first framework, and the 0xb000000, etc. This doesn't seem to collide with anything. You set this in the Other Linker Flags section of the Framework Targets build settings. Try setting this for your framework, and then rebuilding it, and see if you can start up again.

If this does not fix the problem, and you don't mind giving us a look at your project, please file a bug with your project files.

Thanks,

Jim

On May 6, 2004, at 9:38 AM, Fred Leboucher wrote:

Got a really weird problem coming up today.. First the app wouldn't load in the debugger telling me that it could not load the framework that goes with the app (in the error msg, the name was cut at ".fr\340" instead of ".framework"). This one only occured once. I made a Clean All/Build and retried, and then it started crashing with this backtrace :
#0 0x8fe27624 in __dyld_strrchr ()
#1 0x8fe03970 in __dyld_get_framework_name ()
#2 0x8fe02df8 in __dyld_try_framework_search ()
#3 0x8fe0320c in __dyld_load_library_image ()
#4 0x8fe068cc in __dyld_load_images_libraries ()
#5 0x8fe02cd8 in __dyld_load_executable_image ()
#6 0x8fe01a30 in __dyld__dyld_init ()


I also set the variable DYLD_PRINT_LIBRARIES to 1, and here's what I get :
loading libraries for DYLD_INSERT_LIBRARIES=/Developer/Applications/Xcode.app/Contents/ PlugIns/GDBMIDebugging.pbplugin/Contents/Resources/ PBGDBIntrospectionSupport.A.dylib
loading library: /Developer/Applications/Xcode.app/Contents/PlugIns/ GDBMIDebugging.pbplugin/Contents/Resources/ PBGDBIntrospectionSupport.A.dylib
loading libraries for image: /bin/bash
loading library: /usr/lib/libncurses.5.dylib
loading library: /usr/lib/libSystem.B.dylib
loading libraries for image: /Developer/Applications/Xcode.app/Contents/PlugIns/ GDBMIDebugging.pbplugin/Contents/Resources/ PBGDBIntrospectionSupport.A.dylib
loading libraries for image: /usr/lib/libncurses.5.dylib
loading libraries for image: /usr/lib/libSystem.B.dylib
loading library: /usr/lib/system/libmathCommon.A.dylib
loading libraries for image: /usr/lib/system/libmathCommon.A.dylib
Temporarily disabling shared library breakpoints: 1
Running...
loading libraries for DYLD_INSERT_LIBRARIES=/Developer/Applications/Xcode.app/Contents/ PlugIns/GDBMIDebugging.pbplugin/Contents/Resources/ PBGDBIntrospectionSupport.A.dylib
loading library: /Developer/Applications/Xcode.app/Contents/PlugIns/ GDBMIDebugging.pbplugin/Contents/Resources/ PBGDBIntrospectionSupport.A.dylib
loading libraries for image: /Users/fred/XDolphin/build/MyApp.app/Contents/MacOS/MyApp
Program received signal: "EXC_BAD_ACCESS".


The app launches fine on its own, but since then I can't manage to launch in the debugger, no matter what I do...
Anyone would have any idea on how to make it work back ?


Thanks !
Fred Leboucher
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.



--
Jim Ingham                                   email@hidden
Developer Tools
Apple Computer
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: XCode debugger won't launch my app
      • From: Fred Leboucher <email@hidden>
References: 
 >XCode debugger won't launch my app (From: Fred Leboucher <email@hidden>)

  • Prev by Date: Re: OT: mail and homepage.mac.com
  • Next by Date: Re: OT: mail and homepage.mac.com
  • Previous by thread: XCode debugger won't launch my app
  • Next by thread: Re: XCode debugger won't launch my app
  • Index(es):
    • Date
    • Thread