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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 6592 invoked from network); 29 Oct 2020 23:33:07 -0000 Received: from mother.openwall.net (195.42.179.200) by inbox.vuxu.org with ESMTPUTF8; 29 Oct 2020 23:33:07 -0000 Received: (qmail 32429 invoked by uid 550); 29 Oct 2020 23:33:04 -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 32406 invoked from network); 29 Oct 2020 23:33:04 -0000 Date: Fri, 30 Oct 2020 00:32:52 +0100 From: Szabolcs Nagy To: Milan =?utf-8?Q?P=2E_Stani=C4=87?= Cc: musl@lists.openwall.com Message-ID: <20201029233252.GC2947641@port70.net> Mail-Followup-To: Milan =?utf-8?Q?P=2E_Stani=C4=87?= , musl@lists.openwall.com 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> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: <20201029230007.GA23855@arya.arvanta.net> Subject: Re: [musl] [PATCH v2] MT fork * Milan P. Stani=C4=87 [2020-10-30 00:00:07 +0100]: > On Thu, 2020-10-29 at 23:21, Szabolcs Nagy wrote: > > * Milan P. Stani=C4=87 [2020-10-29 21:55:41 +0100]: > > > On Thu, 2020-10-29 at 17:13, Szabolcs Nagy wrote: > > > > * Milan P. Stani=C4=87 [2020-10-29 00:06:10 +0100= ]: > > > > > =20 > > > > > Applied this patch on top of current musl master, build it on Alp= ine and > > > > > installed. > > > > >=20 > > > > > 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, 0x= 7efc514b67a4) =3D 1 > > > > > [pid 5568] futex(0x7efc514b67a4, FUTEX_WAKE_PRIVATE, 1) =3D 1 > > > > > [pid 5571] <... futex resumed>) =3D 0 > > > > > [pid 5568] futex(0x7efc511099e4, FUTEX_WAIT_PRIVATE, 2, NULL > > > > > [pid 5571] futex(0x7efc510409e4, FUTEX_WAIT_PRIVATE, 2, NULL > > > > > ------------- > > > > > where it hangs. > > > >=20 > > > > try to attach gdb to the process that hang and do > > > >=20 > > > > thread apply all bt =2E.. > I did continue now and stopped it when it hangs. Attached is gdb log > produced by 'thread apply all bt' unfortunately it's hard to tell what's going on. all threads wait on the same cond var in libgc. but it does not look like a fork issue to me. to get further i think we would need to look at the libgc logic, to see how it uses those cond vars. all 16 threads look like #0 __syscall_cp_c (nr=3D202, u=3D140737284532708, v=3D128, w=3D2, x=3D0, y= =3D0, z=3D0) at ./arch/x86_64/syscall_arch.h:61 #1 0x00007ffff7fb8937 in __futex4_cp (to=3D0x0, val=3D2, op=3D128, addr=3D= 0x7ffff3d9e9e4) at src/thread/__timedwait.c:52 #2 __timedwait_cp (addr=3Daddr@entry=3D0x7ffff3d9e9e4, val=3Dval@entry=3D2= , clk=3Dclk@entry=3D0, at=3Dat@entry=3D0x0, priv=3D128, priv@entry=3D1) at = src/thread/__timedwait.c:52 #3 0x00007ffff7fb9740 in __pthread_cond_timedwait (c=3D0x7ffff403fba0, m= =3D0x7ffff403f7a0, ts=3D0x0) 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 =2E.. except the main thread is like #0 __syscall_cp_c (nr=3D202, u=3D140737488349316, v=3D128, w=3D2, x=3D0, y= =3D0, z=3D0) at ./arch/x86_64/syscall_arch.h:61 #1 0x00007ffff7fb8937 in __futex4_cp (to=3D0x0, val=3D2, op=3D128, addr=3D= 0x7fffffffe884) at src/thread/__timedwait.c:52 #2 __timedwait_cp (addr=3Daddr@entry=3D0x7fffffffe884, val=3Dval@entry=3D2= , clk=3Dclk@entry=3D0, at=3Dat@entry=3D0x0, priv=3D128, priv@entry=3D1) at = src/thread/__timedwait.c:52 #3 0x00007ffff7fb9740 in __pthread_cond_timedwait (c=3D0x7ffff403fba0, m= =3D0x7ffff403f7a0, ts=3D0x0) 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 =2E..