rrthomas / lrexlib

A Lua (5.1 and later) binding of various regex library APIs (POSIX, PCRE, PCRE2, GNU, Oniguruma and TRE)
Other
161 stars 29 forks source link

Lua 5.3 error in rex_pcre.so - Symbol not found: _lua_newuserdata #37

Closed cconcannon closed 3 years ago

cconcannon commented 4 years ago

I'm trying to install lrexlib-pcre as a dependency of the LuaRocks jsonschema module. When I try to require the jsonschema package in my .lua file, an error results when trying to load rex_pcre.so:

error loading module 'rex_pcre' from file '/usr/local/lib/lua/5.3/rex_pcre.so':
    dlopen(/usr/local/lib/lua/5.3/rex_pcre.so, 6): Symbol not found: _lua_newuserdata
  Referenced from: /usr/local/lib/lua/5.3/rex_pcre.so
  Expected in: flat namespace
 in /usr/local/lib/lua/5.3/rex_pcre.so

Any help would be appreciated. I saw in prior issues that it is recommended to check the installation on it's own with lua -lrex_pcre - this results in the exact same error as above.

shmuz commented 4 years ago

_lua_newuserdata is a symbol that belongs to Lua not Lrexlib. May be rex_pcre.so was somehow incorrectly built? @rrthomas , you're on Linux, does rex_pcre.so work for you with Lua 5.3?

rrthomas commented 4 years ago

Yes, works fine for me with 5.3. Something is not properly linked. On my system, the symbol is in the Lua binary (I use the default PUC-Rio build where the lua binary is linked statically to liblua):

$ nm lua5.3|grep newuserdata
000000000000a9e0 T lua_newuserdata