8000 FindPackage in CMake may mix Lua versions · Issue #35 · ligurio/luzer · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

FindPackage in CMake may mix Lua versions #35

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

Open
Buristan opened this issue Apr 7, 2025 · 0 comments
Open

FindPackage in CMake may mix Lua versions #35

Buristan opened this issue Apr 7, 2025 · 0 comments

Comments

@Buristan
Copy link
Contributor
Buristan commented Apr 7, 2025

I have the following Lua versions installed on my machine:

tree /usr/include/lua*
/usr/include/lua5.1
├── lauxlib.h
├── luaconf.h
├── lua.h
├── lua.hpp
└── lualib.h
/usr/include/lua5.4
├── lauxlib.h
├── luaconf.h
├── lua.h
├── lua.hpp
└── lualib.h
/usr/include/luajit-2.1
├── lauxlib.h
├── luaconf.h
├── lua.h
├── lua.hpp
├── luajit.h
└── lualib.h

ls /usr/lib64/ | grep lua
liblua5.1.so
liblua5.1.so.0
liblua5.1.so.0.0.0
liblua5.4.so
liblua5.4.so.0
liblua5.4.so.0.0.0
libluajit-5.1.so
libluajit-5.1.so.2
libluajit-5.1.so.2.1.1716656478

The mixed part is the custom mutator library, which uses lua_objlen() which is renamed to the lua_rawlen() since Lua 5.2.

As I noticed, when I build luzer like the following:

cmake -S . -B build -DENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++

It finds the Lua header for the 5.1 version but links with the version 5.4.

As a result, the custom mutator library can't be preloaded:

LD_PRELOAD="/home/burii/reviews/ligurio-luzer/ligurio-luzer/build/luzer/libcustom_mutator.so.1" ls
ls: symbol lookup error: /home/burii/reviews/ligurio-luzer/ligurio-luzer/build/luzer/libcustom_mutator.so.1: undefined symbol: lua_objlen

It results in the following test failures when run by Lua 5.4 binary:

$ ctest -V --test-dir build -R luzer_custom_mutator_example
...
7: /usr/bin/lua5.4: ...burii/reviews/ligurio-luzer/ligurio-luzer/luzer/init.lua:48: function LLVMFuzzerCustomMutator is not available
7: stack traceback:
7:      [C]: in function 'luzer_impl.Fuzz'
7:      ...burii/reviews/ligurio-luzer/ligurio-luzer/luzer/init.lua:48: in function 'luzer.Fuzz'
7:      ...-luzer/ligurio-luzer/examples/example_custom_mutator.lua:29: in main chunk
7:      [C]: in ?
1/1 Test #7: luzer_custom_mutator_example .....***Failed  Required regular expression not found. Regex=[example_custom_mutator.lua:19: assert has triggered
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

1 participant
0