This is an archive of the discontinued LLVM Phabricator instance.

[debugserver] Add one additional sleep before attaching after waiting
ClosedPublic

Authored by bulbazord on Feb 17 2023, 5:31 PM.

Details

Summary

It's possible for debugserver to attach to a process during the handoff
between /usr/lib/dyld and the dyld in the shared cache. When that
happens, we may end up in a state where there is no dyld in the process
and our debugging session is doomed. To make that scenario a lot less
likely, we can insert a sleep right before attaching after waiting to
find the right pid.

rdar://105513180

Diff Detail

Event Timeline

bulbazord created this revision.Feb 17 2023, 5:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 5:31 PM
bulbazord requested review of this revision.Feb 17 2023, 5:31 PM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 17 2023, 5:31 PM
jasonmolenda accepted this revision.Feb 23 2023, 11:21 AM

Ah, sorry I missed this one, LGTM. Attaching to a process very early in startup during this transition between dyld's is especially difficult to recover from; letting the process run a little extra to get past this is a good workaround.

This revision is now accepted and ready to land.Feb 23 2023, 11:21 AM