Re: ccache interrupt handling bug
"Nadav Har'El" <[email protected]> Mon, 17 Aug 2015 00:56:07 +0300
| Newsgroups | gmane.comp.compilers.ccache |
|---|---|
| Message-ID | <CANEVyjuWAUjfbMEd9woqowD5DR6xustt_si_HyKC8t6VVd5sfg@mail.gmail.com> |
On Mon, Aug 17, 2015 at 12:50 AM, Tom Lane <[email protected]> wrote: > > * make launches "ccache gcc -o test.o test.c" > * user types control-C > * ccache receives SIGINT and exits > * make does unlink("test.o") to clean up after failed compile step, which > it thinks is done > * gcc creates test.o > Stupid question: Does ccache let gcc write to test.o directly, or does it write to some temporary file and then ccache copies it? > * gcc receives SIGINT and exits > > We're left with a probably-broken test.o in the filesystem, despite > make's attempt to clean up. Now, the window for this is pretty narrow, > but I think it could happen: I don't believe that sending signals to > multiple processes is atomic in most kernels. > > You really don't want ccache to exit until after all externally-observable > things have stopped happening. (I recently fixed a somewhat related bug > in Postgres :-(, which is why this caught my eye.) > > regards, tom lane > -- Nadav Har'El [email protected]