Hi all, I defined new FFI-Tests with struct inside struct. I wanted to check for correct alignment (this works as it should thanks to Ronie!). But when I reload the package into a new image, there is an initialization order problem. It seems that the struct FFITestSfd is created AFTER the struct FFITestSsSfd. But struct FFITestSsSfd depends on struct FFITestSfd (it is just struct {short s1; struct FFITestSfd sfd2;} Consequently, FFITestSsSfd DOES not get correctly initialized... It simply ignore the missing FFITestSfd definition, and believes that it has a single field (short s1) and that it is of size 2... When we execute the FFIPluginTests testSuite, this can badly crash the image because the FFI is allocating a ByteArray handle of size 2 for returning the FFITestSsSfd by value, and the test function writes a struct of size 12 into it... We can't live long with such hanging sword above our heads and should urgently fix it. At least, you are warned, don't execute new FFI tests blindly. |
Hi Nicolas, I can't reproduce this because FFITestSfd & FFITestSsSfd et al are not yet in FFI_Tests. Can you co bit them to FFI_Tests? You can put it in FFIinbox if you don't feel comfortable putting it straight in FFI. On Sun, Jan 26, 2020 at 1:38 PM Nicolas Cellier <[hidden email]> wrote:
_,,,^..^,,,_ best, Eliot |
Hi Eliot, yes, in the meantime I have published https://source.squeak.org/FFI/FFI-Tests-nice.12.diff with a postscript workaround. Le dim. 26 janv. 2020 à 23:39, Eliot Miranda <[hidden email]> a écrit :
|
Free forum by Nabble | Edit this page |