Skip to content
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

How to get started #41

Closed
jlb6740 opened this issue Dec 7, 2018 · 14 comments
Closed

How to get started #41

jlb6740 opened this issue Dec 7, 2018 · 14 comments
Labels
❓ question I've a question!

Comments

@jlb6740
Copy link

jlb6740 commented Dec 7, 2018

Hi .. I am understanding CraneLift and related tools and I'm trying to use them to compile and run a standalone (no js or html needed) wasm programs. It is my understanding that CraneLift provides an IR and APIs for optimizing/manipulating WASM and generating executable code. This is what I want to understand. Since wasmer uses cranelift I thought this would be a good place to start to see an end-to-end process of executing WASM in a runtime. However, I am having trouble getting started. I've installed wasmer and am looking for a simple "helloworld" example that will print. The docs point me to a nginx.wasm file which I am not familiar with (google searches show it is some server code?) but when I run it I get this error message:

wasmer run nginx.wasm
nginx: [alert] could not open error log file: open() "/usr/local/nginx/logs/error.log" failed (1: Operation not permitted)
Runtime error: trap at 0x0 - segmentation violation

Since that error log doesn't exist I take it I should have installed something related to nginx first. Clearly this example is more complicated than what I am looking for right now. How should I get started with something straight forward. If I am starting with C and trying to simply print "Hello" compiling this code to WASM using emcc it is not clear to me how to properly create the C file (i.e., should it have a main? what flags do I use) to properly execute using wasmer. Any suggestions?

@appcypher appcypher added the ❓ question I've a question! label Dec 7, 2018
@appcypher appcypher changed the title Getting started question ... not an issue How to get started Dec 7, 2018
@lachlansneff
Copy link
Contributor

Hi, thanks for trying out wasmer! We're still putting the pieces together, so user-experience is a little rough right now, but it's improving fast! We don't have a good "hello, world" example, but that's a great idea! We also need documentation about how to compile c and c++ to run on wasmer.

After seeing your question, we've gone and made it much simpler to run nginx:

$ curl https://get.wasmer.io -sSfL | sh # or run "wasmer self-update" if you already have it
$ git clone https://github.com/wasmerio/wasmer-nginx-example.git
$ cd wasmer-nginx-example
$ wasmer run nginx.wasm -- -p . -c nginx.conf

and then navigate to http://localhost:8080/.

In a way, this is a "hello, world", but we intend to make it even easier in the future :).

Stay tuned for documentation on how to compile programs for wasmer within the next few days!

@jlb6740
Copy link
Author

jlb6740 commented Dec 7, 2018

Cool thanks. I just can't get this to run though:

yshou-mint:~/wasmer-nginx-example$ wasmer run nginx.wasm -- -p . -c nginx.conf
Runtime error: trap at 0x0 - segmentation violation

yshou-mint:~/wasmer-nginx-example$ wasmer --version
wasmer 0.1.3

@jlb6740
Copy link
Author

jlb6740 commented Dec 7, 2018

I had a similar error when trying to run a hello world example. All tests for wasmer seem to run.

test spectests::unwind::c35_l251_assert_trap ... ok
test spectests::unwind::c40_l257_assert_trap ... ok

test result: ok. 1439 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out

aHello World Running target/debug/deps/wasmer-cdda729fbe30d952

If you have any debug tips let me know.

@grayrest
Copy link

grayrest commented Dec 8, 2018

I ran into this same issue on nightly Rust. Switching over to stable built a working binary.

@abbasfaisal
Copy link

Facing similar issue as above.

@losfair
Copy link
Contributor

losfair commented Dec 8, 2018

Related to #34

@jlb6740
Copy link
Author

jlb6740 commented Jan 8, 2019

Hi (been offline for a while to respond to suggestions in this thread) ... what in this series of steps is being built by rust:

$ curl https://get.wasmer.io -sSfL | sh # or run "wasmer self-update" if you already have it
$ git clone https://github.com/wasmerio/wasmer-nginx-example.git
$ cd wasmer-nginx-example
$ wasmer run nginx.wasm -- -p . -c nginx.conf

My rust toolchain version is default to stable:

yshou-mint:~/wasmer-nginx-example$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)

But when I run the series of steps I still receive the same segmentation violation. I am not sure from the steps above what switching to stable is supposed to impact. I tried this a month ago around the time of my original post and again today after doing rustup update but the result is the same.

I assume this is suppose to work ... any more suggestion on debugging?

@appcypher
Copy link
Contributor

appcypher commented Jan 11, 2019

Hi @jlb6740,
We've not made a major release since then as we are actively working on a new runtime to make the use as seamless as possible.

