Closed doegox closed 3 weeks ago
@jmichelp could you have a look please?
Just had a go at testing. Works for me after a few tweaks due to OSX:
pm3.so
because the build library is .dylib
on OSXdkjson.lua
to run the second test in the example otherwise the Lua module wasn't found.No segfault.
Will test on a Linux next.
Same behavior on Linux after an extra ln -sf ../../lualibs/dkjson.lua .
to run the tests until the end
Considering that the example relies on the system lua
binary, my current assumption would be that client and libraries were compiled against the bundled lua5.4 library but you're trying to run the script using your system lua.5.2
interpreter.
I could confirm this behavior on my Linux machine by running:
$ sudo apt remove lua5.4
$ sudo apt install lua5.2
$ ./02run_test.sh
[...]
[+] Communicating with PM3 over USB-CDC
./02run_test.sh: line 8: 2957012 Segmentation fault ./test.lua
😮🤦♂️ that makes totally sense, thanks! I pushed a fix to call lua5.4 in the shebang and added the dkjson symlink
Quick notes not to forget:
Problem appeared somewhere when Lua got migrated from 5.2 to 5.4:
but to test these old commits, one has to add the missing line
${PM3_ROOT}/client/src/lua_bitlib.c
inclient/experimental_lib/CMakeLists.txt
as done later with 50d9042a5cd5415dce0c54ad077529f12cbee108