Skip to content

CFRunLoop: do not wake a run loop the timer is not in - #141

Open
DTW-Thalion wants to merge 2 commits into
gnustep:masterfrom
DTW-Thalion:fix/cfrunloop-timer-setfiredate
Open

CFRunLoop: do not wake a run loop the timer is not in#141
DTW-Thalion wants to merge 2 commits into
gnustep:masterfrom
DTW-Thalion:fix/cfrunloop-timer-setfiredate

Conversation

@DTW-Thalion

Copy link
Copy Markdown
Contributor

CFRunLoopTimerSetNextFireDate updated the fire date and then called CFRunLoopWakeUp on the timer's run loop. That run loop is NULL until the timer is added to one, so calling the function on a free-standing timer dereferenced NULL and crashed.

Only wake a run loop the timer has actually been added to.

Tests/CFRunLoop/timer_setfiredate.m sets the fire date of a timer that is not in a run loop and checks it took effect, verified against Apple CoreFoundation.

CFRunLoopTimerSetNextFireDate always called CFRunLoopWakeUp on the timer run
loop, which is NULL until the timer is added to one, so setting the fire date
of a free-standing timer dereferenced NULL.  Only wake a run loop the timer
has been added to.
@DTW-Thalion
DTW-Thalion force-pushed the fix/cfrunloop-timer-setfiredate branch from bf147d2 to b473c71 Compare July 24, 2026 15:22
@DTW-Thalion DTW-Thalion reopened this Jul 24, 2026
@DTW-Thalion DTW-Thalion reopened this Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant