[Vm-dev] Having FFI trouble with 4.2 on Linux

Ken Causey ken at kencausey.com
Tue May 24 21:22:32 UTC 2011


Matthew on #squeak was having trouble with FFI on Ubuntu so I thought I
would give it a try on my Debian Testing system.  I should note that I
am on X86_64 while Matthew is on i386/i686.  I think Matthew will follow
up with details about his experience.

First I've not been Squeaking much in some time so all I have handy on
my current development system is a 4.2-all-in-one in case I want to help
answer a #squeak question.  So I started out using this image and VM. 
The image is the stock 4.2 image unmodified.

I added 'source.squeak.org/FFI' to Monticello and installed

http://source.squeak.org/FFI/FFI-Pools-eem.3.mcz
http://source.squeak.org/FFI/FFI-Kernel-mtf.23.mcz
http://source.squeak.org/FFI/FFI-Examples-ar.1.mcz
http://source.squeak.org/FFI/FFI-Tests-jcg.4.mcz
http://source.squeak.org/FFI/FFI-Unix-mtf.4.mcz

in that order.

In this configuration if I run the tests I get 1 success, 1 failure, and
21 errors.  In the process I also tried earlier -ar versions of the
packages with much the same result.

Watching with strace it appears it is unable to find the ffiTest*
symbols in the supplied so.SqueakFFIPrims and if I look at it with
objdump they do not appear to be there.  Note that this file is only
23572 bytes in size.

Next I tried building 4.4.7-2357 (the latest Unix VM and the same
distributed in the all-in-one) myself.  After a few fumbles I got that
build with an FFI plugin but when I try the tests with that build the
image immediately crashes:

"Segmentation fault

24014104 ExternalFunction>invokeWith:with:with:with:
24011904 FFIPluginTests>testConstructedCharCall
24011812 TestCase>performTest
24011708 TestCase>runCase
24011616 BlockClosure>on:do:
24011524 TestCase>timeout:after:
24011432 BlockClosure>ensure:
...."

I can provide more info if desired.  Note that the so.SqueakFFIPrims
with my own build is 38353 bytes in size and I can confirm it has the
ffiTest* symbols.  I have not as of yet tested this with strace.

As part of the process I also tried cog 2382 and it works just fine, all
the tests pass.  I simply downloaded the linux binary tgz, extracted it,
and ran it in place with the very same 4.2 stock image.  Oh, and cog's
SqueakFFIPrims is 260838 in bytes.  Totally different implementation?

Note that in all cases I repeated the entire process of installing the
FFI packages manually.

Ken



More information about the Vm-dev mailing list