Skip to content
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

bpo-34126: fix crashes while profiling certain invalid calls #8300

Merged
merged 1 commit into from Jul 21, 2018

Conversation

@jdemeyer
Copy link
Contributor

jdemeyer commented Jul 16, 2018

Needs backport to 3.7

https://bugs.python.org/issue34126

@jdemeyer jdemeyer changed the title bpo-34126: fix crashes while profiling invalid calls bpo-34126: fix crashes while profiling certain invalid calls Jul 16, 2018
// We need to create PyCFunctionObject for tracing.
PyMethodDescrObject *descr = (PyMethodDescrObject*)func;
func = PyCFunction_NewEx(descr->d_method, stack[0], NULL);
if (nargs > 0 && tstate->use_tracing) {

This comment has been minimized.

Copy link
@serhiy-storchaka

serhiy-storchaka Jul 17, 2018

Member

Why the check for tstate->c_profilefunc is missed?

This comment has been minimized.

Copy link
@jdemeyer

jdemeyer Jul 18, 2018

Author Contributor

That check is actually redundant. The old code was checking tstate->use_tracing && tstate->c_profilefunc twice (once here and once in the C_TRACE macro). It's not wrong to keep the additional tstate->c_profilefunc check but it's just not needed.

@serhiy-storchaka serhiy-storchaka merged commit 56868f9 into python:master Jul 21, 2018
9 checks passed
9 checks passed
VSTS: Linux-PR Linux-PR_20180717.09 succeeded
Details
VSTS: Linux-PR-Coverage Linux-PR-Coverage_20180717.09 succeeded
Details
VSTS: Windows-PR Windows-PR_20180717.09 succeeded
Details
VSTS: docs docs_20180717.15 succeeded
Details
VSTS: macOS-PR macOS-PR_20180717.09 succeeded
Details
bedevere/issue-number Issue number 34126 found
Details
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington

This comment has been minimized.

Copy link

miss-islington commented Jul 21, 2018

Thanks @jdemeyer for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒🤖

miss-islington added a commit to miss-islington/cpython that referenced this pull request Jul 21, 2018
(cherry picked from commit 56868f9)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
@bedevere-bot

This comment has been minimized.

Copy link

bedevere-bot commented Jul 21, 2018

GH-8371 is a backport of this pull request to the 3.7 branch.

serhiy-storchaka added a commit that referenced this pull request Jul 21, 2018
)

(cherry picked from commit 56868f9)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
lisroach added a commit to lisroach/cpython that referenced this pull request Sep 10, 2018
yahya-abou-imran added a commit to yahya-abou-imran/cpython that referenced this pull request Nov 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.