This is an archive of the discontinued LLVM Phabricator instance.

Fix the SIGINT handlers
ClosedPublic

Authored by lemo on Sep 15 2017, 1:28 PM.

Details

Summary
  1. Fix a data race (g_interrupt_sent flag usage was not thread safe, signals can be handled on arbitrary threads)
  2. exit() is not signal-safe, replaced it with the signal-safe equivalent _exit()

Diff Detail

Repository
rL LLVM

Event Timeline

lemo created this revision.Sep 15 2017, 1:28 PM
zturner edited edge metadata.Sep 15 2017, 1:34 PM

It turns out the function this called, DispatchInputInterrupt, already acquires a mutex. Maybe put the synchronization in there? Then you don't have to reproduce the synchronization in both MI and LLDB

Looks fine to me.

sas accepted this revision.Sep 18 2017, 10:09 AM
This revision is now accepted and ready to land.Sep 18 2017, 10:09 AM
This revision was automatically updated to reflect the committed changes.