-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Memory leak in class function #21709
Comments
I can't seem to reproduce this. Admittedly I simplified the test case a little by adding this main function and running it under node:
I don't see any leak reports, so I guess there is something else going on with your more complex version. One thing to try might be to remove For sure it seems like that particular allocation should be ignored by lsan, as the comment says. According to the commend this is not really leak since its a one time allocation that happens at program startup and never again. I suppose there would be no benefit to trying to free it during shutdown. |
@sbc100 I've tried to build by directly invoking em++ test.cpp -lembind -sEXIT_RUNTIME -fsanitize=leak Yes, this doesn't report any memory leaks, but build from meson/ninja system still raises a direct leak of 8 bytes. Nevertheless, it's undoubtedly not an actual leak, so I consider it a minor issue. |
I've been encountering into memory leak when I use class function binding.
Despite I explicitly called
delete()
function, the memory leak is still happening atdoLeackCheck()
.As far as my looking, the situation happens from
bind.h
:I'm wondering this is real leak because I see the comment
not a leak because this is called once per binding
. However the leak sanitizer still addresses this as memory leak, and seems not to be freed even afterdelete()
called.I attach addr2line output in where sanitizer points:
Appreciated if I can ensure things:
__lsan_ignore_object
?Version of emscripten/emsdk:
Full link command and output with
-v
appended:I've tried in meson/ninja build system. It would be better if you can refer to the repro repo here:
https://github.com/tinyjin/wasm-emscripten-leak
Then If I try run this module in JS, 8 bytes direct leak occurred in each class function binding:
The text was updated successfully, but these errors were encountered: