Closed miko closed 11 years ago
Yeah, somebody else reported segfaults on arch too. I'm grabbing a copy of arch now - it's related to the std file pipes which are cleaned up by the GC during exit. I'm working on it now.
I removed zmq to see what would happen, and got a slightly different stack trace, which looks more like what's really going on:
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff6819f5b in pthread_join () from /usr/lib/libpthread.so.0 (gdb) bt
Looks like ArchLinux ships with the very latest glibc, which AFAICT has had some hacking going into the elf dlopen and dlclose code from the Red Hat, along with lots of NPTL (Native POSIX Thread Library) changes. So I think something in the pthreads code in glibc is pushing a cleanup handler into _dl_close which does pthread_join() and that's broken. It's simply the main thread exiting, with no child threads having been created (just pthread being linked to, that's all). I've grabbed the glibc-2.16 sources tried groking the code in there, and it's too hairy for me to get into in a short time :(
So I give up. Luv is broken on ArchLinux (and probably any other system with glibc-2.16).
On Oct 9, 2012, at 9:45 AM, miko wrote:
$ gdb which lua (gdb) run ../examples/timer.lua Starting program: /usr/bin/lua ../examples/timer.lua ENTER tick: 1 0 ... tick: 10 0
Program received signal SIGSEGV, Segmentation fault. 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0 (gdb) bt
0 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0
1 0xb7c8f462 in cleanup () from ./luv.so
2 0xb7fed62c in _dl_fini () from /lib/ld-linux.so.2
3 0xb7d31601 in __run_exit_handlers () from /usr/lib/libc.so.6
4 0xb7d3168d in exit () from /usr/lib/libc.so.6
5 0xb7d1960d in __libc_start_main () from /usr/lib/libc.so.6
6 0x0804ad15 in _start ()
(gdb) run ../examples/stdfh.lua Starting program: /usr/bin/lua ../examples/stdfh.lua Hello World!hello thanks, you said:6 Program received signal SIGSEGV, Segmentation fault. 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0 (gdb) bt
0 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0
1 0xb7c8f462 in cleanup () from ./luv.so
2 0xb7fed62c in _dl_fini () from /lib/ld-linux.so.2
3 0xb7d31601 in __run_exit_handlers () from /usr/lib/libc.so.6
4 0xb7d3168d in exit () from /usr/lib/libc.so.6
5 0xb7d1960d in __libc_start_main () from /usr/lib/libc.so.6
6 0x0804ad15 in _start ()
Using archlinux 32-bit, gcc 2.16.0, lua 5.1.5 (the same for luajit2 2.0.0-beta10) It happens on program termination, so all the work is done, but still annoying.
— Reply to this email directly or view it on GitHub.
confirmed on my setup. but i believe this bug may belong to lua/luajit per se. what would be the native coroutine code for this timer example? would it work on our glibc 2.16 setup?
This is my test:
local luv = require("luv")
That's it. Just require and exit. It segfaults every time on ArchLinux. Lua/LuaJIT don't even link to pthread, and something is definitely calling pthread_join()
face palm there's a commit to libuv from yesterday which fixes the segfault
try git HEAD now :)
Indeed, works for me on archlinux without segfaluts now. Thanks
fix confirmed
$ gdb
which lua
(gdb) run ../examples/timer.lua Starting program: /usr/bin/lua ../examples/timer.lua ENTER tick: 1 0 ... tick: 10 0Program received signal SIGSEGV, Segmentation fault. 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0 (gdb) bt
0 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0
1 0xb7c8f462 in cleanup () from ./luv.so
2 0xb7fed62c in _dl_fini () from /lib/ld-linux.so.2
3 0xb7d31601 in __run_exit_handlers () from /usr/lib/libc.so.6
4 0xb7d3168d in exit () from /usr/lib/libc.so.6
5 0xb7d1960d in __libc_start_main () from /usr/lib/libc.so.6
6 0x0804ad15 in _start ()
(gdb) run ../examples/stdfh.lua Starting program: /usr/bin/lua ../examples/stdfh.lua Hello World!hello thanks, you said:6 Program received signal SIGSEGV, Segmentation fault. 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0 (gdb) bt
0 0xb7c4dd1e in pthread_join () from /usr/lib/libpthread.so.0
1 0xb7c8f462 in cleanup () from ./luv.so
2 0xb7fed62c in _dl_fini () from /lib/ld-linux.so.2
3 0xb7d31601 in __run_exit_handlers () from /usr/lib/libc.so.6
4 0xb7d3168d in exit () from /usr/lib/libc.so.6
5 0xb7d1960d in __libc_start_main () from /usr/lib/libc.so.6
6 0x0804ad15 in _start ()
Using archlinux 32-bit, gcc 2.16.0, lua 5.1.5 (the same for luajit2 2.0.0-beta10) It happens on program termination, so all the work is done, but still annoying.