I have personally looked into the Linux issue and there are only a few things to fix before we get it working. It's mostly just macOS-specific stuff we added a while back.

We should have it working soon.

@jlb6740
Copy link
Author

jlb6740 commented Jan 14, 2019

Hi @appcypher ... Ok thanks for the response. What is this new runtime that you refer to? Is this something that will make the current implementation in wasmer obsolete? Is there a chat or threads somewhere referencing this new effort?

@lachlansneff
Copy link
Contributor

@jlb6740 The new runtime is currently progressing in this pull-request. Its purpose is to expose a traditional webassembly module/instance api to allow users to expose imports to the webassembly module similarly to how its done in the browser. Our emscripten implementation will be moved to depend on the new runtime.

Most of the communication involving the new runtime has taken place internally, although, we expect it to be reasonably complete soon. Once complete, we will post about it.

@vitiral
Copy link
Contributor

vitiral commented Jan 19, 2019

I am curious to learn wasm and the way I was thinking would be good is to write a toy compiler, written entirely in web assembly! I think this sounds like a fun project.

It would be nice if wasmer had a simple guide that built on the webassembly by hand blog post but use wasmer instead of javascript to execute everything.

In addition, some of the necessary components to make a toy compiler are:

  • file reading
  • file writing
  • printing
  • testing

Thoughts?

@appcypher
Copy link
Contributor

@vitiral This is a fun idea. Wasmer supports all the necessary components you mentioned and several more!

WebAssembly, by itself, cannot read/write or print to the user's machine. It needs APIs like Emscripten's to take advantage of it, which is what wasmer does currently.

I was experimenting with a similar idea a while back (example/sys.wat) but we had to be pragmatic and focus on Emscripten.

Once we finalize wasmer APIs, it will be possible to implement your own host environment and import that into a webassembly instance. I may even assemble a tutorial on how to do just that since I'm very interested in that as well.

@syrusakbary
Copy link
Member

