On 22 November 2017 at 13:38, Todd Blanchard <tblanchard@mac.com> wrote:��I've been trying to track this down for a couple weeks now.I have concluded that structs passed by value to functions on the 64 bit VM are not properly populated.�� The struct's memory is all zero'd.I found this while trying to work with LibClang and found that functions that fetched code locations from code ranges always returned invalid zero'd locations.�� After spending some time with lldb I have traced the problem into the native code and found that the argument is not correct.I've carved out the wee bit of clang to reproduce this in a tiny library.The gist of it is below and the entire file is included.�� Basically the struct passed to the function clang_getRangeStart is zero'd memory regardless of the data I send from the image side.The build command I used on sierra is��clang -shared -undefined dynamic_lookup -o microclang.dylib microclang.cOn Ubuntu 16.04 I used...$ clang -shared -fPIC -o libmicroclang.so microclang.c$��clang test.c -L. -l microclang�� ��test.c:6:53: error: no member named 'begin_int_data' in 'CXSourceLocation'�� ��if(clang_getRangeStart(clang_getArbitraryRange()).begin_int _data == 0)�� I presume you meant...�� ����if(clang_getRangeStart(clang_getArbitraryRange()).int_data == 0)�� so correcting and continuing...$ clang test.c -L. -l microclang$ LD_LIBRARY_PATH=. ./a.outThat failedSo I'm not sure how to proceed.����I was expecting that would work while Pharo failed.Now interestingly...$ clang test.c microlang.c$ ./a.outThat workedSo it seems a similar problem exists outside our FFI.��cheers -benP.S. I refactored you code to extract a header file (attached)