In many places in the translator, we check for pending_interrupts, and simply return or quit nested loops early, being assured that eventually we'll bubble back up to the top level and get a proper rc=EXIT_FAILURE. This is not quite good enough. In some cases, an unfortunately timed interrupt can result in an exit from a routine, with expected post-conditions not met. For example, elaborate.cxx includes: 1665 1666 // Add created probe 1667 p->body = b; 1668 derive_probes (s, p, dps); 1669 for (unsigned i = 0; i < dps.size(); i++) 1670 { 1671 derived_probe* dp = dps[i]; 1672 s.probes.push_back (dp); 1673 dp->join_group (s); 1674 } 1675 // Repopulate symbol and type info 1676 symresolution_info sym (s); 1677 sym.current_function = 0; 1678 sym.current_probe = dps[0]; 1679 dps[0]->body->visit (& sym); If the interrupt was taken during the derive_probes() call, it will have left the dps[] array empty, but will simply return. On line 1678, dps[0] will be dereferenced, bang, segv. The code could, I suppose, protect itself with more explicit checks, but this seems to be more labour than necessary. Let's instead explore replacing all if (pending_interrupts) break; or if (pending_interrupts) return; with if (pending_interrupts) throw runtime_error("interrupt received"); and catch that in main() someplace. This should make it unnecessary to check & test in quite so many places.
Fixed in commit 985892de26421