Showing posts with label mdb. Show all posts
Showing posts with label mdb. Show all posts

Monday, July 18, 2011

Example use

# mdb -k
Loading modules: [ unix krtld genunix ip usba logindmux ptm cpc ipc random nfs ]
> ::queue -v -m c7m3uart
0000030026cc1d30
> 0000030026cc1d30::q2stream
30026c5c940
> 30026c5c940::stream

+-----------------------+-----------------------+
| 0x30026cc8478         | 0x30026cc8388         |
| mom                   | mom                   |
|                       |                       |
| cnt = 0t0             | cnt = 0t0             |
| flg = 0x00004022      | flg = 0x00044032      |
+-----------------------+-----------------------+
            |                       ^
            v                       |
+-----------------------+-----------------------+
| 0x30026cc13e0         | 0x30026cc12f0         |
| c7tcap                | c7tcap                |
|                       |                       |
| cnt = 0t0             | cnt = 0t0             |
| flg = 0x00004022      | flg = 0x00004032      |
+-----------------------+-----------------------+
            |                       ^
            v                       |
+-----------------------+-----------------------+
| 0x30026cc0c30         | 0x30026cc0b40         |
| c7sccp                | c7sccp                |
|                       |                       |
| cnt = 0t0             | cnt = 0t0             |
| flg = 0x00004022      | flg = 0x00004032      |
+-----------------------+-----------------------+
            |                       ^
            v                       |
+-----------------------+-----------------------+
| 0x30026cc1e20         | 0x30026cc1d30         |
| c7m3uart              | c7m3uart              |
|                       |                       |
| cnt = 0t0             | cnt = 0t0             |
| flg = 0x00004022      | flg = 0x00004032      |
+-----------------------+-----------------------+
            |                       ^
            v                       |
+-----------------------+-----------------------+
| 0x30026cc81e8         | 0x30026cc80f8         |
| lom_                  | lom_                  |
|                       |                       |
| cnt = 0t0             | cnt = 0t0             |
| flg = 0x00244022      | flg = 0x00204032      |
+-----------------------+-----------------------+
> 

Redirect umalog output to a file:

echo ::umalog | mdb core.21878 > umalog.txt

watchmalloc how to (sangria)

Very slow!

cd /usr/lib/secure/64
suidwrap ln -s /usr/lib/64/watchmalloc.so.1
export LD_PRELOAD_64=/usr/lib/secure/64/watchmalloc.so.1
export MALLOC_DEBUG=WATCH,RW

libumem how to (sangria)

Requires Solaris 9 update 3, and above.

cd /usr/lib/secure/64
suidwrap ln -s /usr/lib/64/libumem.so.1

Then,

export LD_PRELOAD_64=/usr/lib/secure/64/libumem.so.1 
export UMEM_DEBUG=default
export UMEM_LOGGING=transaction
go.omni
gcore `pid guiserver`

If core “core.15604” is dumped, then

mdb core.15604

Memory leaks / Memory corruption