luvit / luvi

A project in-between luv and luvit.
Apache License 2.0
308 stars 63 forks source link

"unprotected error in call to Lua API" with custom ARM binary #264

Closed sjkim04 closed 2 years ago

sjkim04 commented 2 years ago

Continuing from https://github.com/luvit/lit/issues/312

How you build or where do you get luvi? and ~/Desktop/luvi without any args output any message?

I built it from my Desktop. For a short preview of what commands did I run

git clone --recursive -b v2.14.0
cd luvi
make regular
make
make test

make test and ./build/luvi samples/test.app outputs the same error, which presumably happens in line 8.

./build/luvi prints the normal help message.

@zhaozg

truemedian commented 2 years ago

unfortunately that error message in the attached issue does not mean line 8, it means error 8, which if I remember correctly is either a table overflow or nan index. you can check lj_errmsg.h for more information

zhaozg commented 2 years ago

Please try make regular WITH_LUA_ENGINE= Lua, I guess luajit -b cause this issue.

And uanme -a will give us detail ARCH/OS info.

sjkim04 commented 2 years ago
$ uname -a
Linux raspberrypi 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux

Running make now, will report details after build finishes.

sjkim04 commented 2 years ago

WITH_LUA_ENGINE=Lua actually worked! Thank you! Closing

zhaozg commented 2 years ago

armv7l is a 32bit CPU, and not adequate test for 32bit ARM, because lack of test environment.

Bilal2453 commented 2 years ago

If I am not mistaken, Truemedian was running into this lately with their automatic GitHub builds. Seems like it worked for some time then regression in LuaJIT caused this? Probably will need to look into the make script of LuaJIT

zhaozg commented 2 years ago

Probably will need to look into the make script of LuaJIT

LuaJIT is the more likely cause, but it only a doubt, we need more check and test to narrow down it.

zhaozg commented 2 years ago

reproduce with docker, image is arm32v7/ubuntu:xenial hash is 20832692ca6e.

uname output Linux 31112c604e51 5.10.104-linuxkit #1 SMP Thu Mar 17 17:08:06 UTC 2022 armv7l armv7l armv7l GNU/Linux.

build/luvi samples/test.app -- 1 2 3 4
PANIC: unprotected error in call to Lua API (8)
Makefile:91: recipe for target 'test' failed
make: *** [test] Error 1