Skip to content

Conversation

@jdemeyer
Copy link
Contributor

@jdemeyer 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
@serhiy-storchaka serhiy-storchaka added type-bug An unexpected behavior, bug, or error needs backport to 3.7 labels Jul 17, 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) {
Copy link
Member

Choose a reason for hiding this comment

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

Why the check for tstate->c_profilefunc is missed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

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
@miss-islington
Copy link
Contributor

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

miss-islington pushed 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
Copy link

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

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

(cherry picked from commit 56868f9)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bug An unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants