Skip to content

Check for subsequent sample_prof_start calls - #7

Open
dryabov wants to merge 2 commits into
nikic:masterfrom
dryabov:patch-3
Open

Check for subsequent sample_prof_start calls#7
dryabov wants to merge 2 commits into
nikic:masterfrom
dryabov:patch-3

Conversation

@dryabov

Copy link
Copy Markdown
Contributor

There was no check for g->enabled neither in the sample_prof_start. As a result, subsequent calls to sample_prof_startmay result in Segmentation fault (one thread is cancelled only, and another is trying to access memory freed in shutdown function).

PS. My internal perfectionist could not ignore this. I apologize for distracting you with such an unnecessary (in most cases) patch.

There was no check for `g->enabled` neither in the `sample_prof_start`. As a result, subsequent calls to `sample_prof_start`may result in Segmentation fault (one thread is cancelled only, and another is trying to access memory freed in shutdown function).
PS. My internal perfectionist could not ignore this. I apologize for distracting you with such an unnecessary (in most cases) patch.
Comment threadsample_prof.c Outdated
"thelessification"
Co-authored-by: Nikita Popov <nikita.ppv@googlemail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@dryabov@nikic