Possible endless loop in lto-wrapper

Rafael Espindola espindola@google.com
Mon Nov 23 19:00:00 GMT 2009


2009/11/22 Leandro Nini <drfiemost@email.it>:
> Hi,
>
> in gcc-4.5 lto-wrapper may end up in an endless loop in case of error:
>
> if for example a 'maybe_unlink_file' call from 'lto_wrapper_exit' fails it
> calls 'fatal_perror' which in turn calls 'lto_wrapper_exit' again causing
> an infinity of
>
> lto-wrapper: deleting LTRANS file /tmp/ccWjXUv8.lto.o: No such file or
> directory
>
> error messages on the console.
>
> I've solved this by substituting 'maybe_unlink_file' with
> 'unlink_if_ordinary'
> whithin the 'lto_wrapper_exit' function.
> Not sure if this is the best fix but hope it helps.

Thanks for finding the bug!

I think that we need something similar to what was done in the linker:
Avoid trying to start a new cleanup if we are already in one.

Leandro, can you try the attached patch?

Diego, OK if it works?

2009-11-23  Rafael Avila de Espindola  <espindola@google.com>

	* lto-wrapper.c (lto_wrapper_exit): Don't try to delete files if
	being called recursively.

>
> Best Regards,
> Leandro
>  --

Cheers,
-- 
Rafael Ávila de Espíndola
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clean.patch
Type: text/x-diff
Size: 861 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc/attachments/20091123/7dbd0920/attachment.bin>


More information about the Gcc mailing list