<div dir="ltr"><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">We've been seeing races during shutdown of inferiors for months, and I finally tracked it down to the fact that Process holds a Target&.  When an inferior is exiting on Windows, we will get a notification of this and we try to do various cleanup related with the target.  But there are times where the Target gets deleted even when the Process is still around, due to some interactions between our debug loop and the timing of when certain debug events that get sent by the operating system.</span><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">As a result, the race leads to us getting one of the notifications from the OS and us trying to access the target, which is stored by reference leading to a crash.</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">It seems like a purely mechanical change to make Process hold a TargetSP instead of a Target&.  I've already started down this patch locally, but I want to make sure there are no objections or concerns before I continue down this path, since it's kind of mundane work.</div></div>