mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: "Milan P. Stanić" <mps@arvanta.net>
Cc: musl@lists.openwall.com
Subject: Re: [musl] [PATCH v2] MT fork
Date: Fri, 30 Oct 2020 14:57:17 -0400	[thread overview]
Message-ID: <20201030185716.GE534@brightrain.aerifal.cx> (raw)
In-Reply-To: <20201030185205.GA10849@arya.arvanta.net>

On Fri, Oct 30, 2020 at 07:52:05PM +0100, Milan P. Stanić wrote:
> On Fri, 2020-10-30 at 08:47, Milan P. Stanić wrote:
> > On Thu, 2020-10-29 at 19:27, Rich Felker wrote:
> > > On Fri, Oct 30, 2020 at 12:00:07AM +0100, Milan P. Stanić wrote:
> > > > On Thu, 2020-10-29 at 23:21, Szabolcs Nagy wrote:
> > > > > * Milan P. Stanić <mps@arvanta.net> [2020-10-29 21:55:41 +0100]:
> > > > > > On Thu, 2020-10-29 at 17:13, Szabolcs Nagy wrote:
> > > > > > > * Milan P. Stanić <mps@arvanta.net> [2020-10-29 00:06:10 +0100]:
> > > > > > > >  
> > > > > > > > Applied this patch on top of current musl master, build it on Alpine and
> > > > > > > > installed.
> > > > > > > > 
> > > > > > > > Tested by building ruby lang. Works fine.
> > > > > > > > Also tested building zig lang, works fine.
> > > > > > > > But crystal lang builds fine, but running it hangs. strace shows:
> > > > > > > > -------------
> > > > > > > > [pid  5573] futex(0x7efc50fba9e4, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
> > > > > > > > [pid  5568] futex(0x7efc5118f984, FUTEX_REQUEUE_PRIVATE, 0, 1, 0x7efc514b67a4) = 1
> > > > > > > > [pid  5568] futex(0x7efc514b67a4, FUTEX_WAKE_PRIVATE, 1) = 1
> > > > > > > > [pid  5571] <... futex resumed>)        = 0
> > > > > > > > [pid  5568] futex(0x7efc511099e4, FUTEX_WAIT_PRIVATE, 2, NULL <unfinished ...>
> > > > > > > > [pid  5571] futex(0x7efc510409e4, FUTEX_WAIT_PRIVATE, 2, NULL
> > > > > > > > -------------
> > > > > > > > where it hangs.
> > > > > > > 
> > > > > > > try to attach gdb to the process that hang and do
> > > > > > > 
> > > > > > > thread apply all bt
> > > > > > > 
> > > > > > > (make sure musl-dbg is installed)
> > > > > > 
> > > > > > I cannot attach gdb for running process because my Alpine development
> > > > > > boxes are lxc containers where CAP_SYS_PTRACE is not enabled afaik.
> > > > > 
> > > > > there should be a way to config lxc to allow ptrace.
> > > > > 
> > > > > > I installed musl-dbg and run program with 'gdb .build/crystal' and result is:
> > > > > > ----------
> > > > > > Reading symbols from .build/crystal...
> > > > > > (gdb) run
> > > > > > Starting program: /home/mps/aports/community/crystal/src/crystal-0.35.1/.build/crystal
> > > > > > 
> > > > > > Program received signal SIGSEGV, Segmentation fault.
> > > > > 
> > > > > hm segfault is not a hang..
> > > > > 
> > > > > libgc tries to find stack bounds by registering a segfault handler
> > > > > and walking stack pages until it triggers.
> > > > > 
> > > > > gdb stops at signals, this one is harmless, you should just continue
> > > > > until you see a hang, then interrupt and bt.
> > > >  
> > > > I did continue now and stopped it when it hangs. Attached is gdb log
> > > > produced by 'thread apply all bt'
> > > 
> > > Next time please don't gzip so it's readable and repliable. I've
> > > expanded it out here though:
> > > 
> > > > Starting program: /home/mps/aports/community/crystal/src/crystal-0.35.1/.build/crystal 
> > > > 
> > > > Program received signal SIGSEGV, Segmentation fault.
> > > > 0x00007ffff401c463 in GC_find_limit_with_bound () from /usr/lib/libgc.so.1
> > > > Continuing.
> > > > [New LWP 18867]
> > > > [New LWP 18868]
> > > > [New LWP 18869]
> > > > [New LWP 18870]
> > > > [New LWP 18871]
> > > > [New LWP 18872]
> > > > [New LWP 18873]
> > > > [New LWP 18874]
> > > > [New LWP 18875]
> > > > [New LWP 18876]
> > > > [New LWP 18877]
> > > > [New LWP 18878]
> > > > [New LWP 18879]
> > > > [New LWP 18880]
> > > > [New LWP 18881]
> > > > 
> > > > Thread 1 "crystal" received signal SIGINT, Interrupt.
> > > > __syscall_cp_c (nr=202, u=140737488349316, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > 61	./arch/x86_64/syscall_arch.h: No such file or directory.
> > > > 
> > > > Thread 16 (LWP 18881):
> > > > #0  __syscall_cp_c (nr=202, u=140737280690660, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff39f49e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff39f49e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3a04aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 15 (LWP 18880):
> > > > #0  __syscall_cp_c (nr=202, u=140737280965092, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3a379e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3a379e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3a47aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 14 (LWP 18879):
> > > > #0  __syscall_cp_c (nr=202, u=140737281239524, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3a7a9e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3a7a9e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3a8aaa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 13 (LWP 18878):
> > > > #0  __syscall_cp_c (nr=202, u=140737281513956, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3abd9e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3abd9e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3acdaa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 12 (LWP 18877):
> > > > #0  __syscall_cp_c (nr=202, u=140737281788388, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3b009e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3b009e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3b10aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 11 (LWP 18876):
> > > > #0  __syscall_cp_c (nr=202, u=140737282062820, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3b439e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3b439e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3b53aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 10 (LWP 18875):
> > > > #0  __syscall_cp_c (nr=202, u=140737282337252, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3b869e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3b869e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3b96aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 9 (LWP 18874):
> > > > #0  __syscall_cp_c (nr=202, u=140737282611684, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3bc99e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3bc99e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3bd9aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 8 (LWP 18873):
> > > > #0  __syscall_cp_c (nr=202, u=140737282886020, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3c0c984) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3c0c984, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40186ca in GC_mark_local () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40188f4 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #8  0x00007ffff7fb9df7 in start (p=0x7ffff3c1caa0) at src/thread/pthread_create.c:196
> > > > #9  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 7 (LWP 18872):
> > > > #0  __syscall_cp_c (nr=202, u=140737283160548, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3c4f9e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3c4f9e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3c5faa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 6 (LWP 18871):
> > > > #0  __syscall_cp_c (nr=202, u=140737283434980, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3c929e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3c929e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3ca2aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 5 (LWP 18870):
> > > > #0  __syscall_cp_c (nr=202, u=140737283709412, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3cd59e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3cd59e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3ce5aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 4 (LWP 18869):
> > > > #0  __syscall_cp_c (nr=202, u=140737283983844, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3d189e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3d189e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3d28aa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 3 (LWP 18868):
> > > > #0  __syscall_cp_c (nr=202, u=140737284258276, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3d5b9e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3d5b9e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3d6baa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 2 (LWP 18867):
> > > > #0  __syscall_cp_c (nr=202, u=140737284532708, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7ffff3d9e9e4) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7ffff3d9e9e4, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff40188b9 in GC_help_marker () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff40206db in GC_mark_thread () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff7fb9df7 in start (p=0x7ffff3daeaa0) at src/thread/pthread_create.c:196
> > > > #8  0x00007ffff7fbbf93 in __clone () at src/thread/x86_64/clone.s:22
> > > > Backtrace stopped: frame did not save the PC
> > > > 
> > > > Thread 1 (LWP 18859):
> > > > #0  __syscall_cp_c (nr=202, u=140737488349316, v=128, w=2, x=0, y=0, z=0) at ./arch/x86_64/syscall_arch.h:61
> > > > #1  0x00007ffff7fb8937 in __futex4_cp (to=0x0, val=2, op=128, addr=0x7fffffffe884) at src/thread/__timedwait.c:52
> > > > #2  __timedwait_cp (addr=addr@entry=0x7fffffffe884, val=val@entry=2, clk=clk@entry=0, at=at@entry=0x0, priv=128, priv@entry=1) at src/thread/__timedwait.c:52
> > > > #3  0x00007ffff7fb9740 in __pthread_cond_timedwait (c=0x7ffff403fba0, m=0x7ffff403f7a0, ts=0x0) at src/thread/pthread_cond_timedwait.c:100
> > > > #4  0x00007ffff40206fd in GC_wait_marker () from /usr/lib/libgc.so.1
> > > > #5  0x00007ffff4018852 in GC_do_parallel_mark () from /usr/lib/libgc.so.1
> > > > #6  0x00007ffff401937c in GC_mark_some () from /usr/lib/libgc.so.1
> > > > #7  0x00007ffff4010e5a in GC_stopped_mark () from /usr/lib/libgc.so.1
> > > > #8  0x00007ffff40114d4 in GC_try_to_collect_inner () from /usr/lib/libgc.so.1
> > > > #9  0x00007ffff401b47f in GC_init () from /usr/lib/libgc.so.1
> > > > #10 0x00005555555668d8 in init () at /home/mps/aports/community/crystal/src/crystal-0.35.1/src/gc/boehm.cr:127
> > > > #11 main () at /home/mps/aports/community/crystal/src/crystal-0.35.1/src/crystal/main.cr:35
> > > > #12 main () at /home/mps/aports/community/crystal/src/crystal-0.35.1/src/crystal/main.cr:114
> > > 
> > > OK, I'm looking at Boehm-GC's GC_wait_marker and this function is
> > > utterly bogus. It's using a condition variable without a predicate,
> > > and the corresponding broadcast operation runs without the lock held,
> > > so it's inherently subject both to spurious wakes and missed wakes.
> > > Here's the source:
> > > 
> > > https://github.com/ivmai/bdwgc/blob/57b97be07c514fcc4b608b13768fd2bf637a5899/pthread_support.c#L2374
> > > 
> > > This code is only used if built with PARALLEL_MARK defined, and
> > > obviously does not and cannot work, so I think the best solution is
> > > just figuring out how to turn off PARALLEL_MARK.
> > > 
> > > Do you have reason to believe the problem here has anything to do with
> > > the MT-fork patch? Was it maybe just hanging somewhere earlier without
> > > the patch, and now hanging on an independent bug?
> > 
> > It doesn't hangs with musl 1.2.1, but hangs on master branch with
> > mt-fork applied to it.
> > 
> > Also I tested with w3m browser and I see same behavior and same
> > (similar) backtrace.
> > 
> > Interesting thing is that it doesn't hangs on every invocations of
> > programs linked with libgc, sometimes programs work sometimes they
> > hangs.
> 
> Rebuilding 'gc' with '--disable-parallel-mark' fixes hangs.
> Not sure that is proper fix but for now it 'good' to not block next
> Alpine release.

There was a regression in musl too, I think. With
27b2fc9d6db956359727a66c262f1e69995660aa you should be able to
re-enable parallel mark. If you get a chance to test, let us know if
it works for you.

Rich

  reply	other threads:[~2020-10-30 18:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-26  0:50 [musl] Status report and " Rich Felker
2020-10-26  0:59 ` Rich Felker
2020-10-26  3:29   ` Rich Felker
2020-10-26 18:44     ` Érico Nogueira
2020-10-26 19:52       ` Rich Felker
2020-10-26 20:11         ` Érico Nogueira
2020-10-27 21:17   ` Rich Felker
2020-10-28 18:56     ` [musl] [PATCH v2] " Rich Felker
2020-10-28 23:06       ` Milan P. Stanić
2020-10-29 16:13         ` Szabolcs Nagy
2020-10-29 16:20           ` Rich Felker
2020-10-29 20:55           ` Milan P. Stanić
2020-10-29 22:21             ` Szabolcs Nagy
2020-10-29 23:00               ` Milan P. Stanić
2020-10-29 23:27                 ` Rich Felker
2020-10-30  0:13                   ` Rich Felker
2020-10-30  7:47                   ` Milan P. Stanić
2020-10-30 18:52                     ` Milan P. Stanić
2020-10-30 18:57                       ` Rich Felker [this message]
2020-10-30 21:31                         ` Ariadne Conill
2020-10-31  3:31                           ` Rich Felker
2020-11-06  3:36                             ` Rich Felker
2020-11-08 16:12                               ` Szabolcs Nagy
2020-11-09 17:07                                 ` Rich Felker
2020-11-09 18:01                                   ` Érico Nogueira
2020-11-09 18:44                                     ` Rich Felker
2020-11-09 18:54                                       ` Érico Nogueira
2020-11-09 21:59                                   ` Szabolcs Nagy
2020-11-09 22:23                                     ` Rich Felker
2020-11-11  0:52                                       ` Rich Felker
2020-11-11  6:35                                         ` Alexey Izbyshev
2020-11-11 11:25                                           ` Szabolcs Nagy
2020-11-11 14:56                                             ` Rich Felker
2020-11-11 16:35                                         ` Rich Felker
2020-10-31  7:22                           ` Timo Teras
2020-10-31 13:29                             ` Szabolcs Nagy
2020-10-31 13:35                               ` Timo Teras
2020-10-31 14:41                                 ` Ariadne Conill
2020-10-31 14:49                                   ` Rich Felker
2020-10-31 14:48                                 ` Rich Felker
2020-10-31 14:47                             ` Rich Felker
2020-10-29 23:32                 ` Szabolcs Nagy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201030185716.GE534@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=mps@arvanta.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).