ykjit / yklua

yk-enabled Lua interpreter
4 stars 4 forks source link

Failing test - bitwise.lua with YKD_SERIALISE_COMPILATION=1 #37

Open Pavel-Durov opened 1 year ago

Pavel-Durov commented 1 year ago

Issue

Error on running bitwise.lua test with serial compilation:

$ YKD_SERIALISE_COMPILATION=1 ../src/lua -e"_U=true" bitwise.lua

Fails with error:

Floating point instructions are not supported yet:   %618 = sitofp i32 %612 to double, !dbg !9498 x kimchi@kimchi-machine ~/git-repos/yklua-fork/tests yk-location-allocation/056cf6ae7cb3ebd59a7e0dc89df99c03f0e8d3d9

However, when running with non-serialised compilation it works:

$ try_repeat 1000 ../src/lua -e"_U=true" bitwise.lua

This behaviour seems to be reproducible.

Versions:

YkLua - yk-location-allocation/056cf6ae7cb3ebd59a7e0dc89df99c03f0e8d3d9 Yk - master/a690e6eaf7253a4fa9c04bb54406c07b7efc0085

Pavel-Durov commented 1 year ago

After https://github.com/ykjit/yk/pull/830 change in YK, we get new errors :)

YKD_SERIALISE_COMPILATION=1 ../src/lua -e"_U=true" bitwise.lua 
...
realloc(): invalid old size
Aborted
... 
YKD_SERIALISE_COMPILATION=1 ../src/lua -e"_U=true" bitwise.lua 
...
mremap_chunk(): invalid pointer
Aborted
...
YKD_SERIALISE_COMPILATION=1 ../src/lua -e"_U=true" bitwise.lua 
Segmentation fault

Stacktraces:

Thread 7 "lua" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee59d6c0 (LWP 1939141)]
__GI___libc_realloc (oldmem=0x365e, bytes=2541024) at ./malloc/malloc.c:3420
3420    ./malloc/malloc.c: No such file or directory.
(gdb) bt
#0  __GI___libc_realloc (oldmem=0x365e, bytes=2541024) at ./malloc/malloc.c:3420
#1  0x00007ffff7ad33b6 in read_aux (aux_buf=0x7fffe4000000, hdr=0x7ffff2515000, trace=0x365e5b0, err=0x886a4c8) at src/perf/collect.c:284
#2  0x00007ffff7ad3235 in handle_sample (aux_buf=0x7fffe4000000, hdr=0x7ffff2515000, trace=0x365e5b0, data_tmp=0x7fffe8000b70, err=0x886a4c8) at src/perf/collect.c:229
#3  0x00007ffff7ad2fdc in poll_loop (perf_fd=4, stop_fd=3, mmap_hdr=0x7ffff2515000, aux=0x7fffe4000000, trace=0x365e5b0, err=0x886a4c8) at src/perf/collect.c:352
#4  0x00007ffff7ad2cc0 in collector_thread (arg=0x7fffffffba98) at src/perf/collect.c:479
#5  0x00007ffff78a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#6  0x00007ffff79285fc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
(gdb) c
realloc(): invalid old size

Thread 7 "lua" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffee59d6c0 (LWP 1940563)]
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44      ./nptl/pthread_kill.c: No such file or directory.
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007ffff78a9d9f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007ffff785af32 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007ffff7845472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007ffff789e340 in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff79b8459 "%s\n") at ../sysdeps/posix/libc_fatal.c:155
#5  0x00007ffff78b36ba in malloc_printerr (str=str@entry=0x7ffff79b6176 "realloc(): invalid old size") at ./malloc/malloc.c:5660
#6  0x00007ffff78b735c in _int_realloc (av=av@entry=0x7ffff79f1c60 <main_arena>, oldp=oldp@entry=0x35bd1e0, oldsize=oldsize@entry=8, nb=nb@entry=20094864) at ./malloc/malloc.c:4827
#7  0x00007ffff78b811f in __GI___libc_realloc (oldmem=0x35bd1f0, bytes=20094848) at ./malloc/malloc.c:3489
#8  0x00007ffff7ad33b6 in read_aux (aux_buf=0x7fffe4000000, hdr=0x7ffff2515000, trace=0x7a306e0, err=0x9bbb98) at src/perf/collect.c:284
#9  0x00007ffff7ad3235 in handle_sample (aux_buf=0x7fffe4000000, hdr=0x7ffff2515000, trace=0x7a306e0, data_tmp=0x7fffe8000b70, err=0x9bbb98) at src/perf/collect.c:229
#10 0x00007ffff7ad2fdc in poll_loop (perf_fd=4, stop_fd=3, mmap_hdr=0x7ffff2515000, aux=0x7fffe4000000, trace=0x7a306e0, err=0x9bbb98) at src/perf/collect.c:352
#11 0x00007ffff7ad2cc0 in collector_thread (arg=0x7fffffffba98) at src/perf/collect.c:479
#12 0x00007ffff78a8044 in start_thread (arg=<optimized out>) at ./nptl/pthread_create.c:442
#13 0x00007ffff79285fc in clone3 () at ../sysdeps/unix/sysv/linux/x86_64/clone3.S:81