-
Notifications
You must be signed in to change notification settings - Fork 9
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 access out of bounds #17
Comments
Curious. The random actions tests on my WASM project are running fine. Thanks for the minimal reproduction. I'd like to look into it. However, I'm struggling to build the zstd crate. The This is quite low priority for me at the moment, but I trust it isn't blocking your development. I'll see what I can do when I have time: hopefully sooner rather than later. |
Ah yeah, I believe you need to disable default features. This is how I include zstd in my wasm projects: zstd = { version = "0.12.3", default-features = false, features = ["fat-lto"] } Low priority is fine, as I'm just in exploratory mode, and figured you might be interested in feedback. I have an app where this triggers without running zstd code, so if I determine another edge case I'll post it here. |
Thanks for the crate import incantation :) Finally got some time to work on this. This debugging session has been long and bizarre. I won't be able to do anything about this, I think. The zstd C code seems to be calling the Rust allocator, but issues deallocations with a size of 1 (breaking the contract with GlobalAlloc implementers https://doc.rust-lang.org/stable/std/alloc/trait.GlobalAlloc.html#tymethod.dealloc).
I'm putting together a minimal reproduction for the zstd-rs maintainer(s), perhaps they can do something about it, but I'm not sure (given the deallocations, if I'm not mistaken, originate in the ZSTD_freeCCtx C function, which they'd have to patch or something odd?). |
The crate maintainer has (more or less) confirmed the problem on their end, so I'm closing this issue for now. Thanks for bringing this to my attention! For now, don't combine the |
The issue with |
Wow, I greatly appreciate you championing this bug fix. Thank you so much! |
@nickbabcock New version of zstd-rs is out with the fix gyscos/zstd-rs#248 (comment) :) |
I'm getting a memory access out of bounds when I sub in talc as the global allocator for wasm (not sure if it is restricted to wasm).
The code is pretty minimal. Simplifying and adding in talc results in:
dlmalloc and lol_alloc do not exhibit this issue.
The amount of data that is passed has been irrelevant so far.
Let me know if you want more information. Seems a bit related to what zstd is doing under the covers as I haven't been able to reproduce without it (yet).
The text was updated successfully, but these errors were encountered: