Skip to content

Conversation

@ajbeamon
Copy link
Contributor

@ajbeamon ajbeamon commented Jan 6, 2020

The slow task profiler includes a call to timer() to get the time that the backtrace was captured. This seems to be unsafe if the signal is raised in the middle of a call to time(), among possibly other things.

This PR removes the call to timer() in the signal handler and instead relies on the check thread to capture a time and propagate it to the signal handler using an atomic variable. In the event that atomic variables on the platform are not lock-free, this mechanism will not be used and instead the logs will not report the time that the backtrace was taken.

Resolves #2364 (hopefully)

…s it can lead to crashes if called at the wrong time.
@etschannen etschannen merged commit 176a1b6 into apple:release-6.2 Jan 10, 2020
@ajbeamon ajbeamon deleted the remove-timer-in-slowtask-profiler branch January 28, 2020 19:17
Sign up for free to 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