<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>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.</div><div><br></div><div>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):</div><div><br></div><div><blockquote class="webkit-indent-blockquote" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 40px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><div><div>Unhandled exception 10 at 0x491a20e, context->regs at #xb09cfb60</div></div><div><div>Exception occurred while executing foreign code</div></div><div><div> at cfsm_push + 65</div></div><div><div>received signal 10; faulting address: 0x0</div></div><div><div>invalid address alignment</div></div><div><div>? for help</div></div><div><div>[899] Clozure CL kernel debugger: r</div></div><div><div>%rax = 0x0000000000000000 %r8 = 0x00000000ffffffff</div></div><div><div>%rcx = 0x00007fff870f1eda %r9 = 0x0000000000000000</div></div><div><div>%rdx = 0x0000000002012000 %r10 = 0x0000000000001002</div></div><div><div>%rbx = 0x0000000001900790 %r11 = 0x0000000000000206</div></div><div><div>%rsp = 0x00000000b09d0030 %r12 = 0x000030004006372e</div></div><div><div>%rbp = 0x00000000b09d0060 %r13 = 0x0000302000b62bcf</div></div><div><div>%rsi = 0x0000000006800000 %r14 = 0x0000000000000020</div></div><div><div>%rdi = 0x0000000002012000 %r15 = 0x0000000004bcbc9d</div></div><div><div>%rip = 0x000000000491a20e %rflags = 0x00010206</div></div></blockquote><div><div><br></div></div><div>where %rax shouldn't be zero. The exception occurs always at the same function.</div><div><br></div><div>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.</div><div><br></div><div><div>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.</div><div><br></div><div>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.)</div></div></div><div><br></div><div>-- </div><div><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; ">Paul</span>
</div>
<br></body></html>