Olivier Daudel wrote:
Hi Dave,
This patch adds the shared pending signal queue to the private pending
signal queue.
With the following small variation on procsig.c, we get this result:
============================================================
crash> sig 5747
PID: 5747   TASK: f7827020  CPU: 1   COMMAND: "procsig"
SIGNAL_STRUCT: f7d71380  COUNT: 1
 SIG SIGACTION  HANDLER       MASK       FLAGS
 [1]  f7833384  SIG_DFL 0000000000000000 0
[...]
[64]  f7833870  804867a 0000000000000000 0
SIGPENDING: no
    SIGNAL: 0000000200000800
   BLOCKED: 8000000200000800
SIGQUEUE:  SIG  SIGINFO
            12  f4d74ed4
            34  f4d74e40
SHARED_PENDING
    SIGNAL: 8000000000000800
SIGQUEUE:  SIG  SIGINFO
            12  f4d74060
            64  f4d740f4
            64  f4d74188
============================================================
Sorry -- I can't use it as us because it doesn't work with 2.4 kernels,
or at least with RHEL3 kernels.  Here's a RHEL3 (2.4.21-37.ELsmp)
example:

crash> sig 1
PID: 1      TASK: dff66000  CPU: 1   COMMAND: "init"
SIGNAL_STRUCT: c27a6100  COUNT: 1
 SIG SIGACTION  HANDLER       MASK       FLAGS
 [1]  c2708104  8049ebc 0000000000000000 4000000 (SA_RESTORER)
[...]
[61]  c27085b4  SIG_IGN 0000000000000000 14000000 (SA_RESTORER|SA_RESTART)
[62]  c27085c8  SIG_IGN 0000000000000000 14000000 (SA_RESTORER|SA_RESTART)
[63]  c27085dc  SIG_IGN 0000000000000000 14000000 (SA_RESTORER|SA_RESTART)
SIGPENDING: no
    SIGNAL: 0000000000000000
   BLOCKED: 0000000000000000
SIGQUEUE: (empty)
SHARED_PENDING
    SIGNAL: 0000000000000000

sig: invalid structure member offset: sigpending_list
     FILE: task.c  LINE: 6010  FUNCTION: dump_signal_data()

[./crash] error trace: 80cc38f => 80cc40f => 80cd378 => 8113127

  8113127: OFFSET_verify+112
  80cd378: dump_signal_data+3884
  80cc40f: do_sig+94
  80cc38f: cmd_sig+890

sig: invalid structure member offset: sigpending_list
     FILE: task.c  LINE: 6010  FUNCTION: dump_signal_data()

crash>

Three other things:
 
(1) Shouldn't your "SHARED_PENDING" line have a following
    "yes" or "no" indication, as is the case with the
    "SIGPENDING:" output?
(2) Thanks for remembering to add "signal_struct_shared_pending"
    do dump_offset_table() -- but also don't forget to add
    the new "sigpending_signal" addition you made to the
    size_table structure, which is also dumped inside the
    dump_offset_table() function.
(3) The SIQUEUE output is now associated with either SIGPENDING
    or SHARED_PENDING, so the two SIGQUEUE outputs should be
    indented so it's more obvious.

Here's what I mean:

SIGPENDING: no
   SIGNAL: 0000000200000800
  BLOCKED: 8000000200000800
SIGQUEUE:  SIG  SIGINFO  -> move in 1 space
           12  f4d74ed4  -> move in 1 space
           34  f4d74e40  -> move in 1 space
SHARED_PENDING           -> shouldn't there be yes or no here?
   SIGNAL: 8000000000000800
SIGQUEUE:  SIG  SIGINFO  -> move in 1 space
           12  f4d74060  -> move in 1 space
           64  f4d740f4  -> move in 1 space
           64  f4d74188  -> move in 1 space

Thanks,
  Dave
 
 
 
 
 
 
 

 

#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
#include <linux/unistd.h>

#ifndef GETTID
pid_t gettid(void) {return syscall(__NR_gettid);}
#endif
#ifndef TKILL
int tkill(pid_t tid, int sig) {return syscall (__NR_tkill,tid,sig); }
#endif

void sigusr2(int sig, siginfo_t *sp, void *uc)
{
}

void sigcatch()
{
        struct sigaction sa;
        sigemptyset(&sa.sa_mask);
        sa.sa_flags = 0 ; //SA_SIGINFO;
        sa.sa_sigaction = sigusr2;
        if (sigaction(SIGUSR2, &sa, NULL)==-1) {
                perror("sigaction() - SIGUSR2"); exit(1);
        }
        if (sigaction(SIGRTMIN, &sa, NULL)==-1) {
                perror("sigaction() - SIGRTMIN"); exit(1);
        }
        if (sigaction(SIGRTMAX, &sa, NULL)==-1) {
                perror("sigaction() - SIGRTMAX"); exit(1);
        }
}
void sig_block()
{
        sigset_t set;
        sigemptyset(&set);
        sigaddset(&set, SIGUSR2);
        sigaddset(&set, SIGRTMIN);
        sigaddset(&set, SIGRTMAX);
        if (sigprocmask(SIG_SETMASK, &set,NULL) == -1) {
                perror("sigprocmask()"); exit(1);
        }
}
void sig_send() {
        if(tkill(gettid(), SIGUSR2)==-1){
                perror("tkill()"); exit(1);
        }
        if(tkill(gettid(), SIGRTMIN)==-1){
                perror("tkill()"); exit(1);
        }
        if(kill(getpid(), SIGUSR2)==-1){
                perror("tkill()"); exit(1);
        }
        if(kill(getpid(), SIGRTMAX)==-1){
                perror("tkill()"); exit(1);
        }
        if(kill(getpid(), SIGRTMAX)==-1){
                perror("tkill()"); exit(1);
        }
}

main(int argc)
{
    sigcatch();
    sig_block();
    sig_send();

    pause();
}

  ------------------------------------------------------------------------------------------------------------------------
                 Name: sig2.patch
   sig2.patch    Type: unspecified type (application/octet-stream)
             Encoding: quoted-printable

  ------------------------------------------------------------------------------------------------------------------------
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility