portseal - tools to locate port management bugs =============================================== This is a collection of tools to find bugs related to Mach port handling like port leaks at runtime. libpinniped ----------- libpinniped wraps port manipulation functions (i.e. the glibc wrappers) with the help of the dynamic linker. If any of the wrapped functions fail, a message is written to stderr with a backtrace. % make -C libpinniped check make: Entering directory `.../portseal/libpinniped' LD_PRELOAD=./"libpinniped.so" ./test ./test: mach_port_deallocate (1, 12345): (os/kern) invalid name ./test(dosth+0x1b)[0x80486c8] ./test(main+0xb)[0x80486f2] /lib/i386-gnu/libc.so.0.3(__libc_start_main+0xbc)[0x109169c] ./test[0x80485d1] ./test: mach_port_destroy (1, 54321): (os/kern) invalid name ./test(dosthelse+0x1b)[0x80486e5] ./test(main+0x10)[0x80486f7] /lib/i386-gnu/libc.so.0.3(__libc_start_main+0xbc)[0x109169c] ./test[0x80485d1] make: Leaving directory `.../portseal/libpinniped' % addr2line -e libpinniped/test 0x80486c8 .../portseal/libpinniped/test.c:24