Skip to content

gh-135361: update documentation for remote_debugger_script audit event #135362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 15, 2025

Conversation

Zheaoli
Copy link
Contributor

@Zheaoli Zheaoli commented Jun 10, 2025

…t event

Signed-off-by: Manjusaka <me@manjusaka.me>
vstinner
vstinner previously approved these changes Jun 11, 2025
Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The audit event is logged in Python/ceval_gil.c:

static inline void run_remote_debugger_script(PyObject *path)
{
    if (0 != PySys_Audit("remote_debugger_script", "O", path)) {
        PyErr_FormatUnraisable(
            "Audit hook failed for remote debugger script %U", path);
        return;
    }
...

@vstinner
Copy link
Member

cc @pablogsal

@vstinner vstinner dismissed their stale review June 11, 2025 13:10

I misunderstood the audit event. It's recorded by the debugged process. The documentation should clarify that.

@@ -1933,6 +1933,8 @@ always available. Unless explicitly noted otherwise, all variables are read-only
interpreter is pre-release (alpha, beta, or release candidate) then the
local and remote interpreters must be the same exact version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I misunderstood the audit event. It's recorded by the debugged process. The documentation should clarify that.

Or maybe the audit event should also be logged by the process which calls sys.remote_exec().

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can do both no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can update and add more info, BTW I think we can logged the event at both side

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should get an audit event in sys.remote_exec() yes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need a new issue for that

Zheaoli added 2 commits June 16, 2025 02:11
Signed-off-by: Manjusaka <me@manjusaka.me>
Zheaoli added 2 commits June 16, 2025 02:19
Signed-off-by: Manjusaka <me@manjusaka.me>
@Zheaoli
Copy link
Contributor Author

Zheaoli commented Jun 15, 2025

I think this PR can be merged first. I open another PR for debugger side event #135544

@pablogsal pablogsal merged commit 076f874 into python:main Jun 15, 2025
28 checks passed
@miss-islington-app
Copy link

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

@github-project-automation github-project-automation bot moved this from Todo to Done in Docs PRs Jun 15, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 15, 2025
…dit event (pythonGH-135362)

(cherry picked from commit 076f874)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
@bedevere-app
Copy link

bedevere-app bot commented Jun 15, 2025

GH-135546 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Jun 15, 2025
@pablogsal
Copy link
Member

Thanks for the contribution 🤘

pablogsal pushed a commit that referenced this pull request Jun 15, 2025
@Zheaoli Zheaoli deleted the manjusaka/gh135361 branch June 15, 2025 19:01
shuimu5418 pushed a commit to shuimu5418/cpython001 that referenced this pull request Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir skip news
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Record the remote_debugger_script audit event in doc
4 participants