Hello there, I receive a crash when using cranelift to declare a function: https://pastebin.com/jRg7uWcv
I haven't been receiving this crash until today, and as far as I can tell, I just made some functions slightly longer, and I lowered the total count of functions.
The number of functions I declare here is very large (sometimes over 50k) so maybe that is contributing to the issue?
For what it's worth, here is where the crash takes place in my code: https://github.com/MCHPR/MCHPRS/blob/4bcb935b3690ee48fcd54ebd8237a3b96902353a/src/redpiler/backend/cranelift.rs#L1205
Let me know if more information is required :)
The crash happens at https://github.com/bytecodealliance/wasmtime/blob/91482f39d0ab29cab4939e5484701877693ba599/cranelift/jit/src/backend.rs#L248
The number of functions I declare here is very large (sometimes over 50k) so maybe that is contributing to the issue?
That is probably the issue. cranelift-jit currently can't handle the PLT and GOT being more than 2^31 bytes apart. This can happen if you define a lot of functions such that the memory allocations become far apart. It could also happen I think if another thread concurrently allocates memory.
I think one option to fix this would be to have the GOT and PLT be part of the same allocation and use different memory protections instead of usr diffetent allocations.
Last updated: Dec 23 2024 at 12:05 UTC