8000 Problem in executing the embedder-example.c · Issue #264 · WAVM/WAVM · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Problem in executing the embedder-example.c #264

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

Closed
bitcuits opened this issue Mar 16, 2020 · 2 comments
Closed

Problem in executing the embedder-example.c #264

bitcuits opened this issue Mar 16, 2020 · 2 comments

Comments

@bitcuits
Copy link

The embedder-example.c returns a null pointer when it executes the wasm_module_new_text function.
My configuation is as follows

starship:~/work/tagion_main/WAVM/Examples/embedder/c> uname -a
Linux starship 4.15.0-1073-oem #83-Ubuntu SMP Mon Feb 17 11:21:18 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

starship:~/work/tagion_main/WAVM/Examples/embedder/c> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

starship:/work/tagion_main/WAVM/Examples/embedder/c> g++ --version
g++ (Ubuntu 7.5.0-3ubuntu1
18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

starship:/work/tagion_main/WAVM/Examples/embedder/c> dpkg -l|grep llvm
ii libllvm6.0:amd64 1:6.0-1ubuntu2 amd64 Modular compiler and toolchain technologies, runtime library
ii libllvm9:amd64 1:9-2
ubuntu18.04.2 amd64 Modular compiler and toolchain technologies, runtime library
ii llvm 1:6.0-41exp5ubuntu1 amd64 Low-Level Virtual Machine (LLVM)
ii llvm-6.0 1:6.0-1ubuntu2 amd64 Modular compiler and toolchain technologies
ii llvm-6.0-dev 1:6.0-1ubuntu2 amd64 Modular compiler and toolchain technologies, libraries and headers
ii llvm-6.0-runtime 1:6.0-1ubuntu2 amd64 Modular compiler and toolchain technologies, IR interpreter
ii llvm-runtime 1:6.0-41exp5ubuntu1 amd64 Low-Level Virtual Machine (LLVM), bytecode interpreter

I have forked the project into https://github.com/tagion/WAVM.git.
git clone https://github.com/tagion/WAVM.git
git fetch
git checkout examble_null_result

The example is placed in.
cd Examples/embedder/c
And hardcoded Makefile is also place in this directory.
Run the example by
starship:~/work/tagion_main/WAVM/Examples/embedder/c> make
export LD_LIBARY_PATH=/home/carsten/work/tagion_main/WAVM; ./embedder-example
engine 0x55fe5b9d5f20
compartment 0x55fe5b9d6370
store 0x55fe5b9d7480
Start
sizeof(hello_wast) =147
module (nil)
Makefile:20: recipe for target 'run' failed
make: *** [run] Error 1

Thank you
cbleser

@bitcuits
Copy link
Author

I have fix the issue in this branch.
I seems that the source string for the wasm_module_new_text should be a cstring (\0 terminated string) and not a char[].
I work when the type of
hello_wast
is change from char[] to char*

@mohanson
Copy link

I submitted a PR that solves this problem #279

kenohassler pushed a commit to fgsect/WAFL that referenced this issue Oct 18, 2021
… null terminated.

Previously, it added a null terminator to all input strings, which resulted in a lexer error if the input string was already null terminated.
Fixes WAVM#264
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants
0