nikic / sample_prof

Sampling profiler for PHP
Other
59 stars 6 forks source link

Check for subsequent sample_prof_start calls #7

Open dryabov opened 4 years ago

dryabov commented 4 years ago

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.