[cffi-devel] Crashes on X86-64 CLISP

James Bielman jamesjb at jamesjb.com
Fri Feb 3 09:25:40 UTC 2006


"Hoehle, Joerg-Cyril" <Joerg-Cyril.Hoehle at t-systems.com> writes:

> Do you have access to an -64 machine or was that a user report?

Yeah, my new primary machine is an amd64.

>>  STRUCT.ALIGNMENT.1
> This is quite surprising, since it dereferences a single byte.  There
> should be no problems with alignment with byte-oriented access.
>
> Does this machine pass the clisp testsuite (ffi.tst)?

It appears to:

RUN-TEST: finished "tests/ffi" (0 errors out of 222 tests)
("tests/ffi" 222 0)

> What if you run the stepper in interpreted mode? Does the crash happen
> exactly within a call to ffi:MEMORY-AS or elsewhere?  This test
> doesn't seem to do anything else.  Does it actually invoke
> (ffi:memory-as address 'ffi:uint8 0) Or (ffi:memory-as address
> character 0)?

I'm not entirely sure how to try this---I'll read the documentation
tomorrow and give this a shot.

> What if you call (ffi:memory-as (address-of *the-s-s-ch*)
> ffi:uint8/char/...) directly?

That seems to work (I'm not sure what ADDRESS-OF is for, but it works
without it, which is what CFFI does IIUC):

CFFI-TESTS[5]> *the-s-s-ch*
#<FOREIGN-ADDRESS #x00002AAAABB48BA0>
CFFI-TESTS[6]> (ffi:memory-as *the-s-s-ch* 'ffi:uint8)
2
CFFI-TESTS[7]> (ffi:memory-as *the-s-s-ch* 'ffi:char)
2

Here's the segfault I get from that first test that fails:

*** - handle_fault error2 ! address = 0xffdb1070 not in [0x3339be000,0x333bd1c48) !
SIGSEGV cannot be cured. Fault address = 0xffdb1070.
Permanently allocated: 159712 bytes.
Currently in use: 4098744 bytes.
Free space: 489682 bytes.
make: *** [test-clisp] Segmentation fault

James



More information about the cffi-devel mailing list