So win32 FFI test crash the VM if compiled with gcc.But tests pass if compiled with clang (i686-w64-mingw32-clang on cygwin64)
Indeed it seems that the function calls that are used for marshalling FFI arguments will use SP,SP+4,SP+8 and SP+12 for their own arguments, without incrementing SP firstUnfortunately as we could have guessed it was fragile...It's wrong because we want to pile up FFI args starting at stack pointer, just above the future return address.Indeed, alloca reserve 16 more bytes than necessary. That is, it answers a value, but increment---------------- details following -----------------The problem with gcc is the famous ALLOCA_LIES_SO_USE_GETSP
stack pointer = return alloca'd + 16
So there is a hack in code generation that used to workaround the problem: use SP instead of alloca'd value for marshalling FFI args.
Recent versions of gcc do use the 16 extra bytes !!!
Thus when we try and fill the FFI argument stack, we break the own stack of these functions... Since most of these arguments are pointers (oops and calloutState), then we very soon SEGV.2016-08-19 19:05 GMT+02:00 Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com >:2016-08-19 18:29 GMT+02:00 Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com >:The latest vmI found in bintray already has the problem.And you'll get a segmentation fault, crash.dmp.Then try this snippet:For example, load latest versions of FFI from http://source.squeak.org/FFIHi,Win32 FFI fails for some time now.
FFIPluginTests new testGenericDoubleCall.Hem, the oldest VM, not the latest
If someone has a way to easily dissect without precompiled artifacts, let me know.(Before declaring any VM+plugins as stable...)https://dl.bintray.com/opensmaI did not have time to check other OSes, but it would be worth trying.lltalk/vm/:cog_win32x86_squeak .cog.spur_201606301459.zip
This bug delayed the Win64 squeak.stack.spur delivery, because I thought I introduced a regression somewhere...err, bissect not dissect
Nicolas