summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
28077d6)
- It was reproducing only on UTRACE but it was a testsuite bug.
static __attribute__((__noreturn__)) void child_alrm (void)
{
static __attribute__((__noreturn__)) void child_alrm (void)
{
- void (*handler_orig) (int signo);
#if 0
int i;
sigset_t oldset;
#endif
#if 0
int i;
sigset_t oldset;
#endif
- handler_orig = signal (SIGALRM, child_alrm_handler);
- assert (handler_orig == SIG_DFL);
+ /* Assumed already setup SIGALRM for CHILD_ALRM_HANDLER. */
#if 0
i = sigprocmask (SIG_BLOCK, NULL, &oldset);
#if 0
i = sigprocmask (SIG_BLOCK, NULL, &oldset);
pid_t inferior;
struct attach_state_struct *attach_state;
int i;
pid_t inferior;
struct attach_state_struct *attach_state;
int i;
+ void (*handler_orig) (int signo);
murder (inferior);
/* Attach to a stopped process with already pending SIGALRM. */
murder (inferior);
/* Attach to a stopped process with already pending SIGALRM. */
+ /* Setup the handler already in the parent to avoid the child race. */
+ handler_orig = signal (SIGALRM, child_alrm_handler);
+ assert (handler_orig == SIG_DFL);
inferior = (unsigned long) (*child) (data, child_alrm);
inferior = (unsigned long) (*child) (data, child_alrm);
+ handler_orig = signal (SIGALRM, handler_orig);
+ assert (handler_orig == child_alrm_handler);
STATE (inferior, 1 << STATE_SLEEPING);
delay ();
i = tkill (inferior, SIGSTOP);
STATE (inferior, 1 << STATE_SLEEPING);
delay ();
i = tkill (inferior, SIGSTOP);