-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Index out of bounds and misaligned addresses #11544
Comments
Some things that might be an issue:
If those don't help, I'd try to reduce the problem to a standalone testcase. The problem may become obvious when doing so, and if not, you may end up with a testcase showing a bug in LLVM that we need to fix. |
Unaligned access can be tricky. Code can compile and run fine one day, but crash the next. It already looks like |
@kripken I've boiled it down to a minimal example. I have no clue why it is still giving the same errors. Please take a look, I have the minimal example in this repo: It is also hosted here: |
I think I have a suspicion on what's going wrong. I think when you're constructing I think you could get around this be either changing |
Hmm, I think this is fixed by #10110 - our malloc alignment is just 8, but should be 16. This testcase hits a situation where clang assumes malloc is 16-byte aligned, I believe. It's possible a recent clang change caused it to care about it when it didn't before, which is why it wasn't noticed earlier. Hopefully we can land that PR soon. |
Perfect, thanks! |
Hello, is there any update on this issue? I'm trying "sanitize=undefined" on my program and getting many of these "constructor call on misaligned address" errors (caused by 16-byte-aligned objects being allocated by |
This has been fixed on the LLVM side, see #14456 (comment) |
I have a game that was working just fine several months ago. I rebuilt it and now it is broken.
I am getting this in web console:
So, I added this to my makefile:
-s SAFE_HEAP=1 -s WARN_UNALIGNED=1 -fsanitize=undefined
Now, I am getting errors like this for various objects:
Since these objects fail to get instantiated, I then get seg fault when the main loop runs:
Here is what my makefile looks like:
You can see all the errors in the console here:
https://grafflifetest.herokuapp.com/
I don't understand how this is suddenly happening when it was working fine before.
I am really not doing anything special other than instantiating objects to pointer variables.
Any help would be greatly appreciated.
The text was updated successfully, but these errors were encountered: