Discussion:
catch signal does not appear multi-inferior safe
Chris January
2014-07-11 10:56:44 UTC
Permalink
Hello,

It appears to me that the 'catch signal' support in GDB is not
multi-inferior safe. Combining the 'catch signal' command with the
'checkpoint' command, for example, results in an internal error:

break-catch-sig.c:152: internal-error:
signal_catchpoint_remove_location: Assertion `signal_catch_counts[iter]
0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)

see the end of this e-mail for reproducer.

When checkpointing / catching a fork signal_catchpoint_remove_location
may be called twice in a row - once for the parent and once for the
child. This causes signal_catch_counts to go below 0. I would like some
advice on how to fix this problem as I am not sure what the correct fix
is.

Regards,
Chris January - VP Engineering - Allinea Software Ltd.


The problem can be reproduced using the following GDB commands - run GDB
from gdb/testsuite/gdb.base:

file checkpoint
break main
run
catch signal SIGSEGV
break 48
continue
checkpoint
Pedro Alves
2014-08-19 15:37:29 UTC
Permalink
Post by Chris January
Hello,
It appears to me that the 'catch signal' support in GDB is not
multi-inferior safe. Combining the 'catch signal' command with the
signal_catchpoint_remove_location: Assertion `signal_catch_counts[iter]
0' failed.
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n)
see the end of this e-mail for reproducer.
When checkpointing / catching a fork signal_catchpoint_remove_location
may be called twice in a row - once for the parent and once for the
child.
Signal catchpoint locations aren't really per-process; they're
global. GDB shouldn't be trying to detach them from the child.
Where is this happening? Is this from detach_breakpoint ? That's
odd, since that skips bp_loc_other locations?
Post by Chris January
This causes signal_catch_counts to go below 0. I would like some
advice on how to fix this problem as I am not sure what the correct fix
is.
--
Thanks,
Pedro Alves
Continue reading on narkive:
Search results for 'catch signal does not appear multi-inferior safe' (Questions and Answers)
5
replies
I Last Exile did Moran die in the end or not?
started 2006-10-08 20:10:27 UTC
comics & animation
Loading...