I'm getting some strange problems when trying to link a shared library
to run as a mex-file under matlab, but I think this has nothing to do
with matlab and more to do with the link-line generated by cmake.
If I link against all the vxl libraries and try to run the shared
library, I get a segmentation fault the first time it runs with the
following stack-trace:
[0] 0x00103da2(0, 0, 0xbfffa8d8, 0x4000b782)
[1] libvnl.so:0x41d89af5(2, 0xbffff774, 0x080d8018, 0x4000b6c9)
[2] ld-linux.so.2:_dl_init~(0x080d8018, 0x08307614, 0, 0) + 270 bytes
[3] matlab:0x42112462(0xbfffaa60, 0xbfffa960, 0xbfffa968, 0x4000b430)
[4] ld-linux.so.2:_dl_catch_error~(0xbfffaa60, 0x62696c2f,
0x2e6c6e76, 0x42112
86e) + 147 bytes
[5] matlab:_dl_open~(0x082fb000, 0x40007e4f, 0x401c6eca
"libmwm_ir.INTERNAL",=20
0x400134c0) + 113 bytes
[6] libdl.so.2:0x40c22ef5(0xbfffabe0, 0xbfffaad0, 0xbfffaad8,
0x4000b430)
[7] ld-linux.so.2:_dl_catch_error~(0xbfffabe0, 0x40c23400, 0x401c6eca
"libmwm_
ir.INTERNAL", 0x40c231ee) + 147 bytes
[8] libdl.so.2:0x40c2328f(0x413d40a0
"/home/geoff/pkg/vxl/vxl_build/li..", 2,=20
0x4201033a "GLIBC_2.0", 0x40020465)
[9] libdl.so.2:dlopen~(0x413d40a0
"/home/geoff/pkg/vxl/vxl_build/li..", 2, 0x4
1baa4b8, 0x4002042a) + 50 bytes
[10] libut.so:utLoadLibrary~(0x413d40a0
"/home/geoff/pkg/vxl/vxl_build/li..",=20
0xbfffac94, 0x41baa4b8, 0x401006aa) + 73 bytes
[11] libmex.so:mexLoadMexFile~(0x413d40a0
"/home/geoff/pkg/vxl/vxl_build/li.."
, 0x413f4d50 "mextest", 0xbfffac94, 0x4092bd76) + 37 bytes
[12] libmwm_interpreter.so:0x4092bd9f(0x41baa4b8, 1348, 1349,
0x4092be3d)
[13] libmwm_interpreter.so:0x4092bea2(0, 0, 0xbfffc310, 0x41baa4b8)
[14] libmwm_interpreter.so:0x4094ef08(0, 0, 0xbfffc310, 0x41baa4b8)
[15] libmwm_interpreter.so:0x40936ee2(534, 0x413d406c "mextest", 0,
0)
[16] libmwm_interpreter.so:0x4091d03c(2, 0x40966540, 0xbfffd8b8,
0x409191b7)
[17] libmwm_interpreter.so:0x409191c3(0, 0x409735c0, 0xbfffd998,
0xbfffd9ec)
[18] libmwm_interpreter.so:0x40919954(0x08371e30 "mextest\n", 8, 0,
0)
[19] libmwm_interpreter.so:inEvalCmdNoEnd~(0x08371e30 "mextest\n",
76, 0xbfffd
bc8, 0x0805ff9a) + 105 bytes
[20] matlab:mnParser~(0x4213030c, 0x40013020, 0xbffff774, 0x4000b47c)
+ 906 by
tes
[21] matlab:main~(2, 0xbffff774, 0xbffff780, 0x42017559) + 2279 bytes
[22] matlab:__libc_start_main~(0x08053dc0, 2, 0xbffff774, 0x08051a5c)
+ 149 by
tes
Ignoring that, and just trying to run it a second time works fine. I
presume this has something to do with dlopen failing the first time
round, but succeeding the second time, and my guess is that it has
something to do with the ordering of the libraries on the link-line.=20
Any comments, suggestions, help?
Geoff.
|