Project

General

Profile

Bug #4062 » leaks_share.sh

Marcel Telka, 2013-08-20 03:02 PM

 
1
#!/bin/sh
2

    
3
DEVICE=`pwd`/testpool
4
POOL=testpool
5
CHILD=$POOL/child0
6

    
7
gcc -g -o leaks_share leaks_share.c -lzfs
8

    
9
mkfile 100m $DEVICE
10
zpool create $POOL $DEVICE
11

    
12

    
13
LD_LIBRARY_PATH=. LD_PRELOAD=libumem.so UMEM_DEBUG=default ./leaks_share $CHILD &
14
sleep 1
15
PID=$!
16
echo "started PID:"$PID
17
echo "find leaks in "$PID
18
echo "::findleaks -dv" | mdb -p $PID
19
echo "killing "$PID
20
kill $PID
21

    
22

    
23
zpool destroy $POOL
24
rm -f $DEVICE
(1-1/2)