From nobody Tue Dec 09 03:58:26 2025 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dQQ7Q4s5wz6JtkH for ; Tue, 09 Dec 2025 03:58:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dQQ7Q4BBsz3tVY for ; Tue, 09 Dec 2025 03:58:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765252706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NH2lAczMeaqTO7wXzlyedEH/BYf6OM+yfS/L9i6yCDM=; b=sFu3NooTpaue1+QA41MVqxyX3xKVAudQnVK+0sl3e23xKjhc4ok5GPTsj5EIShxsHVo98J PRiCdCWZChsCapxv7imFqkmM5kl69t7mvcTlDp9y1g7KQLEVUFmkArydgp5bEm/KTVwwI6 l7CxqKLxjjnNx2ec9Xaqa+Xd7Rpy4pMtLmQUpQZ7njmX7hhmXvm0V0rzRfps26c2FkOwxL oVMIlr1ueguCuiNXAWcSAxvGrA2EsoTfykhrWDtMEJ9/sI1vs3e3YdMErUPI22Cqb4Fr22 F4sUXZhplBTPOX5fN63upiRNkmpn3BLTwDq7QbeYagHuCzoQQQNlw/noCR+zsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1765252706; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=NH2lAczMeaqTO7wXzlyedEH/BYf6OM+yfS/L9i6yCDM=; b=bfHaaaDZoYYvhQG8roXhnVaqDPhadwSq5SRJZzB0C5zr1h0cUBENP2bEvU5l9ArsuetkIe MqhkebSwtUbBbHClkgiz68s/D+39lK/ao/OAPrfigD+pQpeVtr3ijXxXsomchhTYohdc6j gwCnQsN0VOX1JzepsDW/yTaKcvZM3tDM4lKa9g35RExAgvaCB4CPPafakI1FrnNsMA4Mcb 9rQynpULelUldU+6glBJSfF5D8aVikfaL7l1fmjszPTc0SUm6J3XN0E69hH0iVQJHJccTB UwYbjSnqkahS2xbdxMr8HagelOgcfKDDMSljPjaeuE2GZzhIwpybqjntLfd4qg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1765252706; a=rsa-sha256; cv=none; b=cyftlUNFIVDL7+5D7W+nMhUEorKHq0pU6ZWQgfYd/TRaqekeqjkMUoq4BB2N3nr1XBXhfQ EiA87NstAbJtHq+9+SbxQnxnMPx1AgYw0cbjVWSP0kbLNOOPEsJtt5FtFmNoplebfQP6hY RJJ3DMd2KpZ8hRTw4q8NH5EGWkixKgQisePSh93oeyygwpkdje2xG6QLwcgbQasUPYMAzy 9o4M4hA1eo9qvWes3Jc/fM3PT9w6vK1SQ9jwRTtBfUOuuzLqMrTozmzsdTWSuWsm+zilQN nPmnMVPb5Eve+5LTlnLXRSpc4cDLmK9WKIduSNh7vOIAkPXcXM9qdx5hOd1OLQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4dQQ7Q3fM0zjNm for ; Tue, 09 Dec 2025 03:58:26 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 5B93wQ9X001854 for ; Tue, 9 Dec 2025 03:58:26 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 5B93wQch001853 for bugs@FreeBSD.org; Tue, 9 Dec 2025 03:58:26 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 291504] ptrace(2) doesn't trace Linux system calls made from pthreads in Linux processes, and unreliably traces Linux clone3 sub-processes Date: Tue, 09 Dec 2025 03:58:26 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: yuri@freebsd.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D291504 Bug ID: 291504 Summary: ptrace(2) doesn't trace Linux system calls made from pthreads in Linux processes, and unreliably traces Linux clone3 sub-processes Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: yuri@freebsd.org Created attachment 266020 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D266020&action= =3Dedit testcase.tgz See the attached testcase. prog.c (the Linux process) creates 1 pthread and 1 clone3 child. It calls the 'openat' function: 1. 5 times from the main thread 2. 5 times from the pthread 3. 5 times from the clone3 sub-process The ptrace log contains: 1. 5 instances of the openat from the main thread (as expected) 2. 0 instances of the openat from the pthread (problem#1: 5 are expected) 3. <5 instances of the openat from the clone3 sub-process (problem#2: 5 are expected) The testcase assumes that the 'chroot-linux' script is the the path. Otherw= ise you need to build prog manually for Linux. In my case the log (in the tarball) has these ptrace log lines showing 5+0+2 openat calls with /bogus/ path (should have been 5+5+5): > PTRACE: [#1] Detected openat syscall (entry) - pathname=3D'/etc/ld.so.cac= he' > PTRACE: [#1] openat syscall exit - returned 4 > PTRACE: [#2] Detected openat syscall (entry) - pathname=3D'/lib64/libc.so= .6' > PTRACE: [#2] openat syscall exit - returned 4 > PTRACE: [#3] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-m= ain' > PTRACE: [#3] openat syscall exit - returned -2 > PTRACE: [#4] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-m= ain' > PTRACE: [#4] openat syscall exit - returned -2 > PTRACE: [#5] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-m= ain' > PTRACE: [#5] openat syscall exit - returned -2 > PTRACE: [#6] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-m= ain' > PTRACE: [#6] openat syscall exit - returned -2 > PTRACE: [#7] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-m= ain' > PTRACE: [#7] openat syscall exit - returned -2 > PTRACE: [#8] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-c= lone3' > PTRACE: [#8] openat syscall exit - returned -2 > PTRACE: [#9] Detected openat syscall (entry) - pathname=3D'/bogus/bogus-c= lone3' > PTRACE: [#9] openat syscall exit - returned 0 > PTRACE: [#10] Detected openat syscall (entry) - pathname=3D'/dev/random' > PTRACE: [#10] openat syscall exit - returned 4 > PTRACE: PID 22119 exited with status 0 --=20 You are receiving this mail because: You are the assignee for the bug.=