troubleshooting dylib crashes?

  • Hi all,

    Quick story short: I've been porting my appscript bridge from Python
    to Ruby (see <http://rb-appscript.rubyforge.org> for source release),
    and while it's been d/l'd a couple hundred times with few complaints,
    I have received a couple slightly odd reports of it crashing on
    import. Alas, my C is teh suk and my Carbon/CF runtime knowledge no
    better, so I'm a bit clueless on how to go about troubleshooting this
    sort of problem (never mind identifying the cause). Especially when
    I'm unable to replicate it OMMs, and have to rely on the end-user to
    run stuff and report back.

    The one I'm particularly stuck on is a crash in Ruby 1.8.5 on a
    667Mhz G4 running 10.4.8, with a crash log like this (most relevant
    except below; I can send the full thing to anyone that wants it though):

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

    Thread 0 Crashed:
    0  libSystem.B.dylib           0x901316e0 bcmp + 224
    1  com.apple.CoreFoundation     0x907f280c __CFInitialize + 420
    2  com.apple.CoreFoundation     0x9083753c __CFSetupFoundationBridging
    + 56
    3  com.apple.Foundation         0x929ca4f4 _NSToDoAtProcessStart + 1072
    4  com.apple.Foundation         0x9293aa60 _NSInitializePlatform + 464
    5  libobjc.A.dylib             0x90a40548 call_class_loads + 164
    6  libobjc.A.dylib             0x90a4045c call_load_methods + 124
    7  libobjc.A.dylib             0x90a3b2c8 map_images + 760
    8  dyld                         0x8fe0f3c0
    ImageLoaderMachO::doNotification(dyld_image_mode, unsigned,
    dyld_image_info const*) + 108
    9  dyld                         0x8fe035a8 dyld::notifyAdding
    (std::vector<ImageLoader*, std::allocator<ImageLoader*> >&) + 260
    10  dyld                         0x8fe0da94 ImageLoader::link
    (ImageLoader::LinkContext const&, ImageLoader::BindingLaziness,
    ImageLoader::InitializerRunning, unsigned) + 324
    11  dyld                         0x8fe04054 dyld::link(ImageLoader*,
    ImageLoader::BindingLaziness, ImageLoader::InitializerRunning) + 380
    12  dyld                         0x8fe08e88 NSLinkModule + 240
    13  libSystem.B.dylib           0x9002cd2c NSLinkModule + 104
    14  ruby                         0x0001f710 dln_load + 336 (dln.c:1478)
    ...

    [Rest of the stack trace is just lots of boring ruby interpreter
    calls as it walks the AST.]

    From reading this I have a vague suspicion that it might not be my
    fault inasmuch as it hasn't even got as far as executing my own code
    yet; in addition he reported the same crash when trying a similar
    package (RubyOSA) that links against much the same Carbon APIs and
    whatnot.

    Anyway, if any kind souls here would like to take pity on the C noob
    and maybe give some recommendations on how to go about narrowing down
    the problem - what particular steps to take, what tests to try, what
    debugging options to use, what to look for, etc. - it'd be a big help
    to me. Plus if anyone's heard of similar cases that might suggest the
    possible cause here, that'd also be great.

    Many thanks,

    has
    --
    http://freespace.virgin.net/hamish.sanderson/
    http://appscript.sourceforge.net
    http://rb-appscript.rubyforge.org
previous month november 2006 next month
MTWTFSS
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30      
Go to today