ExternalStructures and Unix (a sad incompatibility story)
David T. Lewis
lewis at mail.msen.com
Fri Jan 6 19:31:52 UTC 2012
On Fri, Jan 06, 2012 at 03:55:21PM -0300, Esteban Lorenzano wrote:
> I'm finishing an app for a customer who has to be installed on monday. Last wednesday, customer said that the system, who was thought to run on Windows and developed on Mac, has to run also on Linux.
> "No problem", I said to him... and started testing the application (a small app made with Pharo+Glamour+Magritte+HPDF+Mongo) and everything looks just fine... until I found this problem: HPDF package, who relies on FFI and works perfect on Windows and Macs, was not working on linux.
> "A library problem", I thought, then I downloaded libhpdf sources, compiled and started tracing it to see what was the problem.
> After a while (a loooooong while), I came up with this conclusi?n:
> HPDF_New function creates a document who answers HPDF_Doc, who is a pointer to a structure... so void* should be a correct reference in smalltalk side... isn't?
> well... my HPDFReference class, who is an ExternalStructure who maps to a void*, just does not works (in Linux)... it is getting a mysterious number as a reference. Maybe a number encoding diference? littleendian/bigendian? I don't know (and no time to invest right now here: on monday I'm going to production with this app).
> What I do know is: after changing all HPDFReference references with "long" (void* are longs also)... everything started to work...
> So... yes... this is a long story to report a bug on ExternalStructure conformations in Unix :)
You are calling a 32-bit Linux library (not a 64-bit library), right?
More information about the Vm-dev