> On 08 Jan 2016, at 19:35, Mariano Martinez Peck <[email protected]> wrote: > > > > On Fri, Jan 8, 2016 at 3:04 PM, Mariano Martinez Peck <[email protected] > <mailto:[email protected]>> wrote: > Hi guys, > > I wonder if someone could give me a hand to find out why a FFI calling I am > doing is crashing. In OSX it works correct but I am testing in CentOS and it > fails. I wonder if it also crashes in other Linuxes too. > > I am using latest Pharo 5.0 with Spur. To reproduce: > > 1) Get latest Pharo 5.0 and Spur via: > wget -O- get.pharo.org/alpha+vm <http://get.pharo.org/alpha+vm> | bash > > 2) Inside Pharo, load my prototype tool: > > Gofer it > package: 'OSSubprocess'; > url: 'http://smalltalkhub.com/mc/marianopeck/OSSubprocess/main > <http://smalltalkhub.com/mc/marianopeck/OSSubprocess/main>'; > load. > > 3) This is the code I am executing and it's crashing: > > | posixSpawnFileActionsT | > posixSpawnFileActionsT := ExternalAddress allocate: 4. > > > If I change above line with this: > > posixSpawnFileActionsT := ByteArray new: 4.
Wil this not allocate more the four bytes because of the object header? So how about allocating 8 bytes for the pointer (just for fun)? ExternalAddress allocate: 8 > > Then the function does not crash but it crashes in the future > posix_spawn_file_actions_destroy(). > > > > -- > Mariano > http://marianopeck.wordpress.com <http://marianopeck.wordpress.com/>
