Pages

Sunday, January 20, 2013

crash possibly due to bad symbol lookup

I have a c++ app running on OS/X Lion which crashes in a call to glIsBuffer(0). The XCode 4.5 stack trace states:

error: address doesn't contain a section that points to a section in a object file

and DYLD_PRINT_APIS shows:

dlopen(/System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreGraphics.framework/CoreGraphics, 0x00000009) ...

dlsym(0x7f9288d00cd0, gliCopyAttributes)

dlsym(0x7f9288d00cd0, gliGetVersion) dlsym(0x7f9298d70620, __CGBitmapContextDelegateCreate)

dlsym(0xffffffffffffffff, CGSCopyCoreGraphicsCapabilities)

Segmentation fault: 11

The last call to dlsym() appears to have been passed a rather strange library handle. I looked at the return values for dlopen, but it should be returning NULL on error. There are no errors reported for the dlopen calls in the log.

CGSCopyCoreGraphicsCapabilities is a Core Graphics call, though Google doesn't turn up any docs on it. My current hypothesis is that dlsym is using an invalid library handle. Perhaps the proper Core Graphics library is not loaded or has been unloaded.

Running otool shows a few version mismatches:

/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)

/usr/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 52.0.0)

but I don't know enough to say whether they are relevant.

Can anyone help to decipher what might be the problem?

thanks!


View the original article here

0 comments:

Post a Comment