James,
I don't know if anyone has tested CFFI on an X86-64 CLISP, but the following tests crash with an unexpected segfault:
I'm in the process of modifying the ffcall/FFI, but so far I've only planned to modify long-long support. I'm not aware of anything else not yet in the bugtracker.
Do you have access to an -64 machine or was that a user report?
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)?
so far I haven't found anything yet.
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)?
What if you call (ffi:memory-as (address-of *the-s-s-ch*) 'ffi:uint8/char/...) directly?
Regards, Jorg Hohle.
"Hoehle, Joerg-Cyril" Joerg-Cyril.Hoehle@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