panic_action and GDB/LLDB

Arran Cudbard-Bell a.cudbardb at
Wed Nov 5 17:27:33 CET 2014

> On 5 Nov 2014, at 09:02, Sam Hartman <hartmans at> wrote:
> Why do the signal handlers get in the way?
> I'd expect the debugger to get the signal before freeradius does.

Alan indicated in his experience, that this was sometimes not the case
and that when running the server under a debugger he was unable to
get a backtrace on fatal signals if the panic_action signal handlers
were installed.

> If you want to resume the program without passing along the signal use
> the signal 0 command.
> If you want to mask the signals in the debugger so that the program
> never sees them do something like
> handle 11 nopass
> I don't understand the use case for this change

Principle of least surprise when debugging the server. If you start the
server with CAP_SYS_PTRACE in it's effective capabilities list, it just
works (which is what happens when you run it as root).

That's superior to having to manually mask signals in the debugger.

> and it seems kind of complex.

I agree, the code to determine if we can attach to the process is stupidly
complex for what it's doing, but I don't know of a better way of detecting
if a debugger is already attached.


Arran Cudbard-Bell <a.cudbardb at>
FreeRADIUS development team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

More information about the Freeradius-Devel mailing list