Closing this issue as the runtime is now much more mature since version 0.2.x (thanks to #80).

It should be also very easy to create your own set of imports and embed the runtime as needed.
We created a blogpost about how to do it here: https://medium.com/wasmer/executing-webassembly-in-your-rust-application-d5cd32e8ce46

Feel free to reopen the issue if you have extra questions or suggestions!

@ebarriosjr
Copy link

Just today I ran into the same problem on Debian9

Strace:

execve("/usr/local/bin/wasmer", ["/usr/local/bin/wasmer", "run", "wapm_packages/_/[email protected]/ngin"..., "--", "-p", "local", "-c", "nginx.conf"], [/* 22 vars */]) = 0
brk(NULL)                               = 0x55c314cd5000
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02573000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=21077, ...}) = 0
mmap(NULL, 21077, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f3f0256d000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340\267\10\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1566168, ...}) = 0
mmap(NULL, 3674720, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f01fd1000
mprotect(0x7f3f02143000, 2097152, PROT_NONE) = 0
mmap(0x7f3f02343000, 49152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x172000) = 0x7f3f02343000
mmap(0x7f3f0234f000, 12896, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f3f0234f000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340 \0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=31744, ...}) = 0
mmap(NULL, 2128832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f01dc9000
mprotect(0x7f3f01dd0000, 2093056, PROT_NONE) = 0
mmap(0x7f3f01fcf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f3f01fcf000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\r\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=14640, ...}) = 0
mmap(NULL, 2109680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f01bc5000
mprotect(0x7f3f01bc8000, 2093056, PROT_NONE) = 0
mmap(0x7f3f01dc7000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f3f01dc7000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0Pa\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=135440, ...}) = 0
mmap(NULL, 2212936, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f019a8000
mprotect(0x7f3f019c0000, 2093056, PROT_NONE) = 0
mmap(0x7f3f01bbf000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x17000) = 0x7f3f01bbf000
mmap(0x7f3f01bc1000, 13384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f3f01bc1000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200V\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=1063328, ...}) = 0
mmap(NULL, 3158248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f016a4000
mprotect(0x7f3f017a7000, 2093056, PROT_NONE) = 0
mmap(0x7f3f019a6000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x102000) = 0x7f3f019a6000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220*\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0644, st_size=92584, ...}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f0256b000
mmap(NULL, 2188336, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f0148d000
mprotect(0x7f3f014a3000, 2093056, PROT_NONE) = 0
mmap(0x7f3f016a2000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f3f016a2000
close(3)                                = 0
access("/etc/ld.so.nohwcap", F_OK)      = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\0\4\2\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1689360, ...}) = 0
mmap(NULL, 3795296, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f3f010ee000
mprotect(0x7f3f01283000, 2097152, PROT_NONE) = 0
mmap(0x7f3f01483000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x195000) = 0x7f3f01483000
mmap(0x7f3f01489000, 14688, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f3f01489000
close(3)                                = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02569000
mmap(NULL, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02565000
arch_prctl(ARCH_SET_FS, 0x7f3f02566fc0) = 0
mprotect(0x7f3f01483000, 16384, PROT_READ) = 0
mprotect(0x7f3f016a2000, 4096, PROT_READ) = 0
mprotect(0x7f3f019a6000, 4096, PROT_READ) = 0
mprotect(0x7f3f01bbf000, 4096, PROT_READ) = 0
mprotect(0x7f3f01dc7000, 4096, PROT_READ) = 0
mprotect(0x7f3f01fcf000, 4096, PROT_READ) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02563000
mprotect(0x7f3f02343000, 40960, PROT_READ) = 0
mprotect(0x55c312bb6000, 1392640, PROT_READ) = 0
mprotect(0x7f3f02576000, 4096, PROT_READ) = 0
munmap(0x7f3f0256d000, 21077)           = 0
set_tid_address(0x7f3f02567290)         = 3387
set_robust_list(0x7f3f025672a0, 24)     = 0
rt_sigaction(SIGRTMIN, {sa_handler=0x7f3f019adbd0, sa_mask=[], sa_flags=SA_RESTORER|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, NULL, 8) = 0
rt_sigaction(SIGRT_1, {sa_handler=0x7f3f019adc60, sa_mask=[], sa_flags=SA_RESTORER|SA_RESTART|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, NULL, 8) = 0
rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
brk(NULL)                               = 0x55c314cd5000
brk(0x55c314d07000)                     = 0x55c314d07000
futex(0x7f3f0235003c, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x7f3f02350048, FUTEX_WAKE_PRIVATE, 2147483647) = 0
futex(0x55c312d92e40, FUTEX_WAKE_PRIVATE, 2147483647) = 0
brk(0x55c314d28000)                     = 0x55c314d28000
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f3f01121060}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
open("/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3
getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0
fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
read(3, "55c311165000-55c3129b7000 r-xp 0"..., 1024) = 1024
read(3, "0-7f3f016a2000 ---p 00016000 fe:"..., 1024) = 1024
read(3, "809821                   /lib/x8"..., 1024) = 1024
read(3, "0007000 fe:01 16809823          "..., 1024) = 1024
read(3, "578000-7f3f02579000 rw-p 0000000"..., 1024) = 368
close(3)                                = 0
sched_getaffinity(3387, 32, [0, 1, 2, 3]) = 32
rt_sigaction(SIGSEGV, {sa_handler=0x55c3122a0510, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, NULL, 8) = 0
rt_sigaction(SIGBUS, {sa_handler=0x55c3122a0510, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, NULL, 8) = 0
sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02571000
sigaltstack({ss_sp=0x7f3f02571000, ss_flags=0, ss_size=8192}, NULL) = 0
getrandom("|0\230KbE\3653\\\177?\35\350\31M\252", 16, GRND_NONBLOCK) = 16
open("wapm_packages/_/[email protected]/nginx.wasm", O_RDONLY|O_CLOEXEC) = 3
fcntl(3, F_GETFD)                       = 0x1 (flags FD_CLOEXEC)
read(3, "\0asm\1\0\0\0\1\222\1\26`\3\177\177\177\1\177`\4\177\177\177\177\0`\1\177\0`\2", 32) = 32
read(3, "\177\177\1\177`\3\177\177\177\0`\1\177\1\177`\2\177\177\0`\4\177\177\177\177\1\177`\5\177\177", 32) = 32
read(3, "\177\177\177\1\177`\0\1\177`\0\0`\5\177\177\177\177\177\0`\6\177\177\177\177\177\177\1\177`\4"..., 64) = 64
read(3, "\1~`\2|\177\1|`\7\177\177\177\177\177\177\177\0`\2~\177\1~`\1~\1~\2\230\20"..., 128) = 128
read(3, "\rtempDoublePtr\3\177\0\3env\10STACKTOP\3\177"..., 256) = 256
read(3, "\2\3env\17nullFunc_iiiiii\0\2\3env\vnull"..., 512) = 512
read(3, "97\0\3\3env\r___syscall199\0\3\3env\f___"..., 1024) = 1024
read(3, "itimer\0\0\3env\n_sigaction\0\0\3env\n_s"..., 2048) = 2048
read(3, "ii\0\206\v\23establishStackSpace\0i\vgetT"..., 4096) = 4096
read(3, "\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210\v\210"..., 8192) = 8192
read(3, "\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\215\v\211\6\212\6\215"..., 16384) = 16384
read(3, " \20A\10j)\2\0007\2\0 *A\20j \20A\20j)\2\0007\2\0 *A\30j"..., 32768) = 32768
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02542000
read(3, "\250\1A\24j!\256\1 \256\1 \234\0016\2\0 \250\1A\30j!\257\1 \257\1 \236\1"..., 65536) = 65536
mremap(0x7f3f02542000, 135168, 266240, MREMAP_MAYMOVE) = 0x7f3f02501000
read(3, "\334\1 \321\1s!\335\1 \335\1 \306\1q!\336\1 \336\1 \321\1s!\337\1 dA"..., 131072) = 131072
mremap(0x7f3f02501000, 266240, 528384, MREMAP_MAYMOVE) = 0x7f3f02480000
read(3, " \22 \4A\24ljA\4j!. .A\0206\2\0 - SF!/ /\4\177A"..., 262144) = 262144
mremap(0x7f3f02480000, 528384, 1052672, MREMAP_MAYMOVE) = 0x7f3f0237f000
read(3, " D \0056\2\0 \5!\7A\f!\10\f\27\f\3\0\v\0\v\2@ \221\1 \0056\2"..., 524288) = 524288
mremap(0x7f3f0237f000, 1052672, 2101248, MREMAP_MAYMOVE) = 0x7f3f00eed000
read(3, "\210\222\r L6\2\0A\220\222\rA\0006\2\0A\214\222\r \251\0076\2\0 \252\7!\275"..., 1048576) = 203848
read(3, "", 844728)                     = 0
close(3)                                = 0
stat("/root/.wasmer/cache/f99058fa590a2584bd63d4de4d82dfdd36120f25487f9fe1f13edf4b2a302d1feaaa8929c0e530c55803d9fbb56bb338ccd8cb1f1c172c34a741eab9b29aacf2", {st_mode=S_IFDIR|0755, st_size=23, ...}) = 0
stat("/root/.wasmer/cache/f99058fa590a2584bd63d4de4d82dfdd36120f25487f9fe1f13edf4b2a302d1feaaa8929c0e530c55803d9fbb56bb338ccd8cb1f1c172c34a741eab9b29aacf2", {st_mode=S_IFDIR|0755, st_size=23, ...}) = 0
open("/root/.wasmer/cache/f99058fa590a2584bd63d4de4d82dfdd36120f25487f9fe1f13edf4b2a302d1feaaa8929c0e530c55803d9fbb56bb338ccd8cb1f1c172c34a741eab9b29aacf2/cranelift/ddf32f5b095f966b62c80941c8755ff83b21c98cf93ed241304b1c2f13d92387139de39f82c8570eec687a0bc324d9935c1590be7c3e4fffb5e8eaa9b8c38d6a", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=3823021, ...}) = 0
mmap(NULL, 3823021, PROT_READ, MAP_SHARED, 3, 0) = 0x7f3f00b47000
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02542000
mmap(NULL, 1310720, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02402000
mmap(NULL, 2367488, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f00905000
mprotect(0x7f3f00905000, 2367488, PROT_READ|PROT_EXEC) = 0
brk(0x55c314d4c000)                     = 0x55c314d4c000
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f023e1000
mremap(0x7f3f023e1000, 135168, 266240, MREMAP_MAYMOVE) = 0x7f3f023a0000
mremap(0x7f3f023a0000, 266240, 528384, MREMAP_MAYMOVE) = 0x7f3f00884000
mremap(0x7f3f00884000, 528384, 1052672, MREMAP_MAYMOVE) = 0x7f3f00783000
mremap(0x7f3f00783000, 1052672, 2101248, MREMAP_MAYMOVE) = 0x7f3f00582000
munmap(0x7f3f02402000, 1310720)         = 0
mprotect(0x7f3f00905000, 2367488, PROT_READ|PROT_WRITE) = 0
mmap(NULL, 4096, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f02570000
mprotect(0x7f3f02570000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0x7f3f02570000, 4096, PROT_READ|PROT_EXEC) = 0
mprotect(0x7f3f00905000, 2367488, PROT_READ|PROT_EXEC) = 0
munmap(0x7f3f00b47000, 3823021)         = 0
close(3)                                = 0
mmap(NULL, 6442450944, PROT_NONE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3d80582000
mprotect(0x7f3d80582000, 16777216, PROT_READ|PROT_WRITE) = 0
brk(0x55c314d8b000)                     = 0x55c314d8b000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f3f0256f000
rt_sigaction(SIGFPE, {sa_handler=0x55c3120c7180, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGILL, {sa_handler=0x55c3120c7180, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
rt_sigaction(SIGSEGV, {sa_handler=0x55c3120c7180, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, {sa_handler=0x55c3122a0510, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, 8) = 0
rt_sigaction(SIGBUS, {sa_handler=0x55c3120c7180, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, {sa_handler=0x55c3122a0510, sa_mask=[], sa_flags=SA_RESTORER|SA_STACK|SA_SIGINFO, sa_restorer=0x7f3f019b90c0}, 8) = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
open("/etc/localtime", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=127, ...}) = 0
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., 4096) = 127
lseek(3, -71, SEEK_CUR)                 = 56
read(3, "TZif2\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0\0\0\1\0\0\0\0"..., 4096) = 71
close(3)                                = 0
getpid()                                = 3387
getpid()                                = 3387
open("local/logs/error.log", O_WRONLY|O_CREAT|O_APPEND|O_LARGEFILE, 0644) = 3
uname({sysname="Linux", nodename="wapm", ...}) = 0
open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 4
read(4, "0-3\n", 8192)                  = 4
close(4)                                = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
uname({sysname="Linux", nodename="wapm", ...}) = 0
open("local/nginx.conf", O_RDONLY|O_LARGEFILE) = 4
fstat(4, {st_mode=S_IFREG|0644, st_size=467, ...}) = 0
pread64(4, "events {\n}\n\n# We need this for n"..., 467, 0) = 467
close(4)                                = 0
geteuid()                               = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
connect(4, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0
sendto(4, "\2\0\0\0\v\0\0\0\7\0\0\0passwd\0", 19, MSG_NOSIGNAL, NULL, 0) = 19
poll([{fd=4, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=4, revents=POLLIN}])
recvmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="passwd\0", iov_len=7}, {iov_base="\310O\3\0\0\0\0\0", iov_len=8}], msg_iovlen=2, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[5]}], msg_controllen=20, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 15
mmap(NULL, 217032, PROT_READ, MAP_SHARED, 5, 0) = 0x7f3f0250d000
close(5)                                = 0
close(4)                                = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 4
connect(4, {sa_family=AF_UNIX, sun_path="/var/run/nscd/socket"}, 110) = 0
sendto(4, "\2\0\0\0\f\0\0\0\6\0\0\0group\0", 18, MSG_NOSIGNAL, NULL, 0) = 18
poll([{fd=4, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ([{fd=4, revents=POLLIN|POLLHUP}])
recvmsg(4, {msg_name=NULL, msg_namelen=0, msg_iov=[{iov_base="group\0", iov_len=6}, {iov_base="\310O\3\0\0\0\0\0", iov_len=8}], msg_iovlen=2, msg_control=[{cmsg_len=20, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data=[5]}], msg_controllen=20, msg_flags=MSG_CMSG_CLOEXEC}, MSG_CMSG_CLOEXEC) = 14
mmap(NULL, 217032, PROT_READ, MAP_SHARED, 5, 0) = 0x7f3f024d8000
close(5)                                = 0
close(4)                                = 0
rt_sigprocmask(SIG_BLOCK, NULL, [], 8)  = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=NULL} ---
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
munmap(0x7f3d80582000, 6442450944)      = 0
munmap(0x7f3f02570000, 4096)            = 0
munmap(0x7f3f00582000, 2101248)         = 0
munmap(0x7f3f00905000, 2367488)         = 0
munmap(0x7f3f02542000, 135168)          = 0
munmap(0x7f3f00eed000, 2101248)         = 0
write(2, "execute_wasm: ", 14execute_wasm: )          = 14
write(2, "\"", 1")                       = 1
write(2, "RuntimeError: ", 14RuntimeError: )          = 14
write(2, "\\", 1\)                       = 1
write(2, "\"", 1")                       = 1
write(2, "unknown trap at 0x0 - segmentati"..., 44unknown trap at 0x0 - segmentation violation) = 44
write(2, "\\", 1\)                       = 1
write(2, "\"", 1")                       = 1
write(2, "\"", 1")                       = 1
write(2, "\n", 1
)                       = 1
sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0
munmap(0x7f3f02571000, 8192)            = 0
exit_group(1)                           = ?
+++ exited with 1 +++```

nlewycky added a commit that referenced this issue Aug 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question I've a question!
Projects
None yet
Development

No branches or pull requests

9 participants