From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.3 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,WEIRD_PORT autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 10982 invoked from network); 30 Oct 2020 00:13:30 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 30 Oct 2020 00:13:30 -0000 Received: (qmail 17489 invoked by uid 550); 30 Oct 2020 00:13:25 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 17471 invoked from network); 30 Oct 2020 00:13:24 -0000 Date: Thu, 29 Oct 2020 20:13:12 -0400 From: Rich Felker To: Milan =?utf-8?Q?P=2E_Stani=C4=87?= Cc: musl@lists.openwall.com Message-ID: <20201030001312.GW534@brightrain.aerifal.cx> References: <20201026005028.GI534@brightrain.aerifal.cx> <20201026005912.GJ534@brightrain.aerifal.cx> <20201027211735.GV534@brightrain.aerifal.cx> <20201028185608.GG534@brightrain.aerifal.cx> <20201028230610.GA3269@arya.arvanta.net> <20201029161348.GA2947641@port70.net> <20201029205541.GA13778@arya.arvanta.net> <20201029222153.GB2947641@port70.net> <20201029230007.GA23855@arya.arvanta.net> <20201029232744.GV534@brightrain.aerifal.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201029232744.GV534@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] [PATCH v2] MT fork On Thu, Oct 29, 2020 at 07:27:44PM -0400, 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ć [2020-10-29 21:55:41 +0100]: > > > > On Thu, 2020-10-29 at 17:13, Szabolcs Nagy wrote: > > > > > * Milan P. Stanić [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 > > > > > > [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 > > > > > > [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? Hmm, I'm not 100% sure anymore the above is correct. The caller of GC_wait_marker, in: https://github.com/ivmai/bdwgc/blob/57b97be07c514fcc4b608b13768fd2bf637a5899/mark.c#L1130 is calling it in a loop checking a condition. and can call GC_notify_all_marker (the broadcast function) with the lock held. There's another place where GC_notify_all_marker is called without the lock held, but I don't see any problem there. This definitely calls for more debugging, but turning off PARALLEL_MARK might solve the problem for now. I do still want to know if this has anything to do with fork; it sounds like not (or gdb would have needed to be setup to follow fork). Rich