[gambit-list] Problem with FFI & Memory Corruption

Marc Feeley feeley at iro.umontreal.ca
Mon Feb 13 07:44:26 EST 2012


Can you try the change I suggest to see if the problem goes away?

Marc

On 2012-02-13, at 5:59 AM, Álvaro Castro-Castilla wrote:

> Marc, if you mean my error, it was on Linux 3.1 (Gentoo), and happens also on latest Ubuntu on VirtualBox.
> 
> 
> 
> 2012/2/13 Marc Feeley <feeley at iro.umontreal.ca>
> 
> On 2012-02-12, at 8:43 AM, Álvaro Castro-Castilla wrote:
> 
> > Hi Taylor,
> >
> > Do you plan on making full bindings for libxml2? I'd be interested in packaging it as a Blackhole module when you are ready.
> > Also, when following your steps I got this error:
> > > (load "xml")
> > *** WARNING -- Could not find C function: "____20_xml_2e_o1"
> > *** ERROR IN (console)@1.1 -- /home/alvatar/gambit-xml/xml.o1: undefined symbol: ___release_scmobj
> >
> > Using gambit 4.6.3
> >
> > Best regards,
> >
> > Álvaro
> 
> I'm not sure this is the cause of the bug, but I have noticed that Taylor's code is not completely portable.  It contains references to Gambit runtime functions that are not wrapped in a call to ___EXT. In other words, the calls
> 
> vect = ___make_vector(4, ___FAL, ___STILL);
> ___release_scmobj(x);
> tmp = ___make_pair(x, lst, ___STILL);
> 
> should be written
> 
> vect = ___EXT(___make_vector)(4, ___FAL, ___STILL);
> ___EXT(___release_scmobj)(x);
> tmp = ___EXT(___make_pair)(x, lst, ___STILL);
> 
> This is needed on some operating systems to link with the Gambit runtime system functions.  On the operating systems that don't need anything special, the call ___EXT(f) is replaced with f, so there is no overhead.
> 
> By the way, on which OS did this problem occur?
> 
> Marc
> 
> 




More information about the Gambit-list mailing list