From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6E3913858CDA; Fri, 24 Mar 2023 23:39:53 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6E3913858CDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1679701193; bh=OeCLgF7AsYnIwUtw9w7LMPKCA/7Olm7DNHR/YiO1Q/0=; h=From:To:Subject:Date:From; b=P16NF4ckZv56z5R5ezzekve3vSxQVv3+DdT51nZn3MSlvSNZ3TS1UOE5v+FKCgij7 TtSZhKA7BkihNc8dB/a5d5oJArRyLT8ErfOla33S+mozNOxc45cvJgGj+0qMdc+Nmj wamgdcIxPitAJsAFYrUHCIblaxmwsqkenoP7hm0M= From: "godlygeek at gmail dot com" To: elfutils-devel@sourceware.org Subject: [Bug libdw/30272] New: Unwinding multithreaded musl applications fails Date: Fri, 24 Mar 2023 23:39:52 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: elfutils X-Bugzilla-Component: libdw X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: godlygeek at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter cc target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30272 Bug ID: 30272 Summary: Unwinding multithreaded musl applications fails Product: elfutils Version: unspecified Status: UNCONFIRMED Severity: normal Priority: P2 Component: libdw Assignee: unassigned at sourceware dot org Reporter: godlygeek at gmail dot com CC: elfutils-devel at sourceware dot org Target Milestone: --- Unwinding multithreaded applications linked against musl libc on x86-64 see= ms to fail, getting stuck on `__clone`: TID 241: ... #20 0x00007f6f2f74f08b start #21 0x00007f6f2f75138e __clone #22 0x00007f6f2f75138e __clone #23 0x00007f6f2f75138e __clone ... #253 0x00007f6f2f75138e __clone #254 0x00007f6f2f75138e __clone #255 0x00007f6f2f75138e __clone eu-stack: tid 241: shown max number of frames (256, use -n 0 for unlimited) GDB seems to detect the condition that libdw is getting stuck on, emitting a warning message: #44 0x00007f8f83e4d08b in start (p=3D0x7f8f836b8b00) at src/thread/pthread_create.c:203 #45 0x00007f8f83e4f38e in __clone () at src/thread/x86_64/clone.s:22 Backtrace stopped: frame did not save the PC I believe it's detecting that two frames in a row have the same DWARF CFA, = if I understand correctly. Reproducer: docker run -it --privileged python:3.10-alpine sh And in the container: apk add --update musl-dbg elfutils python3.10 -c "import os, threading; threading.Thread(target=3Dlambda: os.system(f'eu-stack --pid=3D{os.getpid()}')).start()" That spawns a thread that forks a subprocess that runs `eu-stack` on its parent, and reproduces the issue. If you remove the thread and just run: python3.10 -c "import os; os.system(f'eu-stack --pid=3D{os.getpid()}')" then unwinding succeeds, ending at `_start`. --=20 You are receiving this mail because: You are on the CC list for the bug.=