Comments (8)
Do you have a minimal reproducible example? Maybe I can give it a try to see where went wrong
from wasm-micro-runtime.
generate wasm:
/E/WorkSpace/DownLoads/wasi-sdk-21.0.m-mingw/wasi-sdk-21.0+m/bin/clang -O3 -nostdlib \ -z stack-size=32768 -Wl,--initial-memory=65536 \ -o test.wasm test.c \ -Wl,--export=main -Wl,--export=__main_argc_argv -Wl,--export=test1 \ -Wl,--export=__heap_base -Wl,--export=__data_end \ -Wl,--no-entry -Wl,--strip-all -Wl,--allow-undefined
generate aot:
wamrc -o test.aot test.wasm
code in test.c:
`void test1()
{
char *buf;
buf = malloc(1024);
if (!buf) {
printf("malloc buf failed\n");
return;
}
//call native function
foo2("hello 123", buf, 1024);
printf("%s\n",buf );
free(buf);
}`
it'll call native function foo2 in iwasm.exe.
enter command like this: iwasm --heap-size=16384 -f test1 test.wasm
it's run ok.
iwasm --heap-size=16384 -f test1 test.aot
it's error.
Release.zip
all test file is in Release.zip.
from wasm-micro-runtime.
From you snapshot, I think maybe it's a platform specific question on windows, I tested it on ubuntu 20.04, it seems no error appears with foo2 implemented as following:
static void
foo2_wrapper(wasm_exec_env_t exec_env, char *name, char *result, int resultlen)
{
strncpy(result, name, resultlen);
}
static NativeSymbol native_symbols[] = {
REG_NATIVE_FUNC(foo2, "($*~)")
};
I will try it on Windows to see where went wrong
from wasm-micro-runtime.
I also tried it in Ubuntu 22.04 and it ran okay with local variables. it seems to be a specific error on the Windows platform. thank you! wait for your conclusion!
from wasm-micro-runtime.
Hi, could you please tell me whether you compiled the iwasm and wamrc with the latest commit? I didn't see similar error on Windows
from wasm-micro-runtime.
the commit date is 2024/3/26 17:55:53
from wasm-micro-runtime.
Can you try with the latest commit and recompile both the iwasm and wamrc to see whether the error is still?
from wasm-micro-runtime.
thank you very much,It's running ok after the update. :)
from wasm-micro-runtime.
Related Issues (20)
- exception handler intercepts c++ exceptions in the host on windows HOT 4
- WASM module instantiate failed on Mac HOT 1
- aot: xtensa xip triggers llvm assertion failure
- BH_DEBUG not set in multi-configuration cmake (eg. visual studio)
- printf_wrapper (libc builtin) makes multiple calls to os_printf with individual characters HOT 6
- Can AOT file built on windows run directly on other platforms? HOT 5
- How to load and run another wasm in a running wasm? HOT 12
- Exception Handling Support in Fast Interpreter HOT 1
- iwasm with aot file fail with SIGSEGV HOT 4
- Exception for Assemblyscript HOT 1
- How to cross compile to riscv64 HOT 2
- Unexpected behavior on fast interpreter mode HOT 2
- A bug in validation HOT 2
- Report some typo in wamr.gitbook HOT 1
- Calling "step-over" on the last line of the function failed
- CI test-wamr-ide failed to run HOT 1
- Request to add vmlib on Android platform to align with Linux platform HOT 2
- A bug in ckecking data count section HOT 1
- [wasi-nn] add more backends into `libraries/wasi-nn`
- Enabling WAMR_BUILD_DEBUG_INTERP causes the program to run slower
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasm-micro-runtime.