I am having a hard time starting my mdb journey.

First the problem.
I was playing with zfs on a firewire disk (x86 64bit).
While copying a directory from ufs to zfs, the cp command hung:

# pstack 711
711:    cp -r /export/share/tc .
 fef6a907 open64   (8044e90, 0, 17)
 fef5c4d9 open64   (8044e90, 0) + 97
 0805251f cpymve   (8044e90, 8066e80) + 59c
 08053646 rcopy    (8045ce0, 8067298) + 116
 08053ca0 copydir  (8045ce0, 8067298) + 25d
 0805277b cpymve   (8045ce0, 8067298) + 7f8
 08053646 rcopy    (8046b30, 8067100) + 116
 08053ca0 copydir  (8046b30, 8067100) + 25d
 0805277b cpymve   (8046b30, 8067100) + 7f8
 08053646 rcopy    (8047d7e, 80676f0) + 116
 08053ca0 copydir  (8047d7e, 80676f0) + 25d
 0805277b cpymve   (8047d7e, 80676f0) + 7f8
 08051b65 main     (4, 8047cb0, 8047cc4) + 467
 0805164e ???????? (4, 8047d78, 8047d7b, 8047d7e, 8047d8f, 0)

/export/share/tc is on ufs, local disk.
Current directory (/firewire/zfs) is on zfs, firewire disk:

# zpool status
  pool: firewire
 state: ONLINE
 scrub: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        firewire    ONLINE       0     0     0
          c4t0d0p1  ONLINE       0     0     0


# zfs list
NAME                   USED  AVAIL  REFER  MOUNTPOINT
firewire              5.80M  36.7G  8.50K  /firewire
firewire/zfs          5.75M  36.7G  5.75M  /firewire/zfs

FWIW, while cp command was proceeding, I deleted a newly copied
1.6GB file in the target directory (in fact I am not sure
the copy of that file has finished or not when I deleted it).
Then I noticed that I/O activities stopped but cp command didn't
return to the prompt.

Naturally, I want to check the kernel stack to see what's
blocking the open call, and which file it's trying to open.

mdb seems to be much more complicated than something like kdb in AIX,
although it does provide more functionality from what I read.

In AIX kdb I'll run:

kdb> th -n cp  <== get the thread slot number for cp command
kdb> f <slot>  <== print the kernel stack for that thread

Then from the stack frame I may find the vnode/inode pointer.

In mdb, how do I set an "active process/thread" in order
to get the stack?

mdb> $c
mdb: no process active

I am very interested to see how you debug this kind of problem
on Solaris. I hate to say this, but the documentation really
doesn't help much for a newbie.

I don't know if this problem can be reproduced at will.
Right now 'cp' is still hanging.
I may shutdown the machine before go to sleep though.

Thanks in advance.

Tao
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://mail.opensolaris.org/pipermail/mdb-discuss/attachments/20051127/131b7bcc/attachment.html>

Reply via email to