matz / streem

prototype of stream based programming language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

streem crashed when run: seq(10) | {x -> x * 2} | stdout

pjincz opened this issue · comments

See below:

jcz@jcz-vbox:~/streem/bin$ echo 'seq(10) | {x -> x * 2} | stdout' | ./streem
Segmentation fault (core dumped)

git commit: d6af47c
gcc: 4.8.4
System: ubuntu 14.04

It doesn't happen on my machine.

git commit: d6af47c
gcc: 5.2.1
System: ubuntu 15.10

Could you show us the stacktrace?

Of course.

(gdb) bt
#0  0x0000000000402e22 in kh_get_env (h=0x4018a0 <_start>, key=18444210798919166465) at env.c:4
#1  0x0000000000403901 in env_get (env=0x4018a0 <_start>, name=18444210798919166465, val=0x7ffff6ff4c00) at env.c:33
#2  0x0000000000403a39 in strm_var_get (state=0x7fffffffe370, name=18444210798919166465, val=0x7ffff6ff4c00) at env.c:71
#3  0x0000000000404dc3 in exec_call (strm=0x624890, state=0x7ffff6ff4ea0, name=18444210798919166465, argc=2, argv=0x7ffff6ff4d10, ret=0x7ffff6ff4e80) at exec.c:376
#4  0x00000000004055c4 in exec_expr (strm=0x624890, state=0x7ffff6ff4ea0, np=0x6235e0, val=0x7ffff6ff4e80) at exec.c:537
#5  0x00000000004058d8 in exec_expr (strm=0x624890, state=0x7ffff6ff4ea0, np=0x623640, val=0x7ffff6ff4e80) at exec.c:607
#6  0x00000000004061b5 in blk_exec (strm=0x624890, data=18442803424035602433) at exec.c:797
#7  0x0000000000401eb1 in task_exec (strm=0x624890, task=0x7ffff00008c0) at core.c:105
#8  0x0000000000401f40 in task_loop (data=0x624ad0) at core.c:127
#9  0x00007ffff7bc4182 in start_thread (arg=0x7ffff6ff5700) at pthread_create.c:312
#10 0x00007ffff78f147d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

valgrind found weird memory access error near the places you had the problem.
I have not yet located the bug yet, but I think I got the clue.

Coooooool!

If there is anything I can do, tell me please.

In my machine(Mac OSX 10.11, clang-703.0.29), the newest code(git: b40e010) also caused segmentation fault, when run ../bin/streem 03fizzbuzz.strm.

$: ../bin/streem 03fizzbuzz.strm
[1]    60809 segmentation fault  ../bin/streem 03fizzbuzz.strm

I think 39533e7 fixed the problem, if not, please reopen the issue.

Good job! I tried to solve the bug for 4 hours...

@JackDrogon Sorry for wasting 4 hours of your time (and leaving the issue for 29 days for @jinchizhong).

Cool, it works on my computer.

thx