[odb-users] Issue on OSX 10.10 (Yosemite)

Boris Kolpackov boris at codesynthesis.com
Thu Nov 27 08:16:18 EST 2014


Hi David,

David Sarrut <David.Sarrut at creatis.insa-lyon.fr> writes:

> I install odb with brew, and libodb + libodb-sqlite by compiling (clang).
> No problem.
> 
> However, my app (compiled with clang also) seg fault with :
> ydDump(41632,0x7fff7710f300) malloc: ***
> mach_vm_map(size=3557673734211198976) failed (error code=3)
> *** error: can't allocate region
> *** set a breakpoint in malloc_error_break to debug
> libc++abi.dylib: terminating with uncaught exception of type
> std::bad_alloc: std::bad_alloc
> Abort trap: 6
> 
> which is probably related to the confusion between libc++ / libstdc++ (of
> odb brew ?).

ODB installed from Brew should not affect how you build the runtimes
and your application. Just think about it: you run the ODB compiler,
it produces C++ code which you compile with Clang. The GCC used by
ODB underneath and Clang that you use to build runtimes and your
code are completely isolated. They cannot somehow influence each
other via generated C++ source code.

But it seems you still somehow end up using different runtimes. Run
otool -L on your application and see if you see both libc++.dylib
and libstdc++.dylib. If you do, that's the problem. 

Next build sizeof_funds.cxx mentioned in the step-by-step instructions,
make sure that it runs, and verify with otool -L that it only links
to libc++.dylib.

Next run 'otool -L' on libodb.dylib and libodb-sqlite.dylib. Which
runtimes to they link?

One final thing: make sure you don't have some old (from Brew?)
versions of libodb.dylib and libodb-sqlite.dylib installed somewhere
(e.g., /usr/local/lib).

Boris



More information about the odb-users mailing list