shared pending signal queue added to sig command
by Olivier Daudel
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
============================================================
#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();
}
18 years, 2 months
[PATCH] add strlen prototype to gdb-6.1/sim/ppc/debug.c
by Olaf Hering
This one may be harmless, but our build output checks dont like it.
---
gdb-6.1.patch | 25 ++++++++++++++++++++++++-
1 file changed, 24 insertions(+), 1 deletion(-)
Index: crash-4.0-2.33/gdb-6.1.patch
===================================================================
--- crash-4.0-2.33.orig/gdb-6.1.patch
+++ crash-4.0-2.33/gdb-6.1.patch
@@ -1,4 +1,15 @@
---- gdb-6.1/bfd/coff-alpha.c.orig
+debug.c: In function 'trace_usage':
+debug.c:129: warning: incompatible implicit declaration of built-in function 'strlen'
+
+
+---
+ bfd/coff-alpha.c | 2 +-
+ sim/ppc/debug.c | 1 +
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+Index: gdb-6.1/bfd/coff-alpha.c
+===================================================================
+--- gdb-6.1.orig/bfd/coff-alpha.c
+++ gdb-6.1/bfd/coff-alpha.c
@@ -1455,7 +1455,7 @@ alpha_relocate_section (output_bfd, info
amt = sizeof (struct ecoff_section_tdata);
@@ -9,3 +20,15 @@
}
if (lita_sec_data->gp != 0)
+Index: gdb-6.1/sim/ppc/debug.c
+===================================================================
+--- gdb-6.1.orig/sim/ppc/debug.c
++++ gdb-6.1/sim/ppc/debug.c
+@@ -28,6 +28,7 @@
+ #ifdef HAVE_STDLIB_H
+ #include <stdlib.h>
+ #endif
++#include <string.h>
+
+ int ppc_trace[nr_trace_options];
+
18 years, 2 months
Support for namespaces in mount (option -n)
by Olivier Daudel
Hi Dave,
This patch try to support namespaces.
The following sample use two processes having different namespaces.
For example, /sys and /dev/shm are presents in one namespace and not in
the other.
Olivier.
crash> mount -n 1
VFSMOUNT SUPERBLK TYPE DEVNAME DIRNAME
f7eab780 f7eaf200 rootfs rootfs / f7eabf00 f784d800
tmpfs /dev /dev f7eab080 f7ce5600 ext3 /dev/root
/ f7eabf80 f7ea3c00 proc /proc /proc
f7eab100 f7a7ae00 usbfs /proc/bus/usb /proc/bus/usb
f7eab880 f7eaf400 sysfs /sys /sys f7eab980 f7d72200
devpts /dev/devpts /dev/pts f7eaba80 f7af5c00 tmpfs /dev/shm
/dev/shm f7eabb00 f7029400 ext3 /dev/sda3
/mnt/sda3 f7eabb80 f7209a00 binfmt_misc none
/proc/sys/fs/binfmt_misc
f7eabd80 f7af6c00 rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
f7eabc00 f6de5400 autofs automount(pid2367) /net f6e44780 c1f63000
autofs automount(pid2357) /misc f6e44200 f6c4d800 nfsd nfsd
/proc/fs/nfsd
crash> mount -n 3287
VFSMOUNT SUPERBLK TYPE DEVNAME DIRNAME
f6e44180 f7eaf200 rootfs rootfs / f6e44700 f7ce5600
ext3 /dev/root / f6e44680 f784d800 tmpfs /dev
/dev f6e44600 f7d72200 devpts /dev/devpts /dev/pts
f6e44580 f7ea3c00 proc /proc /proc f6e44500
f7a7ae00 usbfs /proc/bus/usb /proc/bus/usb
f6e44480 f7209a00 binfmt_misc none /proc/sys/fs/binfmt_misc
f6e44300 f7029400 ext3 /dev/sda3 /mnt/sda3 f6e44280 f7af6c00
rpc_pipefs sunrpc /var/lib/nfs/rpc_pipefs
f7eaba00 f6de5400 autofs automount(pid2367) /net f7eabe00 c1f63000
autofs automount(pid2357) /misc
----------------------------------------------------------------
Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre
18 years, 2 months
crash version 4.0-3.3 is available
by Dave Anderson
- Addressed a number of issues associated with CONFIG_SPARSEMEM
kernels and kernels using updated manners for the linkage of
their pglist_data structures, and pointers to their mem_map arrays.
(anderson(a)redhat.com)
- Implemented "kmem -n" for CONFIG_SPARSEMEM kernels; in addition
to the pgdat- and zone-related data command output, it also
displays a list of the SPARSEMEM mem_sections. Here is an
example from an ia64:
crash> kmem -n
NODE SIZE PGLIST_DATA BOOTMEM_DATA NODE_ZONES
0 2359296 e000000008c00000 a000000100749b70 e000000008c00000
e000000008c02400
e000000008c04800
e000000008c06c00
MEM_MAP START_PADDR START_MAPNR
e0000001040a3f00 0 0
ZONE NAME SIZE MEM_MAP START_PADDR START_MAPNR
0 DMA 262144 e0000001040a3f00 0 0
1 DMA32 0 0 0 0
2 Normal 2097152 e0000001048a3f00 100000000 262144
3 HighMem 0 0 0 0
-------------------------------------------------------------------
NR SECTION CODED_MEM_MAP MEM_MAP PFN
0 e00000010409ff00 e0000001040a3f00 e0000001040a3f00 0
1 e00000010409ff08 e0000001040a3f00 e0000001044a3f00 65536
4 e00000010409ff20 e0000001038a3f00 e0000001048a3f00 262144
5 e00000010409ff28 e0000001038a3f00 e000000104ca3f00 327680
6 e00000010409ff30 e0000001038a3f00 e0000001050a3f00 393216
7 e00000010409ff38 e0000001038a3f00 e0000001054a3f00 458752
8 e00000010409ff40 e0000001038a3f00 e0000001058a3f00 524288
9 e00000010409ff48 e0000001038a3f00 e000000105ca3f00 589824
10 e00000010409ff50 e0000001038a3f00 e0000001060a3f00 655360
11 e00000010409ff58 e0000001038a3f00 e0000001064a3f00 720896
12 e00000010409ff60 e0000001038a3f00 e0000001068a3f00 786432
13 e00000010409ff68 e0000001038a3f00 e000000106ca3f00 851968
14 e00000010409ff70 e0000001038a3f00 e0000001070a3f00 917504
15 e00000010409ff78 e0000001038a3f00 e0000001074a3f00 983040
16 e00000010409ff80 e0000001038a3f00 e0000001078a3f00 1048576
17 e00000010409ff88 e0000001038a3f00 e000000107ca3f00 1114112
18 e00000010409ff90 e0000001038a3f00 e0000001080a3f00 1179648
19 e00000010409ff98 e0000001038a3f00 e0000001084a3f00 1245184
20 e00000010409ffa0 e0000001038a3f00 e0000001088a3f00 1310720
21 e00000010409ffa8 e0000001038a3f00 e000000108ca3f00 1376256
22 e00000010409ffb0 e0000001038a3f00 e0000001090a3f00 1441792
23 e00000010409ffb8 e0000001038a3f00 e0000001094a3f00 1507328
34 e0000001040a0010 e0000001010a3f00 e0000001098a3f00 2228224
35 e0000001040a0018 e0000001010a3f00 e000000109ca3f00 2293760
crash>
(anderson(a)redhat.com)
- Fix for "kmem -i" failure in CONFIG_SPARSEMEM kernels that would
typically fail with the error message: "kmem: invalid kernel virtual
address: 0 type: node_zones free_pages". (anderson(a)redhat.com)
- Fix for "kmem -f" failure in CONFIG_SPARSEMEM kernels that would
typically fail with the error message: "kmem: invalid kernel virtual
address: ab8 type: node_zones name". (anderson(a)redhat.com)
- Fix for "kmem -f" failure in 2.6.17 kernels (possibly earlier) that
would fail with the error message: "kmem: invalid structure member
offset: zone_zone_mem_map". (anderson(a)redhat.com)
- Fix for "kmem [address]" failure in 2.6.17 kernels (possibly earlier)
that would fail with the error message: "kmem: invalid structure
member offset: zone_zone_mem_map". (anderson(a)redhat.com)
- Fix for "kmem -i" that resulted in a bogus "CACHED" page count
value. (anderson(a)redhat.com)
- As an result of the last "kmem -i" fix, I've added a new "kmem -V"
option that dumps the kernel's new vm_stat[] array contents by
their enum values:
crash> kmem -V
NR_ANON_PAGES: 38656
NR_FILE_MAPPED: 3116
NR_FILE_PAGES: 141106
NR_SLAB: 58605
NR_PAGETABLE: 1059
NR_FILE_DIRTY: 7
NR_WRITEBACK: 0
NR_UNSTABLE_NFS: 0
NR_BOUNCE: 0
NUMA_HIT: 86475467
NUMA_MISS: 0
NUMA_FOREIGN: 0
NUMA_INTERLEAVE_HIT: 31523
NUMA_LOCAL: 86475467
NUMA_OTHER: 0
crash>
Interally, a new dump_vm_stat() function has been added to access
any of the items in the list. (anderson(a)redhat.com)
- Implemented support for relocatable x86_64 live kernels and kdump
generated vmcores. Without this patch, attempts to analyze those
kernels would fail during initialization with the error message:
"crash: vmlinux and vmcore do not match!" (anderson(a)redhat.com)
- Support for recognizing real-time signals in the "sig" command.
(olivier.daudel(a)u-paris10.fr)
- Fix for "sys -c" display of "sys_ni_syscall" entries that showed
different system call names that have the same (W) symbol value
as the (T) symbol "sys_ni_syscall". For example:
crash> sym -l | grep ffffffff802a38b6
ffffffff802a38b6 (W) compat_sys_ipc
ffffffff802a38b6 (W) compat_sys_keyctl
ffffffff802a38b6 (W) compat_sys_sysctl
ffffffff802a38b6 (W) ppc_rtas
ffffffff802a38b6 (T) sys_ni_syscall
ffffffff802a38b6 (W) sys_pciconfig_iobase
ffffffff802a38b6 (W) sys_pciconfig_read
ffffffff802a38b6 (W) sys_pciconfig_write
ffffffff802a38b6 (W) sys_spu_create
ffffffff802a38b6 (W) sys_spu_run
ffffffff802a38b6 (W) sys_vm86
ffffffff802a38b6 (W) sys_vm86old
crash>
- Depending upon the kernel, one of those symbols would be displayed
instead of sys_ni_syscall. (olivier.daudel(a)u-paris10.fr)
- Fix for "sig" command where in later 2.6 kernels, the queued signal
list at the end of the display would loop back on itself, repeatedly
displaying the same queued signal(s). (olivier.daudel(a)u-paris10.fr)
Download from: http://people.redhat.com/anderson
18 years, 2 months
commande sig
by Olivier Daudel
Hi Dave and Jeff
I hope this one will be correct.
Olivier.
----------------------------------------------------------------
Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre
18 years, 2 months
A cosmetic patch for sys -c
by Olivier Daudel
Hi Dave,
A small cosmetic patch to force sys_ni_syscall when needed.
Olivier
=====================================================
--- crash-4.0-3.2/kernel.c 2006-08-23 17:09:48.000000000 +0200
+++ crash-4.0-3.2-patch/kernel.c 2006-09-01 22:14:21.000000000 +0200
@@ -3189,9 +3189,9 @@
struct syment *sp, *spn;
long size;
#ifdef S390X
- unsigned int *sct, *sys_call_table, addr;
+ unsigned int *sct, *sys_call_table, sys_ni_syscall, addr;
#else
- ulong *sys_call_table, *sct, addr;
+ ulong *sys_call_table, *sct, sys_ni_syscall, addr;
#endif
if (GDB_PATCHED())
error(INFO, "line numbers are not available\n"); @@
-3208,6 +3208,7 @@
readmem(symbol_value("sys_call_table"), KVADDR, sys_call_table,
size, "sys_call_table", FAULT_ON_ERROR);
+ sys_ni_syscall=symbol_value("sys_ni_syscall");
if (spec)
open_tmpfile();
@@ -3228,6 +3229,9 @@
}
fprintf(fp, (output_radix == 16) ? "%3x " : "%3d ", i);
+ if (sys_ni_syscall && *sct == sys_ni_syscall)
+ fprintf(fp, "%-26s ", "sys_ni_syscall");
+ else
fprintf(fp, "%-26s ", scp);
/*
----------------------------------------------------------------
Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre
18 years, 2 months
An other patch for command sig
by Olivier Daudel
Hi Dave,
I think we have an other small problem with sig :
crash> sig
PID: 14836 TASK: f7d89020 CPU: 1 COMMAND: "crash"
SIGPENDING: no
SIGNAL: 0000000000000000
BLOCKED: 0000000000000000
SIGNAL_STRUCT: c1e7ae00 COUNT: 1
SIG SIGACTION HANDLER MASK FLAGS [1] f5129804 817af58
0000000000000001 10000000 (SA_RESTART)
[...]
[63] f5129cdc SIG_DFL 0000000000000000 0 SIGQUEUE: (empty)
The last slot should be 64 ?
The patch is supposed to fix this problem.
I also indtroduce RT signals. I know this is trivial because the names
are SIGRTMIN+x (or SIGRTMAX-x). The motivation is the command sig -s.
By the way, there is a decision to enforce : do we leave the (null) to
remember that signals 32 and 33 don't exist (if i am correct) or do we
discard them ?
crash> sig -s ffffffffffffffff
SIGHUP SIGINT SIGQUIT SIGILL SIGTRAP SIGABRT SIGBUS SIGFPE SIGKILL SIGUSR1
SIGSEGV SIGUSR2 SIGPIPE SIGALRM SIGTERM SIGSTKFLT SIGCHLD SIGCONT SIGSTOP
SIGTSTP SIGTTIN SIGTTOU SIGURG SIGXCPU SIGXFSZ SIGVTALRM SIGPROF
SIGWINCH SIGIO
SIGPWR SIGSYS (null) (null) SIGRTMIN SIGRTMIN+1 SIGRTMIN+2 SIGRTMIN+3
SIGRTMIN+4
SIGRTMIN+5 SIGRTMIN+6 SIGRTMIN+7 SIGRTMIN+8 SIGRTMIN+9 SIGRTMIN+10 SIGRTMIN+11
SIGRTMIN+12 SIGRTMIN+13 SIGRTMIN+14 SIGRTMIN+15 SIGRTMAX-14 SIGRTMAX-13
SIGRTMAX-12 SIGRTMAX-11 SIGRTMAX-10 SIGRTMAX-9 SIGRTMAX-8 SIGRTMAX-7
SIGRTMAX-6
SIGRTMAX-5 SIGRTMAX-4 SIGRTMAX-3 SIGRTMAX-2 SIGRTMAX-1 SIGRTMAX
=================================================================
--- crash-4.0-3.2/task.c 2006-08-25 23:55:20.000000000 +0200
+++ crash-4.0-3.2-patch/task.c 2006-08-26 00:21:19.000000000 +0200
@@ -5522,7 +5522,6 @@
char *name;
char *altname;
} signame[_NSIG] = {
- /* 0 */ {NULL, NULL},
/* 1 */ {"SIGHUP", NULL},
/* 2 */ {"SIGINT", NULL},
/* 3 */ {"SIGQUIT", NULL},
@@ -5553,8 +5552,40 @@
/* 28 */ {"SIGWINCH", NULL},
/* 29 */ {"SIGIO", "SIGPOLL"},
/* 30 */ {"SIGPWR", NULL},
- /* 31 */ {"SIGSYS", NULL},
- {NULL, NULL}, /* Real time signals start here. */
+ /* 31 */ {"SIGSYS", "SIGUNUSED"},
+ /* 32 */ {NULL, NULL}, /* Real time signals start here. */
+ /* 33 */ {NULL, NULL},
+ /* 34 */ {"SIGRTMIN", NULL},
+ /* 35 */ {"SIGRTMIN+1", NULL},
+ /* 36 */ {"SIGRTMIN+2", NULL},
+ /* 37 */ {"SIGRTMIN+3", NULL},
+ /* 38 */ {"SIGRTMIN+4", NULL},
+ /* 39 */ {"SIGRTMIN+5", NULL},
+ /* 40 */ {"SIGRTMIN+6", NULL},
+ /* 41 */ {"SIGRTMIN+7", NULL},
+ /* 42 */ {"SIGRTMIN+8", NULL},
+ /* 43 */ {"SIGRTMIN+9", NULL},
+ /* 44 */ {"SIGRTMIN+10", NULL},
+ /* 45 */ {"SIGRTMIN+11", NULL},
+ /* 46 */ {"SIGRTMIN+12", NULL},
+ /* 47 */ {"SIGRTMIN+13", NULL},
+ /* 48 */ {"SIGRTMIN+14", NULL},
+ /* 49 */ {"SIGRTMIN+15", NULL},
+ /* 50 */ {"SIGRTMAX-14", NULL},
+ /* 51 */ {"SIGRTMAX-13", NULL},
+ /* 52 */ {"SIGRTMAX-12", NULL},
+ /* 53 */ {"SIGRTMAX-11", NULL},
+ /* 54 */ {"SIGRTMAX-10", NULL},
+ /* 55 */ {"SIGRTMAX-9", NULL},
+ /* 56 */ {"SIGRTMAX-8", NULL},
+ /* 57 */ {"SIGRTMAX-7", NULL},
+ /* 58 */ {"SIGRTMAX-6", NULL},
+ /* 59 */ {"SIGRTMAX-5", NULL},
+ /* 60 */ {"SIGRTMAX-4", NULL},
+ /* 61 */ {"SIGRTMAX-3", NULL},
+ /* 62 */ {"SIGRTMAX-2", NULL},
+ /* 63 */ {"SIGRTMAX-1", NULL},
+ /* 64 */ {"SIGRTMAX", NULL},
};
static void
@@ -5566,8 +5597,8 @@
if (!signame[i].name)
continue;
- fprintf(fp, "%s[%d] %s", i < 10 ? " " : "", -
i, signame[i].name);
+ fprintf(fp, "%s[%d] %s", i+1 < 10 ? " " : "", +
i+1, signame[i].name);
if (signame[i].altname)
fprintf(fp, "/%s", signame[i].altname);
fprintf(fp, "\n");
@@ -5591,12 +5622,12 @@
len = 0;
- for (i = c = 0; i < (_NSIG/2); i++) {
- mask = (ulong)(1) << i;
+ for (i = c = 0; i < (_NSIG); i++) {
+ mask = (ulonglong)(1) << i;
if ((sig = (sigset & mask))) {
- bit = ffs((int)sig);
+ /* bit = ffs((int)sig); */
sprintf(buf, "%s%s", c++ ? " " : "", -
signame[bit].name);
+ signame[i].name);
if ((len + strlen(buf)) > 80) {
shift_string_left(buf, 1);
fprintf(fp, "\n");
@@ -5827,19 +5858,19 @@
} else
use_sighand = FALSE;
- for (i = 1; i < _NSIG; i++) {
- fprintf(fp, "%s[%d] ", i < 10 ? " " : "", i);
+ for (i = 0; i < _NSIG; i++) {
+ fprintf(fp, "%s[%d] ", i+1 < 10 ? " " : "", i+1);
if (use_sighand) {
kaddr = sighand_struct +
OFFSET(sighand_struct_action) +
- ((i-1) * SIZE(k_sigaction));
+ ((i) * SIZE(k_sigaction));
uaddr = signal_buf + OFFSET(sighand_struct_action) +
- ((i-1) * SIZE(k_sigaction));
+ ((i) * SIZE(k_sigaction));
} else {
kaddr = signal_struct + OFFSET(signal_struct_action) +
- ((i-1) * SIZE(k_sigaction));
+ ((i) * SIZE(k_sigaction));
uaddr = signal_buf + OFFSET(signal_struct_action) +
- ((i-1) * SIZE(k_sigaction));
+ ((i) * SIZE(k_sigaction));
}
handler = ULONG(uaddr + OFFSET(sigaction_sa_handler));
----------------------------------------------------------------
Ce message a ete envoye par IMP, grace a l'Universite Paris 10 Nanterre
18 years, 2 months