Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Killing a zombie process?



On Fri, 2 Oct 2015, Paul Goyette wrote:

Still trying to track this down....

A modified version of ps(1) shows that the process state is clearly LSZOMB and not LSDEAD. Furthermore, "ps -s" doesn't show any LWP for the zombie process, so it would seem that process clean up has progressed relatively far.

I was able to use "ps axl -O paddr" to get the address of the process's struct proc, but I don't seem to be able to examine it with gdb.

#  ps axl -O paddr | grep Z
UID PID PADDR PPID CPU PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND 1000 25032 fffffe810f45ea40 2214 0 43 0 2240 48 - R+ pts/1 0:00.00 grep Z 0 21120 fffffe81f578ba70 1 0 0 0 0 0 - Z pts/2 0:00.00 (sh)
#  gdb /dev/mem
GNU gdb (GDB) 7.9.1
...
This GDB was configured as "x86_64--netbsd".
...
(gdb) symbol-file /netbsd.gdb
Reading symbols from /netbsd.gdb...done.
(gdb) print (struct proc *) 0xfffffe81f578ba70
warning: value truncated
$1 = (struct proc *) 0xfffffe81f578ba70
(gdb)


Any clue on how to properly access kernel memory here, without having the address truncated to 32-bits?

TIA

For now, I took a quick look into the zombie's struct proc.

	p_exitsig = 0x14   = SIGCHILD
	p_flag    = 0x0
	p_sflag   = 0x2000 = PS_WEXIT
	p_slflag  = 0x0
	p_lflag   = 0x2    = PL_CONTROLT
	p_stflag  = 0x0
	p_stat    = 0x5    = SZOMB

	p_trace_enabled = 0x0
	p_pid     = 0x5280 = 21120 (the same value shown by ps)

I don't see anything unusual here.

I have attached the hex-dump in case anyone wants to look a little bit closer.



