Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error loading mdoule 'ffi': undefined symbol: lua_getiuservalue #86

Open
Robin-Sch opened this issue Nov 26, 2024 · 5 comments
Open

error loading mdoule 'ffi': undefined symbol: lua_getiuservalue #86

Robin-Sch opened this issue Nov 26, 2024 · 5 comments

Comments

@Robin-Sch
Copy link

Hello everyone!

I just installed lua-vips, however, I constantly get the following error:

error loading mdoule 'ffi': undefined symbol: lua_getiuservalue

could you please help me out how to debug this? Thanks a lot!

@jcupitt
Copy link
Member

jcupitt commented Nov 26, 2024

Hello @Robin-Sch,

Which Lua version is this, and which platform are you using?

lua_getiuservalue ought to be in current Lua, I think:

https://www.lua.org/manual/5.4/manual.html#lua_getiuservalue

If you cannot link to it, perhaps you are missing the Lua dev package?

@Robin-Sch
Copy link
Author

I am using arch linux, lua version 5.4.7. How do I get the dev package?

@jcupitt
Copy link
Member

jcupitt commented Nov 26, 2024

Sorry, I don't know arch too well. Maybe ask on their support?

@Robin-Sch
Copy link
Author

Robin-Sch commented Nov 26, 2024

I have not too much experience with lua, but I think everything should already be installed perfect fine: https://wiki.archlinux.org/title/Lua

@rolandlo
Copy link
Collaborator

@Robin-Sch How exactly did you install lua-vips and how do you use it?

One observation: lua_getiuservalue is only available in Lua 5.4, not in earlier Lua versions.
On my system (on which lua is for version 5.3):

strings $(which lua) | grep uservalue

returns

lua_setuservalue
lua_getuservalue
getuservalue
setuservalue

whereas

strings $(which lua5.4) | grep uservalue

returns

lua_setiuservalue
lua_getiuservalue
getuservalue
setuservalue

So first check if the symbol is available in your Lua binary.

Further you could try debugging like this:

  1. Run the GNU debugger via gdb lua5.4 (or gdb lua depending on the name of the Lua 5.4 binary on your system)
  2. Enter break lua_getiuservalue into the debugger console (and confirm with the Enter key). I get
(gdb) break lua_getiuservalue                                                   
Downloading source file /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/lapi.c
Haltepunkt 1 at 0xb740: file /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/lapi.c, line 802.
  1. Enter run into the debugger console. Now the Lua console should start running.
  2. Enter vips = require "vips" into the Lua console. I get
Downloading separate debug info for /usr/local/lib/lua/5.4/ffi.so
                                                                                
Breakpoint 1, lua_getiuservalue (L=0x55555559e2a8, idx=-1, n=1)
    at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/lapi.c:802
Warnung: 802	/build/lua5.4-GCEpSw/lua5.4-5.4.6/src/lapi.c: Datei oder Verzeichnis nicht gefunden
  1. Enter bt to get a backtrace. I get
#0  lua_getiuservalue (L=0x55555559e2a8, idx=-1, n=1)
    at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/lapi.c:802
#1  0x00007ffff7fa7e01 in parse_type () from /usr/local/lib/lua/5.4/ffi.so
#2  0x00007ffff7f9cfa0 in add_typedef () from /usr/local/lib/lua/5.4/ffi.so
#3  0x00007ffff7f9e092 in setup_upvals () from /usr/local/lib/lua/5.4/ffi.so
#4  0x000055555556432a in precallC (f=<optimised out>, nresults=0, 
    func=0x5555555e2b50, L=0x55555559e2a8)
    at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/ldo.c:529
#5  luaD_precall (L=L@entry=0x55555559e2a8, func=<optimised out>, 
    nresults=nresults@entry=0)
    at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/ldo.c:595
#6  0x0000555555564e65 in ccall (inc=65537, nResults=0, func=<optimised out>, 
    L=0x55555559e2a8) at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/ldo.c:635
#7  luaD_callnoyield (nResults=0, func=<optimised out>, L=0x55555559e2a8)
    at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/ldo.c:655
#8  lua_callk (L=0x55555559e2a8, nargs=<optimised out>, nresults=0, 
    ctx=<optimised out>, k=<optimised out>)
    at /build/lua5.4-GCEpSw/lua5.4-5.4.6/src/lapi.c:1020
#9  0x00007ffff7fa45a4 in luaopen_ffi () from /usr/local/lib/lua/5.4/ffi.so
#10 0x000055555556432a in precallC (f=<optimised out>, nresults=1, 

Report back what you get instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants