GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands by stratakis · Pull Request #156424 · python/cpython

Conversation

@stratakis

@stratakis stratakis commented Aug 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Prefix commands passed to stap -c with LD_LIBRARY_PATH via env, when probes reside in libpython. This allows the interpreter to find libpython when staprun does not preserve the loader path.

  • Issue: test_dtrace fails on aarch64 Fedora Stable 3.15: "libpython3.15d.so.1.0: cannot open shared object file" #156703

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@bedevere-app bedevere-app Bot added the tests Tests in the Lib/test dir label Aug 26, 2026
@bedevere-app bedevere-app Bot mentioned this pull request Aug 26, 2026
Some DTrace probes are broken in 3.11 #98894
Open
@bedevere-app bedevere-app Bot added the awaiting review label Aug 26, 2026
@stratakis

stratakis commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

cc @encukou this should be fixing the buildbots dtrace issues, however if you can add the label to test with buildbots.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stratakis stratakis mentioned this pull request Aug 26, 2026
Add dtrace worker tag support python/buildmaster-config#754
Merged
@stratakis

stratakis commented Aug 26, 2026

Copy link
Copy Markdown
Contributor Author

If that works, it also requires the backport to 3.15 label.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@StanFromIreland StanFromIreland added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Aug 26, 2026
@bedevere-bot

bedevere-bot commented Aug 26, 2026

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @StanFromIreland for commit 96277bb 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F156424%2Fmerge

If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Aug 26, 2026
@encukou

encukou commented Aug 27, 2026

Copy link
Copy Markdown
Member

Unfortunately PPC64LE still fails:

dtrace(1) failed: /usr/bin/dtrace invalid option -q
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@hugovk hugovk mentioned this pull request Aug 31, 2026
Remove dtrace tag from failing CentOS9 and Fedora workers python/buildmaster-config#782
Merged
@encukou encukou added the skip news label Aug 31, 2026
@encukou

encukou commented Aug 31, 2026

Copy link
Copy Markdown
Member

Is there a reason to go through /usr/bin/env, rather than give the environment directly to subprocess.Popen (i.e. create_process_group)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@encukou encukou added the needs backport to 3.15 bugs and security fixes label Aug 31, 2026
@vstinner

vstinner commented Aug 31, 2026

Copy link
Copy Markdown
Member

Is this change a fix for #156703 issue?

I see multiple failures on PPC64LE buildbots. Example on "buildbot/PPC64LE Fedora Stable PR":

Warning -- test_dtrace leaked temporary files (4): GMfifo3365795, GMfifo3366470, stapjjRj5t, stapt2e6lv

Oh, that's issue #156701.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stratakis

stratakis commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Unfortunately PPC64LE still fails:

dtrace(1) failed: /usr/bin/dtrace invalid option -q

Us that a failure? That is expected as the dtrace path is not exercised on Linux, Systemtap doesn't have the -q option.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner mentioned this pull request Aug 31, 2026
test_dtrace fails on aarch64 Fedora Stable 3.15: "libpython3.15d.so.1.0: cannot open shared object file" #156703
Closed
@stratakis

stratakis commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Is there a reason to go through /usr/bin/env, rather than give the environment directly to subprocess.Popen (i.e. create_process_group)?

staprun removes LD_LIBRARY_PATH before starting Python so passing it to Popen is not enough, it must be added to the command that starts Python.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stratakis
pythongh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands
ee07f6f
Prefix commands passed to stap -c with LD_LIBRARY_PATH via env, when
probes reside in libpython. This allows the interpreter to find
libpython when staprun does not preserve the loader path.
@stratakis
stratakis force-pushed the shared_issue_oot branch from 96277bb to ee07f6f Compare August 31, 2026 13:21
@stratakis

stratakis commented Aug 31, 2026

Copy link
Copy Markdown
Contributor Author

Rebased to change the commit message to reference the proper issue, no code changes.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stratakis stratakis changed the title gh-98894: Set LD_LIBRARY_PATH in SystemTap trace commands gh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands Aug 31, 2026
@encukou
encukou merged commit faf4e52 into python:main Sep 1, 2026
48 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

Thanks @stratakis for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the awaiting review label Sep 1, 2026
@bedevere-app

bedevere-app Bot commented Sep 1, 2026

Copy link
Copy Markdown

GH-156755 is a backport of this pull request to the 3.15 branch.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 bugs and security fixes label Sep 1, 2026
@encukou

encukou commented Sep 1, 2026

Copy link
Copy Markdown
Member

Thank you! Let's get it in to fix aarch!

Is that a failure?

No, sorry; pasted a wrong part of the log.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@stratakis
stratakis deleted the shared_issue_oot branch September 3, 2026 23:05
clin1234 pushed a commit to clin1234/cpython that referenced this pull request Sep 12, 2026
@stratakis @clin1234
pythongh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands (pyt…
6440f1c
…honGH-156424)

Prefix commands passed to stap -c with LD_LIBRARY_PATH via env, when
probes reside in libpython. This allows the interpreter to find
libpython when staprun does not preserve the loader path.
@vstinner vstinner added needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Sep 23, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 23, 2026

Copy link
Copy Markdown

Thanks @stratakis for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Sep 23, 2026

Copy link
Copy Markdown

Thanks @stratakis for the PR, and @encukou for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14.
🐍🍒⛏🤖

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app

miss-islington-app Bot commented Sep 23, 2026

Copy link
Copy Markdown

Sorry, @stratakis and @encukou, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker faf4e524356634ac95d9de3f7f115603f7440a9b 3.13
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@miss-islington-app miss-islington-app Bot assigned encukou Sep 23, 2026
@miss-islington-app

miss-islington-app Bot commented Sep 23, 2026

Copy link
Copy Markdown

Sorry, @stratakis and @encukou, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker faf4e524356634ac95d9de3f7f115603f7440a9b 3.14
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vstinner vstinner removed needs backport to 3.13 only security fixes needs backport to 3.14 bugs and security fixes labels Sep 23, 2026
@vstinner

vstinner commented Sep 23, 2026

Copy link
Copy Markdown
Member

Hum. test_dtrace changes were not backported properly to 3.13 and 3.14 branches. The fact that the 3.15 branch is blocked for the 3.15.0 final release doesn't help. After 3.15.0 final release, I will go through all test_dtrace changes are backport them properly to all stable branches.

encukou reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

encukou pushed a commit that referenced this pull request Oct 12, 2026
@miss-islington @stratakis
[3.15] gh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands (GH…
2befd17
…-156424) (GH-156755)

Prefix commands passed to stap -c with LD_LIBRARY_PATH via env, when
probes reside in libpython. This allows the interpreter to find
libpython when staprun does not preserve the loader path.
(cherry picked from commit faf4e52)

Co-authored-by: stratakis <[email protected]>
vstinner added a commit that referenced this pull request Oct 16, 2026
@vstinner @stratakis
[3.14] gh-156701: Backport test_dtrace from main (#159596)
566f815
* gh-98894: Fix DTrace test_check_probes for shared builds (#151122)

When building with --enable-shared, the SystemTap/DTrace notes
live in libpython. Add detection logic to be used by readelf.

Force the C locale on readelf output.

(cherry picked from commit 3a08e93)

* gh-151496: Use process groups in test_dtrace (#151512)

Create a new process group to run bpftrace commands, so it's possible
to kill also child processes on timeout.

(cherry picked from commit a064b32)

* gh-151496: Use process groups in TraceBackend in test_dtrace (#152039)

Run the generic DTrace/SystemTap commands in a new process group and
terminate the whole group on timeout.

This prevents a forked tracer child from keeping stdout/stderr pipes
open after the direct tracer process is killed.

(cherry picked from commit 1785f4b)

* gh-98894: Check readelf failures in test_dtrace (#152345)

Report readelf command failures directly instead of later failing with
missing-probe assertions.

(cherry picked from commit d60a677)

* gh-98894: Check tracer exit status in test_dtrace (#152893)

Fail functional dtrace and SystemTap cases directly when the tracer exits
non-zero.

(cherry picked from commit 311e7e7)

* gh-98894: Quote test_dtrace tracer subcommands (#152901)

Use shlex.join() when building tracer -c command strings
for avoiding issues with spaces.

(cherry picked from commit a159c68)

* gh-98894: Fix dtrace tests in shared builds (#153372)

Generate SystemTap probe definitions targeting libpython for shared
builds and use centralized USDT probe object discovery for readelf
and BPFTrace.

(cherry picked from commit 298bef3)

* gh-156703: Set LD_LIBRARY_PATH in SystemTap trace commands (GH-156424)

Prefix commands passed to stap -c with LD_LIBRARY_PATH via env, when
probes reside in libpython. This allows the interpreter to find
libpython when staprun does not preserve the loader path.

(cherry picked from commit faf4e52)

* gh-156722, test_dtrace: Terminate tracing processes gracefully on timeout (#156753)

Send SIGTERM to the tracing process group before falling back to SIGKILL.

(cherry picked from commit 55ecc0a)

* gh-156701: Increase the SystemTap usability timeout (#156720)

SystemTap may compile a kernel module during its usability check
(if no cached module is available). We need to allow a larger timeout
for that case.

(cherry picked from commit e1be613)

---------

Co-authored-by: stratakis <[email protected]>
Co-authored-by: stratakis <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@encukou encukou

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@stratakis @bedevere-bot @encukou @vstinner @StanFromIreland
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.