We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
try_merge_data_and_text()
Running AOT code on MacOS; works fine without --xip, but with the flag I crash on access error when trying to call native code.
--xip
Build a wasm-file and compile to aot with wamrc --target aarch64v8 --xip
wamrc --target aarch64v8 --xip
Should not crash
Crashes with access error in non executable memory
Changing aot_loader.c:2163 from
aot_loader.c:2163
sections = loader_mmap((uint32)total_size, false, NULL, 0); to sections = loader_mmap((uint32)total_size, true, NULL, 0);
sections = loader_mmap((uint32)total_size, false, NULL, 0);
sections = loader_mmap((uint32)total_size, true, NULL, 0);
fixes the issue for me.
The text was updated successfully, but these errors were encountered:
Hi, try_merge_data_and_text is called only when the aot module is not in indirect mode (module->is_indirect_mode is false):
try_merge_data_and_text
module->is_indirect_mode
wasm-micro-runtime/core/iwasm/aot/aot_loader.c
Lines 3757 to 3758 in deacb7a
But module->is_indirect_mode is set to true when the input is an XIP file:
Lines 4012 to 4015 in deacb7a
It is a little strange that it isn't set, could you help check whether create_sections and resolve_execute_mode are called?
create_sections
resolve_execute_mode
BTW, in iwasm's main function, we mmap the AOT file previously for XIP mode before loading it, and aot text won't be mmapped again during loading: https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/product-mini/platforms/posix/main.c#L891-L902
Sorry, something went wrong.
No branches or pull requests
Subject of the issue
Running AOT code on MacOS; works fine without
--xip
, but with the flag I crash on access error when trying to call native code.Test case
Your environment
Steps to reproduce
Build a wasm-file and compile to aot with
wamrc --target aarch64v8 --xip
Expected behavior
Should not crash
Actual behavior
Crashes with access error in non executable memory
Extra Info
Changing
aot_loader.c:2163
fromsections = loader_mmap((uint32)total_size, false, NULL, 0);
to
sections = loader_mmap((uint32)total_size, true, NULL, 0);
fixes the issue for me.
The text was updated successfully, but these errors were encountered: