[Openmcl-devel] Advice needed to debug shared library problem on Mac and Linux

Paul Meurer paul.meurer at uni.no
Tue Mar 29 00:19:17 PDT 2011


I am trying to interface a third-party shared library (libcfsm, a finite state transducer implementation by Xerox Parc) to Clozure. The library works without problems in Allegro and SBCL, both on Intel Mac and Linux, both 32 and 64 bit.

On Clozure, however, there are problems. I can load the library, initialize the necessary global structures and run certain functions, but others make Clozure crash like this (on the Mac):

Unhandled exception 10 at 0x491a20e, context->regs at #xb09cfb60
Exception occurred while executing foreign code
 at cfsm_push + 65
received signal 10; faulting address: 0x0
invalid address alignment
? for help
[899] Clozure CL kernel debugger: r
%rax = 0x0000000000000000      %r8  = 0x00000000ffffffff
%rcx = 0x00007fff870f1eda      %r9  = 0x0000000000000000
%rdx = 0x0000000002012000      %r10 = 0x0000000000001002
%rbx = 0x0000000001900790      %r11 = 0x0000000000000206
%rsp = 0x00000000b09d0030      %r12 = 0x000030004006372e
%rbp = 0x00000000b09d0060      %r13 = 0x0000302000b62bcf
%rsi = 0x0000000006800000      %r14 = 0x0000000000000020
%rdi = 0x0000000002012000      %r15 = 0x0000000004bcbc9d
%rip = 0x000000000491a20e   %rflags = 0x00010206

where %rax shouldn't be zero. The exception occurs always at the same function.

On Linux, trying to load the library already results in a Kernel memory allocation failure, it tries to allocate a pointer of size 140332065189888 bytes. I doubt that much memory is really needed.

I can imagine that this is difficult to make sense of. But maybe you have some ideas how on could try to debug the problem. It seems like a bug in Clozure.

Unfortunately, I don't have access to the source code. (I will eventually, in half a year or so, but I don't want to wait that long.)


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20110329/2b718252/attachment.htm>

More information about the Openmcl-devel mailing list