[PATCH] toplev: avoid recursive emergency_dump_function

Segher Boessenkool segher@kernel.crashing.org
Sat Jul 22 15:11:00 GMT 2017


Hi!

On Thu, Jul 20, 2017 at 05:40:28PM +0300, Alexander Monakov wrote:
> Segher pointed out on IRC that ICE reporting with dumps enabled got worse:
> if emergency_dump_function itself leads to an ICE (e.g. by segfaulting),
> nested ICE reporting will invoke emergency_dump_function in exactly the
> same context, but not only would we uselessly announce current pass again,
> this time around the second SIGSEGV will just terminate cc1 because the
> signal handler is unregistered (so we won't print the backtrace).  Sorry
> for not really considering the implications when submitting that patch.
> 
> Solve this by substituting the callback for global_dc->internal_error;
> this avoids invoking emergency_dump_function, and also gives a
> convenient point to flush the dump file.  OK to apply?

Extra thanks for that last point, it's been driving me nuts :-)

> 	* topvel.c (dumpfile.h): New include.

s/topvel/toplev/


Segher



More information about the Gcc-patches mailing list