KDevelop-generated application crashes due to libJPEG.dylib on MacOSX 10.9.2

Clemens Lang cal at macports.org
Sun Mar 16 05:49:26 PDT 2014


Hi,

> ./testgraphical.shell: line 4: 59742 Trace/BPT trap: 5
> DYLD_LIBRARY_PATH=/Users/marko/projects/TestGraphical/build/lib/./:/opt/local/lib${DYLD_LIBRARY_PATH:+:$DYLD_LIBRARY_PATH}
> "/Users/marko/projects/TestGraphical/build/src/testgraphical.app/Contents/MacOS/testgraphical"
> "$@"

That's your problem right there: You're setting DYLD_LIBRARY_PATH. This is a common habit people coming from Linux have, expecting DYLD_LIBRARY_PATH to behave like LD_LIBRARY_PATH. It doesn't. Please don't set it unless you understand the implications it has (and yes, what you're seeing is actually expected behavior when setting it). Use DYLD_FALLBACK_LIBRARY_PATH instead, or better, none of those variables at all, because they are often not necessary. Libraries on OS X a typically referenced using absolute paths and if your binary correctly contains those absolute paths, DYLD_* variables are unnecessary. Please see the manpage for dyld(1) for more information.

> So, does this mean, that a system framework tries to use a library supplied
> by MacPorts?

Yes, because that's what DYLD_LIBRARY_PATH does – it forces the loader to ignore the path but the basename in a binary. That's really the only way a system framework can "use" a macports library.


> This is what otool tells me:
>> $ otool -L testgraphical
> testgraphical:
> 	/opt/local/lib/libkdeui.5.dylib (compatibility version 5.0.0, current
> 	version 5.12.2)
> 	/opt/local/Library/Frameworks/QtDeclarative.framework/Versions/4/QtDeclarative
> 	(compatibility version 4.8.0, current version 4.8.5)
> 	/opt/local/lib/libkdecore.5.dylib (compatibility version 5.0.0, current
> 	version 5.12.2)
> 	/opt/local/Library/Frameworks/QtDBus.framework/Versions/4/QtDBus
> 	(compatibility version 4.8.0, current version 4.8.5)
> 	/opt/local/Library/Frameworks/QtCore.framework/Versions/4/QtCore
> 	(compatibility version 4.8.0, current version 4.8.5)
> 	/System/Library/Frameworks/Carbon.framework/Versions/A/Carbon (compatibility
> 	version 2.0.0, current version 157.0.0)
> 	/opt/local/Library/Frameworks/QtGui.framework/Versions/4/QtGui
> 	(compatibility version 4.8.0, current version 4.8.5)
> 	/opt/local/Library/Frameworks/QtSvg.framework/Versions/4/QtSvg
> 	(compatibility version 4.8.0, current version 4.8.5)
> 	/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version
> 	120.0.0)
> 	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version
> 	1197.1.1)

That doesn't contain any non-absolute paths, you won't need DYLD_LIBRARY_PATH. Just don't set it and you'll be fine.

-- 
Clemens Lang


More information about the macports-dev mailing list