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

Several Undefined Behaviours and Stack Use After Scope reports when running tests #296

Open
kunitoki opened this issue Sep 13, 2022 · 5 comments

Comments

@kunitoki
Copy link

Running the tests with ASAN and UBSAN triggers tons of reports.

See https://pastebin.com/VDygjbSv (was too big to paste here).

@dmitry-t
Copy link
Collaborator

dmitry-t commented Sep 13, 2022

Interesting.

So it's MacOS.
I don't quite understand what is the issue with the 4 byte boundary.
Maybe this reason?

It's Lua which allocates memory for userdata, so actually LuaBridge has no control over the initial alignment.
Is it possible that Lua for tests is built incorrectly for MacOS?
There's a chance a correctly built Lua will not produce such alignment issues.
@kunitoki What is the Lua version (unit test app)? Do all the apps produce the same issues?

Also I can see a lot of tests are failed.
@kunitoki Are the tests failed without the ASAN?
If so, I'd say MacOS is unsupported so far.

@dmitry-t
Copy link
Collaborator

dmitry-t commented Sep 13, 2022

Maybe this will help: http://lua-users.org/lists/lua-l/2019-07/msg00197.html

@kunitoki
Copy link
Author

kunitoki commented Sep 13, 2022

Yes the problem is a misalignment of the memory returned by lua (newuserdata) that is used as is to do placement new luabridge classes (without taking into account class alignment), no matter which lua version you chose.

@dmitry-t
Copy link
Collaborator

@kunitoki Are the tests failed on MacOS without the ASAN?

@kunitoki
Copy link
Author

The tests are passing but if i will enable ASAN and UBSAN in an application using luabridge, it's annoying as it creates lot of noise when one should be interested in reports coming from the application itself.

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

2 participants