Re: [Pharo-project] Z3950 on OSX: module yaz3 not found

2010-12-24 Thread Stéphane Ducasse
may be send this mail in the vm mailing-list

Stef

On Dec 24, 2010, at 3:54 AM, Hernán Morales Durand wrote:

 Laurent, not much progress here :(
 I just reproduced the Unix VM crash. First I've linked the library so
 we do not have to change every module name call
 
 u...@ubuntu:/usr/lib$ ln -T -s /usr/lib/libyaz.so.3.0.0 yaz
 
 and I've tried to execute the library tracer in the shell script
 
 ltrace -f -l /usr/lib/libyaz.so.3.0.0 -o out.txt $BASE/squeakvm \
   -plugins $BASE \
   -encoding latin1 \
   -vm-display-X11 \
   $ROOT/Contents/Resources/pharo.image
 
 but it crash the VM too with an unhandled exception even before the
 GUI is displayed.
 What I've observed is that every FFI call which receives an
 ExternalStructure as parameter kills the VM. This is weird because
 this doesn't happen in the Windows VM. I ran this little script I use
 to debug the library
 
 | conn lib rs rsSize records |
 lib := Z3950FFILibrary default.
 conn := lib
   createConnectionTo: #Alabama asZ3950Server hostName
   port: 7090.
 lib createOptions.
 lib
   setConnection: conn
   optionName: 'preferredRecordSyntax'
   optionValue: 'USMARC'.
 rs := lib
   searchPqf: conn
   query:  '@attr 1=1003 collins'.
 rsSize := lib resultSetSize: rs.
 rsSize  0
   ifFalse:  [ 'no results' ].
 records := Array new: rsSize.
 0 to: rsSize - 1 do: [: pos |
   record := lib resultSetRecord: rs position: pos.
   record isNil not
   ifTrue:  [  
   records
   at: pos + 1
   put: ( lib
   getRecord: record
   function: 'render; charset=marc8, 
 iso8859-1'
   length: nil ). ] ].
 records
 
 and the the doIt just hangs the VM, the console output going through
 the Debugger is the following:
 
 Segmentation fault
 
 -1370902312 ContextPartdoPrimitive:method:receiver:args:
 -1370902404 ContextParttryPrimitiveFor:receiver:args:
 -1370902788 ContextPartsend:to:with:super:
 -1370902896 ContextPartsend:super:numArgs:
 -1370902988 InstructionStreaminterpretExtension:in:for:
 -1370903080 InstructionStreaminterpretNextInstructionFor:
 -1370903172 ContextPartstep
 -1370903280 Processstep
 -1370903372 Processstep:
 -1370920392 Debuggersend
 -1370937720 PluggableButtonMorphperformAction
 -1370937812 PluggableButtonMorphmouseUp:
 -1370937996 SequenceableCollectiondo:
 -1370957140 PluggableButtonMorphmouseUp:
 -1370957232 MorphhandleMouseUp:
 -1370957324 MouseButtonEventsentTo:
 -1370957416 MorphhandleEvent:
 -1370957584 MorphhandleFocusEvent:
 -1370957676 HandMorphsendFocusEvent:to:clear:
 -1370957768 PasteUpMorphbecomeActiveDuring:
 -1370957860 BlockClosureon:do:
 -1370957992 PasteUpMorphbecomeActiveDuring:
 -1370958084 HandMorphsendFocusEvent:to:clear:
 -1370958260 HandMorphsendEvent:focus:clear:
 -1370958352 HandMorphsendMouseEvent:
 -1370958444 HandMorphhandleEvent:
 -1370966728 HandMorphprocessEvents
 -1370966836 WorldStatedoOneCycleNowFor:
 -1370966952 SequenceableCollectiondo:
 -1370967044 WorldStatehandsDo:
 -1370967136 WorldStatedoOneCycleNowFor:
 -1370969680 WorldStatedoOneCycleFor:
 -1370969772 PasteUpMorphdoOneCycle
 -1383611064 spawnNewProcess
 -1383611192 BlockClosurenewProcess
 Aborted
 
 it would be nice if someone could tell something about debugging FFI
 calls, or just any idea to try.
 Cheers,
 
 Hernán
 
 2010/12/23 laurent laffont laurent.laff...@gmail.com:
 Hi,
 I have unmangled all function names. Image also crashes when evaluating the
 Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've tried
 with Cog and the VM in the Seaside OneClick.
 I've uploaded the modified packages on squeaksource
 here: http://www.squeaksource.com/LaurentLSandbox.html   (you can use
 Z3950Slice to load all at once).
 Laurent
 
 
 
 On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand
 hernan.mora...@gmail.com wrote:
 
 Hi Laurent,
 
 Thanks for the feedback, I've uploaded the repository with the missing
 method but I cannot reproduce the crash in Windows. Have you unmangled
 every function name tested? Are you running just the
 Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
 performed against a Z39.50 server running in local host, otherwise
 will fail (however that shouldn't crash the VM), so you may want to
 run only the Z3950FFILibraryTest suite. If you or anyone want a local
 Zebra server for Win32 - although most configuration files should work
 with other platforms - for testing purposes please let me know.
 
 Does the Kant test crash the VM too?
 
 Z3950Client new
  server: #Acadia;
  query: ( Z3950Query new author: 'Kant' ).
 
 (see http://67.222.12.200:8889/WebOpus/52 for sample successful results)
 
 I will set up a Linux box tomorrow and try to reproduce there.
 Cheers,
 
 2010/12/22 laurent laffont laurent.laff...@gmail.com:
 Hi Hernan,
 finally I 

Re: [Pharo-project] Z3950 on OSX: module yaz3 not found

2010-12-23 Thread Hernán Morales Durand
Laurent, not much progress here :(
I just reproduced the Unix VM crash. First I've linked the library so
we do not have to change every module name call

u...@ubuntu:/usr/lib$ ln -T -s /usr/lib/libyaz.so.3.0.0 yaz

and I've tried to execute the library tracer in the shell script

ltrace -f -l /usr/lib/libyaz.so.3.0.0 -o out.txt $BASE/squeakvm \
-plugins $BASE \
-encoding latin1 \
-vm-display-X11 \
$ROOT/Contents/Resources/pharo.image

but it crash the VM too with an unhandled exception even before the
GUI is displayed.
What I've observed is that every FFI call which receives an
ExternalStructure as parameter kills the VM. This is weird because
this doesn't happen in the Windows VM. I ran this little script I use
to debug the library

| conn lib rs rsSize records |
lib := Z3950FFILibrary default.
conn := lib
createConnectionTo: #Alabama asZ3950Server hostName
port: 7090.
lib createOptions.
lib
setConnection: conn
optionName: 'preferredRecordSyntax'
optionValue: 'USMARC'.
rs := lib
searchPqf: conn
query:  '@attr 1=1003 collins'.
rsSize := lib resultSetSize: rs.
rsSize  0
ifFalse:  [ 'no results' ].
records := Array new: rsSize.
0 to: rsSize - 1 do: [: pos |
record := lib resultSetRecord: rs position: pos.
record isNil not
ifTrue:  [  
records
at: pos + 1
put: ( lib
getRecord: record
function: 'render; charset=marc8, 
iso8859-1'
length: nil ). ] ].
records

and the the doIt just hangs the VM, the console output going through
the Debugger is the following:

Segmentation fault

-1370902312 ContextPartdoPrimitive:method:receiver:args:
-1370902404 ContextParttryPrimitiveFor:receiver:args:
-1370902788 ContextPartsend:to:with:super:
-1370902896 ContextPartsend:super:numArgs:
-1370902988 InstructionStreaminterpretExtension:in:for:
-1370903080 InstructionStreaminterpretNextInstructionFor:
-1370903172 ContextPartstep
-1370903280 Processstep
-1370903372 Processstep:
-1370920392 Debuggersend
-1370937720 PluggableButtonMorphperformAction
-1370937812 PluggableButtonMorphmouseUp:
-1370937996 SequenceableCollectiondo:
-1370957140 PluggableButtonMorphmouseUp:
-1370957232 MorphhandleMouseUp:
-1370957324 MouseButtonEventsentTo:
-1370957416 MorphhandleEvent:
-1370957584 MorphhandleFocusEvent:
-1370957676 HandMorphsendFocusEvent:to:clear:
-1370957768 PasteUpMorphbecomeActiveDuring:
-1370957860 BlockClosureon:do:
-1370957992 PasteUpMorphbecomeActiveDuring:
-1370958084 HandMorphsendFocusEvent:to:clear:
-1370958260 HandMorphsendEvent:focus:clear:
-1370958352 HandMorphsendMouseEvent:
-1370958444 HandMorphhandleEvent:
-1370966728 HandMorphprocessEvents
-1370966836 WorldStatedoOneCycleNowFor:
-1370966952 SequenceableCollectiondo:
-1370967044 WorldStatehandsDo:
-1370967136 WorldStatedoOneCycleNowFor:
-1370969680 WorldStatedoOneCycleFor:
-1370969772 PasteUpMorphdoOneCycle
-1383611064 spawnNewProcess
-1383611192 BlockClosurenewProcess
Aborted

it would be nice if someone could tell something about debugging FFI
calls, or just any idea to try.
Cheers,

Hernán

2010/12/23 laurent laffont laurent.laff...@gmail.com:
 Hi,
 I have unmangled all function names. Image also crashes when evaluating the
 Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've tried
 with Cog and the VM in the Seaside OneClick.
 I've uploaded the modified packages on squeaksource
 here: http://www.squeaksource.com/LaurentLSandbox.html   (you can use
 Z3950Slice to load all at once).
 Laurent



 On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand
 hernan.mora...@gmail.com wrote:

 Hi Laurent,

 Thanks for the feedback, I've uploaded the repository with the missing
 method but I cannot reproduce the crash in Windows. Have you unmangled
 every function name tested? Are you running just the
 Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
 performed against a Z39.50 server running in local host, otherwise
 will fail (however that shouldn't crash the VM), so you may want to
 run only the Z3950FFILibraryTest suite. If you or anyone want a local
 Zebra server for Win32 - although most configuration files should work
 with other platforms - for testing purposes please let me know.

 Does the Kant test crash the VM too?

 Z3950Client new
  server: #Acadia;
  query: ( Z3950Query new author: 'Kant' ).

 (see http://67.222.12.200:8889/WebOpus/52 for sample successful results)

 I will set up a Linux box tomorrow and try to reproduce there.
 Cheers,

 2010/12/22 laurent laffont laurent.laff...@gmail.com:
  Hi Hernan,
  finally I switch back to Linux to make it work, OSX gives me headaches.
  So on linux the yaz module is found. I get the Unable to find function
  address but I found that writing:
  cdecl: 

Re: [Pharo-project] Z3950 on OSX: module yaz3 not found

2010-12-22 Thread Hernán Morales Durand
Hi Laurent,

Thanks for the feedback, I've uploaded the repository with the missing
method but I cannot reproduce the crash in Windows. Have you unmangled
every function name tested? Are you running just the
Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
performed against a Z39.50 server running in local host, otherwise
will fail (however that shouldn't crash the VM), so you may want to
run only the Z3950FFILibraryTest suite. If you or anyone want a local
Zebra server for Win32 - although most configuration files should work
with other platforms - for testing purposes please let me know.

Does the Kant test crash the VM too?

Z3950Client new
  server: #Acadia;
  query: ( Z3950Query new author: 'Kant' ).

(see http://67.222.12.200:8889/WebOpus/52 for sample successful results)

I will set up a Linux box tomorrow and try to reproduce there.
Cheers,

2010/12/22 laurent laffont laurent.laff...@gmail.com:
 Hi Hernan,
 finally I switch back to Linux to make it work, OSX gives me headaches.
 So on linux the yaz module is found. I get the Unable to find function
 address but I found that writing:
 cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'
 instead of
 cdecl: ZOOMOptions '_zoom_options_cre...@0' (void) module: 'yaz3'
 works. If I understand, function names are not mangled when compiling with
 gcc on Linux.

 Trying to run tests I've also had a could not coerce arguments in
 Z3950FFILibrarycreateConnectionTo:port because Z3950TestCaseportNumber
 answers a String and
 cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module: 'yaz'
 so it's waiting for a short. I've replaced portNumber to answer a
 SmallInteger.
 And now the image crashes on connectionIsIdle call:
 write(1, \ncreateConnectionTo:port:, 25) = 25
 write(1, \nconnectionIsIdle:, 18)     = 18
 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
 write(1, \n, 1)                       = 1
 tgkill(25830, 25830, SIGABRT)           = 0
 --- SIGABRT (Aborted) @ 0 (0) ---

 Any idea ?

 Laurent Laffont

 On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont laurent.laff...@gmail.com
 wrote:

 The module is found ! How:
 - Using VM Squeak 5.8b12 2  (instead of Cog or the VM provided in Seaside
 One-Click image)
 - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
 /usr/local/lib/libyaz.3.dylib .
 Now I have the Unable to find function address you have talked earlier
 :) I will look at the mangled function names.

 Laurent  --- on the road to the FFI mountain.

 On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
 hernan.mora...@gmail.com wrote:

 Laurent,
 I forward this e-mail to the squeak mailing list, may be someone there
 have a better idea how the OSX VM works. BTW there are more
 commentaries here

 http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopard-td85608.html
 Cheers,

 Hernán

 2010/12/20 laurent laffont laurent.laff...@gmail.com:
  Hi Hernan,
  the strace equivalent on OSX seems to be dtruss (yes I'm learning OSX
  too :)
  sudo dtruss -p [pid of process]
  in the trace I have this:
 
  stat(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0,
  0xBFF59440, 0xBFF5AB28) = -1 Err#2
 
  stat64(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0,
  0xBFF5892C, 0xBFF5AB28) = -1 Err#2
 
  stat(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
  0xBFF59440, 0xBFF5AB28) = 0 0
 
  stat64(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
  0xBFF5892C, 0xBFF5AB28) = 0 0
 
  open(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
  0x0, 0x0) = 12 0
  pread(0xC, \317\372\355\376\a\0, 0x1000, 0x0) = 4096 0
  close(0xC) = 0 0
 
  stat(/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0,
  0xBFF59440, 0x1000) = -1 Err#2
 
  stat64(/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0,
  0xBFF5892C, 0x1000) = -1 Err#2
  stat(/Users/laurentlaffont/Downloads/Plugins/yaz3\0, 0xBFF59440,
  0x1000) =
  -1 Err#2
  stat64(/Users/laurentlaffont/Downloads/Plugins/yaz3\0, 0xBFF5892C,
  0x1000)
  = -1 Err#2
 
  so it looks like the VM is trying to find yaz3 at non standard Unix
  places
  (I don't know if it's SqueakVM or OSX related).
  I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put yaz
  lib
  there, ln -s libyaz.3.dylib yaz3 but no success.
 
  I've read good
  post http://forum.world.st/FFI-Documentation-td2225150.html :
 
  Module Location - where the external library file lives
        - depends on the platform
                - Mac
                        - pre Snow Leopard
                                - checks VM path and common library paths
                        - Snow Leopard
                                - only looks in VM bundle's Resources
  file, you must either [5]:
                                        - store all external libraries
  there
                            

Re: [Pharo-project] Z3950 on OSX: module yaz3 not found

2010-12-22 Thread Stéphane Ducasse
thanks hernan.
We want to script the BNF (bibliotheque Nationale de France :)). which has a 
Z3950 server

Stef

On Dec 23, 2010, at 1:57 AM, Hernán Morales Durand wrote:

 Hi Laurent,
 
 Thanks for the feedback, I've uploaded the repository with the missing
 method but I cannot reproduce the crash in Windows. Have you unmangled
 every function name tested? Are you running just the
 Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
 performed against a Z39.50 server running in local host, otherwise
 will fail (however that shouldn't crash the VM), so you may want to
 run only the Z3950FFILibraryTest suite. If you or anyone want a local
 Zebra server for Win32 - although most configuration files should work
 with other platforms - for testing purposes please let me know.
 
 Does the Kant test crash the VM too?
 
 Z3950Client new
  server: #Acadia;
  query: ( Z3950Query new author: 'Kant' ).
 
 (see http://67.222.12.200:8889/WebOpus/52 for sample successful results)
 
 I will set up a Linux box tomorrow and try to reproduce there.
 Cheers,
 
 2010/12/22 laurent laffont laurent.laff...@gmail.com:
 Hi Hernan,
 finally I switch back to Linux to make it work, OSX gives me headaches.
 So on linux the yaz module is found. I get the Unable to find function
 address but I found that writing:
 cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'
 instead of
 cdecl: ZOOMOptions '_zoom_options_cre...@0' (void) module: 'yaz3'
 works. If I understand, function names are not mangled when compiling with
 gcc on Linux.
 
 Trying to run tests I've also had a could not coerce arguments in
 Z3950FFILibrarycreateConnectionTo:port because Z3950TestCaseportNumber
 answers a String and
 cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module: 'yaz'
 so it's waiting for a short. I've replaced portNumber to answer a
 SmallInteger.
 And now the image crashes on connectionIsIdle call:
 write(1, \ncreateConnectionTo:port:, 25) = 25
 write(1, \nconnectionIsIdle:, 18) = 18
 rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
 write(1, \n, 1)   = 1
 tgkill(25830, 25830, SIGABRT)   = 0
 --- SIGABRT (Aborted) @ 0 (0) ---
 
 Any idea ?
 
 Laurent Laffont
 
 On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont laurent.laff...@gmail.com
 wrote:
 
 The module is found ! How:
 - Using VM Squeak 5.8b12 2  (instead of Cog or the VM provided in Seaside
 One-Click image)
 - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
 /usr/local/lib/libyaz.3.dylib .
 Now I have the Unable to find function address you have talked earlier
 :) I will look at the mangled function names.
 
 Laurent  --- on the road to the FFI mountain.
 
 On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
 hernan.mora...@gmail.com wrote:
 
 Laurent,
 I forward this e-mail to the squeak mailing list, may be someone there
 have a better idea how the OSX VM works. BTW there are more
 commentaries here
 
 http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopard-td85608.html
 Cheers,
 
 Hernán
 
 2010/12/20 laurent laffont laurent.laff...@gmail.com:
 Hi Hernan,
 the strace equivalent on OSX seems to be dtruss (yes I'm learning OSX
 too :)
 sudo dtruss -p [pid of process]
 in the trace I have this:
 
 stat(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0,
 0xBFF59440, 0xBFF5AB28) = -1 Err#2
 
 stat64(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0,
 0xBFF5892C, 0xBFF5AB28) = -1 Err#2
 
 stat(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
 0xBFF59440, 0xBFF5AB28) = 0 0
 
 stat64(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
 0xBFF5892C, 0xBFF5AB28) = 0 0
 
 open(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
 0x0, 0x0) = 12 0
 pread(0xC, \317\372\355\376\a\0, 0x1000, 0x0) = 4096 0
 close(0xC) = 0 0
 
 stat(/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0,
 0xBFF59440, 0x1000) = -1 Err#2
 
 stat64(/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0,
 0xBFF5892C, 0x1000) = -1 Err#2
 stat(/Users/laurentlaffont/Downloads/Plugins/yaz3\0, 0xBFF59440,
 0x1000) =
 -1 Err#2
 stat64(/Users/laurentlaffont/Downloads/Plugins/yaz3\0, 0xBFF5892C,
 0x1000)
 = -1 Err#2
 
 so it looks like the VM is trying to find yaz3 at non standard Unix
 places
 (I don't know if it's SqueakVM or OSX related).
 I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put yaz
 lib
 there, ln -s libyaz.3.dylib yaz3 but no success.
 
 I've read good
 post http://forum.world.st/FFI-Documentation-td2225150.html :
 
 Module Location - where the external library file lives
   - depends on the platform
   - Mac
   - pre Snow Leopard
   - checks VM path and common library paths
   - Snow Leopard
   - only 

Re: [Pharo-project] Z3950 on OSX: module yaz3 not found

2010-12-22 Thread laurent laffont
Hi,

I have unmangled all function names. Image also crashes when evaluating the
Kant test. (but this time I get ILLEGAL INSTRUCTION on strace). I've tried
with Cog and the VM in the Seaside OneClick.

I've uploaded the modified packages on squeaksource here:
http://www.squeaksource.com/LaurentLSandbox.html   (you can use Z3950Slice
to load all at once).

Laurent



On Thu, Dec 23, 2010 at 1:57 AM, Hernán Morales Durand 
hernan.mora...@gmail.com wrote:

 Hi Laurent,

 Thanks for the feedback, I've uploaded the repository with the missing
 method but I cannot reproduce the crash in Windows. Have you unmangled
 every function name tested? Are you running just the
 Z3950FFILibraryTest? Notice the Z3950FFIServerLibraryTest tests are
 performed against a Z39.50 server running in local host, otherwise
 will fail (however that shouldn't crash the VM), so you may want to
 run only the Z3950FFILibraryTest suite. If you or anyone want a local
 Zebra server for Win32 - although most configuration files should work
 with other platforms - for testing purposes please let me know.

 Does the Kant test crash the VM too?

 Z3950Client new
  server: #Acadia;
  query: ( Z3950Query new author: 'Kant' ).

 (see http://67.222.12.200:8889/WebOpus/52 for sample successful results)

 I will set up a Linux box tomorrow and try to reproduce there.
 Cheers,

 2010/12/22 laurent laffont laurent.laff...@gmail.com:
  Hi Hernan,
  finally I switch back to Linux to make it work, OSX gives me headaches.
  So on linux the yaz module is found. I get the Unable to find function
  address but I found that writing:
  cdecl: ZOOMOptions 'ZOOM_options_create' (void) module: 'yaz'
  instead of
  cdecl: ZOOMOptions '_zoom_options_cre...@0' (void) module: 'yaz3'
  works. If I understand, function names are not mangled when compiling
 with
  gcc on Linux.
 
  Trying to run tests I've also had a could not coerce arguments in
  Z3950FFILibrarycreateConnectionTo:port because
 Z3950TestCaseportNumber
  answers a String and
  cdecl: ZOOMConnection 'ZOOM_connection_new' (char* short) module: 'yaz'
  so it's waiting for a short. I've replaced portNumber to answer a
  SmallInteger.
  And now the image crashes on connectionIsIdle call:
  write(1, \ncreateConnectionTo:port:, 25) = 25
  write(1, \nconnectionIsIdle:, 18) = 18
  rt_sigprocmask(SIG_UNBLOCK, [ABRT], NULL, 8) = 0
  write(1, \n, 1)   = 1
  tgkill(25830, 25830, SIGABRT)   = 0
  --- SIGABRT (Aborted) @ 0 (0) ---
 
  Any idea ?
 
  Laurent Laffont
 
  On Tue, Dec 21, 2010 at 7:58 AM, laurent laffont 
 laurent.laff...@gmail.com
  wrote:
 
  The module is found ! How:
  - Using VM Squeak 5.8b12 2  (instead of Cog or the VM provided in
 Seaside
  One-Click image)
  - go in Squeak\ 5.8b12\ 2.app/Contents/Resources/, then ln -s
  /usr/local/lib/libyaz.3.dylib .
  Now I have the Unable to find function address you have talked earlier
  :) I will look at the mangled function names.
 
  Laurent  --- on the road to the FFI mountain.
 
  On Tue, Dec 21, 2010 at 6:59 AM, Hernán Morales Durand
  hernan.mora...@gmail.com wrote:
 
  Laurent,
  I forward this e-mail to the squeak mailing list, may be someone there
  have a better idea how the OSX VM works. BTW there are more
  commentaries here
 
 
 http://forum.world.st/squeak-dev-Alien-amp-Squeak-FFI-issues-on-Snow-Leopard-td85608.html
  Cheers,
 
  Hernán
 
  2010/12/20 laurent laffont laurent.laff...@gmail.com:
   Hi Hernan,
   the strace equivalent on OSX seems to be dtruss (yes I'm learning OSX
   too :)
   sudo dtruss -p [pid of process]
   in the trace I have this:
  
  
 stat(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0,
   0xBFF59440, 0xBFF5AB28) = -1 Err#2
  
  
 stat64(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3.bundle/Contents/MacOS/yaz3\0,
   0xBFF5892C, 0xBFF5AB28) = -1 Err#2
  
  
 stat(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
   0xBFF59440, 0xBFF5AB28) = 0 0
  
  
 stat64(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
   0xBFF5892C, 0xBFF5AB28) = 0 0
  
  
 open(/Users/laurentlaffont/Downloads/Seaside.app/Contents/Resources/yaz3\0,
   0x0, 0x0) = 12 0
   pread(0xC, \317\372\355\376\a\0, 0x1000, 0x0) = 4096 0
   close(0xC) = 0 0
  
  
 stat(/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0,
   0xBFF59440, 0x1000) = -1 Err#2
  
  
 stat64(/Users/laurentlaffont/Downloads/Plugins/yaz3.bundle/Contents/MacOS/yaz3\0,
   0xBFF5892C, 0x1000) = -1 Err#2
   stat(/Users/laurentlaffont/Downloads/Plugins/yaz3\0, 0xBFF59440,
   0x1000) =
   -1 Err#2
   stat64(/Users/laurentlaffont/Downloads/Plugins/yaz3\0, 0xBFF5892C,
   0x1000)
   = -1 Err#2
  
   so it looks like the VM is trying to find yaz3 at non standard Unix
   places
   (I don't know if it's SqueakVM or OSX related).
   I've created Contents/Resources/yaz3.bundle/Contents/MacOS/, put yaz
   lib
   there, ln -s