<div dir="ltr"><div dir="ltr"><div dir="ltr">Hi Nicolas,<br><div><br></div><div>    I can't reproduce this because <span style="color:rgb(0,0,0)">FFITestSfd  & </span><font color="#000000">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.</font></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Jan 26, 2020 at 1:38 PM Nicolas Cellier <<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"> <div dir="ltr"><div>Hi all,</div><div>I defined new FFI-Tests with struct inside struct.</div><div>I wanted to check for correct alignment (this works as it should thanks to Ronie!).</div><div><br></div><div>But when I reload the package into a new image, there is an initialization order problem.</div><div>It seems that the struct FFITestSfd is created AFTER the struct FFITestSsSfd.</div><div>But struct FFITestSsSfd depends on struct FFITestSfd (it is just struct {short s1; struct FFITestSfd sfd2;}</div><div>Consequently, FFITestSsSfd DOES not get correctly initialized...</div><div>It simply ignore the missing FFITestSfd definition, and believes that it has a single field (short s1) and that it is of size 2...</div><div><br></div><div>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...</div><div><br></div><div>We can't live long with such hanging sword above our heads and should urgently fix it.</div><div>At least, you are warned, don't execute new FFI tests blindly.<br> </div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>