Le 08/01/2016 19:04, Mariano Martinez Peck a écrit : > 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'; > load. > > 3) This is the code I am executing and it's crashing: > > | posixSpawnFileActionsT | posixSpawnFileActionsT := ExternalAddress > allocate: 4. OSSUnixSubprocess new primitivePosixSpawnFileActionsInit: > posixSpawnFileActionsT. posixSpawnFileActionsT free. > 4) The primitive is as simple as: > > primitivePosixSpawnFileActionsInit: aPosixSpawnFileActionsT > ^ self ffiCall: #( int posix_spawn_file_actions_init(void* > aPosixSpawnFileActionsT) ) module: LibC > > I have no idea what I am doing wrong. And again, this works on OSX. The > function I am calling is: int > posix_spawn_file_actions_init(posix_spawn_file_actions_t *file_actions); > as you can read in [1] > > Below is the stacktrace I get the Linux terminal. > > Any hint is greatly appreciated. > > Thanks, > > > [1] > http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_spawn_file_actions_destroy.html > > > * > * > **** Error in `/home/centos/pharo-vm/pharo': malloc(): memory corruption > (fast): 0x09544268 **** > ======= Backtrace: ========= > /lib/libc.so.6(+0x7428c)[0xf758e28c] > /lib/libc.so.6(+0x76d98)[0xf7590d98] > /lib/libc.so.6(__libc_calloc+0xa7)[0xf7592df7] > /home/centos/pharo-vm/pharo[0x80b8f44] > /home/centos/pharo-vm/pharo[0x80b909c] > /home/centos/pharo-vm/pharo(ioLoadExternalFunctionOfLengthFromModuleOfLengthAccessorDepthInto+0xc2)[0x80b9402] > /home/centos/pharo-vm/pharo[0x808de6f] > /home/centos/pharo-vm/pharo[0x80a0810] > /home/centos/pharo-vm/pharo(ceSendsupertonumArgs+0x1da)[0x80a1f4a] > [0x960004c] > [0x9600b00] > [0xaec2e9b] > [0xaec3481] > [0x9604ff0] > [0x964ed43] > [0x9604f5c] > [0x960424c] > [0x9602e47] > [0x9602be7] > [0x960320c] > [0x9602277] > [0x960bec2] > [0x9600b00] > [0x9600ad8] > ======= Memory map: ======== > 08048000-08151000 r-xp 00000000 fd:01 202178584 > /home/centos/pharo-vm/pharo > 08151000-08152000 r--p 00108000 fd:01 202178584 > /home/centos/pharo-vm/pharo > 08152000-0815c000 rw-p 00109000 fd:01 202178584 > /home/centos/pharo-vm/pharo > 0815c000-08193000 rw-p 00000000 00:00 0 > 09505000-095a5000 rw-p 00000000 00:00 0 > [heap] > 09600000-09701000 rwxp 00000000 00:00 0 > 09701000-0dbc0000 rw-p 00000000 00:00 0 > f6de5000-f6dfe000 r-xp 00000000 fd:01 203854803 > /usr/lib/libgcc_s-4.8.5-20150702.so.1 > f6dfe000-f6dff000 r--p 00018000 fd:01 203854803 > /usr/lib/libgcc_s-4.8.5-20150702.so.1 > f6dff000-f6e00000 rw-p 00019000 fd:01 203854803 > /usr/lib/libgcc_s-4.8.5-20150702.so.1 > f6e00000-f6e21000 rw-p 00000000 00:00 0 > f6e21000-f6f00000 ---p 00000000 00:00 0 > f6f25000-f6f26000 rw-p 00000000 00:00 0 > f6f26000-f6f2e000 r-xp 00000000 fd:01 202178580 > /home/centos/pharo-vm/libSqueakFFIPrims.so > f6f2e000-f6f2f000 r--p 00007000 fd:01 202178580 > /home/centos/pharo-vm/libSqueakFFIPrims.so > f6f2f000-f6f30000 rw-p 00008000 fd:01 202178580 > /home/centos/pharo-vm/libSqueakFFIPrims.so > f6f30000-f6f32000 r-xp 00000000 fd:01 203140415 > /usr/lib/libXau.so.6.0.0 > f6f32000-f6f33000 r--p 00001000 fd:01 203140415 > /usr/lib/libXau.so.6.0.0 > f6f33000-f6f34000 rw-p 00002000 fd:01 203140415 > /usr/lib/libXau.so.6.0.0 > f6f34000-f6f5b000 r-xp 00000000 fd:01 201498737 > /usr/lib/liblzma.so.5.0.99 > f6f5b000-f6f5d000 r--p 00026000 fd:01 201498737 > /usr/lib/liblzma.so.5.0.99 > f6f5d000-f6f5e000 rw-p 00028000 fd:01 201498737 > /usr/lib/liblzma.so.5.0.99 > f6f5e000-f6fc0000 r-xp 00000000 fd:01 201348055 > /usr/lib/libpcre.so.1.2.0 > f6fc0000-f6fc2000 r--p 00061000 fd:01 201348055 > /usr/lib/libpcre.so.1.2.0 > f6fc2000-f6fc3000 rw-p 00063000 fd:01 201348055 > /usr/lib/libpcre.so.1.2.0 > f6fc3000-f6fcf000 r-xp 00000000 fd:01 202740809 > /usr/lib/libdrm.so.2.4.0 > f6fcf000-f6fd0000 r--p 0000b000 fd:01 202740809 > /usr/lib/libdrm.so.2.4.0 > f6fd0000-f6fd1000 rw-p 0000c000 fd:01 202740809 > /usr/lib/libdrm.so.2.4.0 > f6fd1000-f6fd5000 r-xp 00000000 fd:01 202740799 > /usr/lib/libXxf86vm.so.1.0.0 > f6fd5000-f6fd6000 r--p 00004000 fd:01 202740799 > /usr/lib/libXxf86vm.so.1.0.0 > f6fd6000-f6fd7000 rw-p 00005000 fd:01 202740799 > /usr/lib/libXxf86vm.so.1.0.0 > f6fd7000-f6fd8000 r-xp 00000000 fd:01 201522922 > /usr/lib/libxshmfence.so.1.0.0 > f6fd8000-f6fd9000 r--p 00000000 fd:01 201522922 > /usr/lib/libxshmfence.so.1.0.0 > f6fd9000-f6fda000 rw-p 00001000 fd:01 201522922 > /usr/lib/libxshmfence.so.1.0.0 > f6fda000-f6ffd000 r-xp 00000000 fd:01 202740769 > /usr/lib/libxcb.so.1.1.0 > f6ffd000-f6ffe000 r--p 00022000 fd:01 202740769 > /usr/lib/libxcb.so.1.1.0 > f6ffe000-f6fff000 rw-p 00023000 fd:01 202740769 > /usr/lib/libxcb.so.1.1.0 > f6fff000-f7004000 r-xp 00000000 fd:01 201522899 > /usr/lib/libxcb-sync.so.1.0.0 > f7004000-f7005000 r--p 00005000 fd:01 201522899 > /usr/lib/libxcb-sync.so.1.0.0 > f7005000-f7006000 rw-p 00006000 fd:01 201522899 > /usr/lib/libxcb-sync.so.1.0.0 > f7006000-f7009000 r-xp 00000000 fd:01 201522895 > /usr/lib/libxcb-shape.so.0.0.0 > f7009000-f700a000 r--p 00002000 fd:01 201522895 > /usr/lib/libxcb-shape.so.0.0.0 > f700a000-f700b000 rw-p 00003000 fd:01 201522895 > /usr/lib/libxcb-shape.so.0.0.0 > f700b000-f7014000 r-xp 00000000 fd:01 201522889 > /usr/lib/libxcb-render.so.0.0.0 > f7014000-f7015000 r--p 00008000 fd:01 201522889 > /usr/lib/libxcb-render.so.0.0.0 > f7015000-f7016000 rw-p 00009000 fd:01 201522889 > /usr/lib/libxcb-render.so.0.0.0 > f7016000-f701d000 r-xp 00000000 fd:01 201522905 > /usr/lib/libxcb-xfixes.so.0.0.0 > f701d000-f701e000 r--p 00006000 fd:01 201522905 > /usr/lib/libxcb-xfixes.so.0.0.0 > f701e000-f701f000 rw-p 00007000 fd:01 201522905 > /usr/lib/libxcb-xfixes.so.0.0.0 > f701f000-f702c000 r-xp 00000000 fd:01 201522885 > /usr/lib/libxcb-randr.so.0.1.0 > f702c000-f702d000 r--p 0000d000 fd:01 201522885 > /usr/lib/libxcb-randr.so.0.1.0 > f702d000-f702e000 rw-p 0000e000 fd:01 201522885 > /usr/lib/libxcb-randr.so.0.1.0 > f702e000-f7030000 r-xp 00000000 fd:01 201522883 > /usr/lib/libxcb-present.so.0.0.0 > f7030000-f7031000 r--p 00001000 fd:01 201522883 > /usr/lib/libxcb-present.so.0.0.0 > f7031000-f7032000 rw-p 00002000 fd:01 201522883 > /usr/lib/libxcb-present.so.0.0.0 > f7032000-f7034000 r-xp 00000000 fd:01 203140423 > /usr/lib/libxcb-dri3.so.0.0.0 > f7034000-f7035000 r--p 00001000 fd:01 203140423 > /usr/lib/libxcb-dri3.so.0.0.0 > f7035000-f7036000 rw-p 00002000 fd:01 203140423 > /usr/lib/libxcb-dri3.so.0.0.0 > f7036000-f703a000 r-xp 00000000 fd:01 203140421 > /usr/lib/libxcb-dri2.so.0.0.0./pharo-ui: line 11: 4019 Aborted > (core dumped) "$DIR"/"pharo-vm/pharo" "$@" > > > > -- > Mariano > http://marianopeck.wordpress.com
On Gentoo the image freeze and I see that in the terminal: *** Error in `/home/jecisc/.local/share/Pharo/spurVM/pharo': free(): invalid next size (fast): 0x08c87ed8 *** -- Cyril Ferlicot http://www.synectique.eu 165 Avenue Bretagne Lille 59000 France
signature.asc
Description: OpenPGP digital signature