+------------------+--------------------------+-------------------------+
| Paul Goyette     | PGP Key fingerprint:     | E-mail addresses:       |
| (Retired)        | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com    |
| Kernel Developer | 0786 F758 55DE 53BA 7731 | pgoyette at netbsd.org  |
+------------------+--------------------------+-------------------------+
fffffe81f578ba70:       0           0           806be700    ffffffff    0           0           fbb7a840    fffffe81
fffffe81f578ba90:       801         0           0           0           0           0           f578baa0    fffffe81
fffffe81f578bab0:       804d542e    ffffffff    0           0           f578bab8    fffffe81    804e7f9a    ffffffff
fffffe81f578bad0:       ef0106c0    fffffe81    f46f680     fffffe81    0           0           e00b5700    fffffe81
fffffe81f578baf0:       55fe8de8    fffffe81    80722de0    ffffffff    3be9b258    fffffe80    0           0
fffffe81f578bb10:       0           7f7f        0           0           fffffff0    ffffffff    14          0
fffffe81f578bb30:       2000        0           2           0           f6830005    5280        0           0
fffffe81f578bb50:       eab655b0    fffffe81    f45ecd0     fffffe81    1de352a0    fffffe82    fc805108    fffffe81
fffffe81f578bb70:       0           0           21ccb560    fffffe80    0           0           1           1
fffffe81f578bb90:       0           0           0           1           0           0           0           0
fffffe81f578bbb0:       0           0           0           0           0           9000        45b2        0
fffffe81f578bbd0:       0           0           0           0           0           0           0           0
fffffe81f578bbf0:       0           0           0           0           0           0           0           0
fffffe81f578bc10:       0           0           e6023190    fffffe81    806b6300    ffffffff    0           0
fffffe81f578bc30:       808be0e0    ffffffff    0           0           0           0           0           0
fffffe81f578bc50:       f578bc48    fffffe81    0           0           0           0           0           0
fffffe81f578bc70:       1           0           0           0           0           0           0           0
fffffe81f578bc90:       ffffffff    ffffffff    ffffffff    ffffffff    0           0           0           0
fffffe81f578bcb0:       687314      656b        0           0           0           0           eab655b0    fffffe81
fffffe81f578bcd0:       ffffffe0    7f7f        0           10000       0           7f7f        8012f010    ffffffff
fffffe81f578bcf0:       0           7f80        f683b8e6    7f7f        deaddead    fffffe81    0           0
fffffe81f578bd10:       f578b558    fffffe81    24bf9400    fffffe80    fffffff0    ffffffff    0           0
fffffe81f578bd30:       0           0           f578bd30    fffffe81    8049abd4    ffffffff    0           0
fffffe81f578bd50:       f578bd48    fffffe81    8049abd4    ffffffff    e50db0c0    fffffe81    f79e380     fffffe81
fffffe81f578bd70:       0           0           f48a4c48    fffffe81    80723120    ffffffff    80722de0    ffffffff
fffffe81f578bd90:       213f4228    fffffe81    0           0           0           7f7f        0           0
fffffe81f578bdb0:       fffffff0    ffffffff    14          4100        2000        0           0           0
fffffe81f578bdd0:       1           4243        0           0           f6b53390    fffffe81    f6b532b8    fffffe81
fffffe81f578bdf0:       0           0           f6b533b8    fffffe81    0           0           ba83d9c0    fffffe81
fffffe81f578be10:       0           0           1           1           0           0           0           1
fffffe81f578be30:       0           0           0           0           e948340     fffffe82    0           0
fffffe81f578be50:       0           0           604c        0           0           0           0           0
fffffe81f578be70:       0           0           0           0           0           0           0           0
fffffe81f578be90:       0           0           0           0           0           0           f52f2d00    fffffe81
fffffe81f578beb0:       806b6300    ffffffff    0           0           808be0e0    ffffffff    0           0
fffffe81f578bed0:       0           0           0           0           f578bed8    fffffe81    0           0
fffffe81f578bef0:       0           0           0           0           238b        0           0           0
fffffe81f578bf10:       0           0           0           0           ffffffff    ffffffff    ffffffff    ffffffff
fffffe81f578bf30:       0           0           0           0           72746114    6e75        0           0
fffffe81f578bf50:       0           0           0           0           ffffffe0    7f7f        0           0
fffffe81f578bf70:       0           0           8012f010    ffffffff    0           7f80        0           0
fffffe81f578bf90:       0           0           0           0           33330003    0           0           0
fffffe81f578bfb0:       0           0           0           0           0           0           e17cbfc8    fffffe81
fffffe81f578bfd0:       f6b53fc8    fffffe81    0           0           f6916d78    7f7f        f578b000    fffffe81
fffffe81f578bff0:       2c          300004      f578b550    fffffe81    0           0           0           0
fffffe81f578c010:       0           0           0           0           0           0           0           0
fffffe81f578c030:       0           0           0           0           0           0           0           0
fffffe81f578c050:       0           0           0           0           0           0           0           0
fffffe81f578c070:       0           0           0           0           0           0           0           0
fffffe81f578c090:       0           0           0           0           0           0           0           0
fffffe81f578c0b0:       0           0           0           0           0           0           0           0
fffffe81f578c0d0:       0           0           0           0           0           0           0           0
fffffe81f578c0f0:       0           0           0           0           0           0           0           0
fffffe81f578c110:       0           0           0           0           0           0           0           0
fffffe81f578c130:       0           0           0           0           0           0           0           0
fffffe81f578c150:       0           0           0           0           0           0           0           0
fffffe81f578c170:       0           0           0           0           0           0           0           0
fffffe81f578c190:       0           0           0           0           0           0           0           0
fffffe81f578c1b0:       0           0           0           0           0           0           0           0
fffffe81f578c1d0:       0           0           0           0           0           0           0           0
fffffe81f578c1f0:       0           0           0           0           0           0           0           0
fffffe81f578c210:       0           0           0           0           0           0           0           0
fffffe81f578c230:       0           0           0           0           0           0           0           0


Home | Main Index | Thread Index | Old Index