From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4482E3858C60; Mon, 29 Jan 2024 15:36:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4482E3858C60 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1706542585; bh=GMl0W6cYdkKhPfs1sz8hCaQVJr6rmzaMxLaYcsgq25Q=; h=From:To:Subject:Date:From; b=bAdtgBbvaKyKneGlPi/ASOvihk+qFyLRJAnMl6pYI333hVtL++Eqt3DnDPysp9qnO aiMtSNv0ay2dauxnYX8L1TkmsvlWIG+FpNX38/AEjX7+nIBIK98r41QlQVHUZyDEDE Rnmxpud8n8uKQclKOA0WxbUnks9qCL4wPi8V6lWw= From: "wcohen at redhat dot com" To: systemtap@sourceware.org Subject: [Bug runtime/31309] New: Recent PIE binary support cause fileline-profile.stp example to crash the machine Date: Mon, 29 Jan 2024 15:36:23 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: runtime X-Bugzilla-Version: unspecified X-Bugzilla-Keywords: X-Bugzilla-Severity: critical X-Bugzilla-Who: wcohen at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap 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 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=3D31309 Bug ID: 31309 Summary: Recent PIE binary support cause fileline-profile.stp example to crash the machine Product: systemtap Version: unspecified Status: NEW Severity: critical Priority: P2 Component: runtime Assignee: systemtap at sourceware dot org Reporter: wcohen at redhat dot com Target Milestone: --- When running the testsuite on recent git checkout systemtap the machine wou= ld reboot when running fileline-profile.stp. Have observed this on x86_64 and aarch64 machines. This appears to be caused by: commit d1ea490253710dc4d59e86ce5ba8ac7d3e7c537c=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 Author: Martin Cermak =20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20 Date: Thu Jan 25 11:46:50 2024 +0100=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 PR26843: print_ubacktrace_fileline() fails with PIE binaries=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20 Ubuntu has it's GCC configured with --enable-default-pie. The=20=20=20= =20=20=20=20=20=20=20=20=20=20=20 binaries it's producing by default are DYN (Position-Independent=20=20= =20=20=20=20=20=20=20=20=20=20 Executable file). This isn't reflected in the producer record.=20=20= =20=20=20=20=20=20=20=20=20=20=20 For processing PIE binaries, additional relocation is needed in=20=20= =20=20=20=20=20=20=20=20=20=20=20 the stap runtime.=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 This can be replicated with the following steps which the machine freezes a= nd then reboots after the staprun: $ ../install/bin/stap -mx -v -p4 testsuite/systemtap.examples/profiling/fileline-profile.stp -T 6 --ldd Pass 1: parsed user script and 533 library scripts using 540208virt/295592res/15488shr/279424data kb, in 570usr/90sys/817real ms. Pass 2: analyzed script: 3 probes, 11 functions, 0 embeds, 3 globals using 553144virt/309544res/16512shr/292360data kb, in 50usr/0sys/62real ms. Pass 3: translated to C into "/tmp/stapcBMDYH/x_src.c" using 554352virt/311592res/17408shr/293568data kb, in 30usr/290sys/877real ms. x.ko Pass 4: compiled C into "x.ko" in 22480usr/2500sys/25327real ms. $ sudo ../install/bin/staprun x.ko -T 6 When commit d1ea49025 is removed the test runs successfully. Remove patch $ git show d1ea490253710dc4d59e86ce5ba8ac7d3e7c537c > x.patch $ patch -R -p1 < x.patch=20 patching file runtime/sym.c $ make $ sudo make install ... $ ../install/bin/stap --disable-cache -my -v -p4 testsuite/systemtap.examples/profiling/fileline-profile.stp -T 6 --ldd Pass 1: parsed user script and 533 library scripts using 540208virt/295724res/15616shr/279424data kb, in 540usr/70sys/609real ms. Pass 2: analyzed script: 3 probes, 11 functions, 0 embeds, 3 globals using 553144virt/309676res/16640shr/292360data kb, in 50usr/10sys/62real ms. Pass 3: translated to C into "/tmp/stapLlS876/y_src.c" using 554352virt/311724res/17536shr/293568data kb, in 10usr/60sys/74real ms. y.ko Pass 4: compiled C into "y.ko" in 20800usr/2340sys/23371real ms. $ sudo ../install/bin/staprun y.ko -T 6 --- 6000 samples recorded: k:0xffffffffb8fe14bf 5909 k:0xffffffffb81583da 24 k:0xffffffffc09d8ffb [y+0x6ffb/0x0] 6 k:0xffffffffc09d416f [y+0x216f/0x0] 5 k:0xffffffffc09d3944 [y+0x1944/0x0] 4 k:0xffffffffb8fe3730 4 k:0xffffffffc09d9009 [y+0x7009/0x0] 3 k:0xffffffffc09d416c [y+0x216c/0x0] 2 k:0xffffffffb8ff9595 2 k:0xffffffffc09d8ffe [y+0x6ffe/0x0] 2 k:0xffffffffb8207554 2 k:0xffffffffb8ff8e4d 2 k:0xffffffffb8189390 1 k:0xffffffffb84b9324 1 u:0x7f3626302161 [/usr/lib64/libc.so.6+0x108161/0x1da000] 1 k:0xffffffffb8ff1af0 1 k:0xffffffffc09d4a73 [y+0x2a73/0x0] 1 k:0xffffffffb8fdb46b 1 k:0xffffffffb8fd17eb 1 k:0xffffffffb84971e3 1 --=20 You are receiving this mail because: You are the assignee for the bug.=