https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64206
Bug ID: 64206 Summary: fake.so is unlinked too early for some users Product: gcc Version: 5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: jit Assignee: dmalcolm at gcc dot gnu.org Reporter: drepper.fsp+rhbz at gmail dot com Some users of the DSO created by the JIT (probably mostly debuggers) might have a hard time getting to the file before it gets unlinked. For some gdb versions, for instance, this is fatal. Try gdb 7.8.1, for instance, see https://bugzilla.redhat.com/show_bug.cgi?id=1170861 That is certainly gdb's fault but it's an example about the type of problems that can appear. It certainly is useful to unlink the file as quickly as possible so that in case of a problem crash nothing is left behind. But there at least should be the possibility to prevent the early unlink. Dave suggested to tie this to the enabling of debuginfo generation in libgccjit. I'm actually not entirely sure that's the best possibility since even without debuginfo the debugger can use the ELF symbols to place breakpoints etc. Maybe a boolean option? As a solution it should be quite easy to transfer ownership of the file and directory from playback::context to result.