Re: [Bug-readline] [readline patch, gdb-7.3?] Avoid free from a signal handler [Re: [PATCH] Make interrupting tab-completion safe.]

Jan Kratochvil
2011-06-29T20:35:25Z

On Wed, 29 Jun 2011 15:54:11 +0200, Chet Ramey wrote:
> If you feel that you need to make this change for the current version of
> gdb, go ahead.

OK. It is not a complete fix but hopefully the one people hit the most.
I have also seen unreproducible crash(es) on a completion CTRL-C myself.

> The big problem is to allow operations that read through the file system
> (like completion) to be interrupted without running unsafe functions from
> a signal handler.

I do not see the problem, readline already does not use SA_RESTART and the
application also gets SIGINT passed by _rl_handle_signal so it aborts the
completion reading on its own, as GDB does by the QUIT macro.

> It does the user no good to keep setting the "I got SIGINT" flag if he's
> trying to complete files on a dead or otherwise unreachable file server.

The syscall should get EINTR without SA_RESTART. But I admit I may not see
the problem now.

Thanks,
Jan