|
From: Vasanta <vt...@gm...> - 2010-01-20 21:53:03
|
Downloaded latest libusb and libusb-compat modules, loaded onto Embedded target, testing with pcsc-lite, I can see lot of memory leaks in libusb code, any idea how can I get fix?. ==7070== Warning: noted but unhandled ioctl 0x5514 with no size/direction hints ==7070== This could cause spurious value errors to appear. ==7070== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper. ==7070== Invalid read of size 1 ==7070== at 0x4035496: pthread_mutex_destroy (in /lib/libpthread-2.5.so) ==7070== by 0x4D97B61: CCIDSlotClose (common.c:3144) ==7070== by 0x4D95D79: IFDHCloseChannel (ifdhandler.c:254) ==7070== by 0x804E2E8: IFDCloseIFD (ifdwrapper.c:216) ==7070== by 0x804FB0E: RFUnInitializeReader (readerfactory.c:1075) ==7070== by 0x80507D3: RFRemoveReader (readerfactory.c:418) ==7070== by 0x8050A65: RFCleanupReaders (readerfactory.c:1286) ==7070== by 0x804EFA3: main (pcscdaemon.c:185) ==7070== Address 0x41b1ee4 is 124 bytes inside a block of size 144 free'd ==7070== at 0x4021520: free (vg_replace_malloc.c:325) ==7070== by 0x4D97B47: CCIDSlotClose (common.c:3141) ==7070== by 0x4D95D79: IFDHCloseChannel (ifdhandler.c:254) ==7070== by 0x804E2E8: IFDCloseIFD (ifdwrapper.c:216) ==7070== by 0x804FB0E: RFUnInitializeReader (readerfactory.c:1075) ==7070== by 0x80507D3: RFRemoveReader (readerfactory.c:418) ==7070== by 0x8050A65: RFCleanupReaders (readerfactory.c:1286) ==7070== by 0x804EFA3: main (pcscdaemon.c:185) ==7070== ==7070== Invalid read of size 4 ==7070== at 0x403549C: pthread_mutex_destroy (in /lib/libpthread-2.5.so) ==7070== by 0x4D97B61: CCIDSlotClose (common.c:3144) ==7070== by 0x4D95D79: IFDHCloseChannel (ifdhandler.c:254) ==7070== by 0x804E2E8: IFDCloseIFD (ifdwrapper.c:216) ==7070== by 0x804FB0E: RFUnInitializeReader (readerfactory.c:1075) ==7070== by 0x80507D3: RFRemoveReader (readerfactory.c:418) ==7070== by 0x8050A65: RFCleanupReaders (readerfactory.c:1286) ==7070== by 0x804EFA3: main (pcscdaemon.c:185) ==7070== Address 0x41b1ee8 is 128 bytes inside a block of size 144 free'd ==7070== at 0x4021520: free (vg_replace_malloc.c:325) ==7070== by 0x4D97B47: CCIDSlotClose (common.c:3141) ==7070== by 0x4D95D79: IFDHCloseChannel (ifdhandler.c:254) ==7070== by 0x804E2E8: IFDCloseIFD (ifdwrapper.c:216) ==7070== by 0x804FB0E: RFUnInitializeReader (readerfactory.c:1075) ==7070== by 0x80507D3: RFRemoveReader (readerfactory.c:418) ==7070== by 0x8050A65: RFCleanupReaders (readerfactory.c:1286) ==7070== by 0x804EFA3: main (pcscdaemon.c:185) ==7070== ==7070== Invalid write of size 4 ==7070== at 0x40354A8: pthread_mutex_destroy (in /lib/libpthread-2.5.so) ==7070== by 0x4D97B61: CCIDSlotClose (common.c:3144) ==7070== by 0x4D95D79: IFDHCloseChannel (ifdhandler.c:254) ==7070== by 0x804E2E8: IFDCloseIFD (ifdwrapper.c:216) ==7070== by 0x804FB0E: RFUnInitializeReader (readerfactory.c:1075) ==7070== by 0x80507D3: RFRemoveReader (readerfactory.c:418) ==7070== by 0x8050A65: RFCleanupReaders (readerfactory.c:1286) ==7070== by 0x804EFA3: main (pcscdaemon.c:185) ==7070== Address 0x41b1ee4 is 124 bytes inside a block of size 144 free'd ==7070== at 0x4021520: free (vg_replace_malloc.c:325) ==7070== by 0x4D97B47: CCIDSlotClose (common.c:3141) ==7070== by 0x4D95D79: IFDHCloseChannel (ifdhandler.c:254) ==7070== by 0x804E2E8: IFDCloseIFD (ifdwrapper.c:216) ==7070== by 0x804FB0E: RFUnInitializeReader (readerfactory.c:1075) ==7070== by 0x80507D3: RFRemoveReader (readerfactory.c:418) ==7070== by 0x8050A65: RFCleanupReaders (readerfactory.c:1286) ==7070== by 0x804EFA3: main (pcscdaemon.c:185) ==7070== conntrack v0.9.13 (conntrack-tools): connection tracking table has been emptied. ==7070== Thread 17: ==7070== Invalid free() / delete / delete[] ==7070== at 0x4021520: free (vg_replace_malloc.c:325) ==7070== by 0x413C0ED: ??? (in /lib/libc-2.5.so) ==7070== by 0x413BC71: ??? (in /lib/libc-2.5.so) ==7070== by 0x401D4C3: _vgnU_freeres (vg_preloaded.c:62) ==7070== Address 0x416d2c0 is not stack'd, malloc'd or (recently) free'd ==7070== ==7070== ==7070== HEAP SUMMARY: ==7070== in use at exit: 57,351 bytes in 171 blocks ==7070== total heap usage: 4,197 allocs, 4,027 frees, 951,213 bytes allocated ==7070== # # # ==7070== Thread 1: ==7070== 12 bytes in 1 blocks are definitely lost in loss record 2 of 32 ==7070== at 0x40218E4: malloc (vg_replace_malloc.c:195) ==7070== by 0x4D9B6B6: ??? ==7070== by 0x4D9BB1A: ??? ==7070== by 0x4D95548: ??? ==7070== by 0x804DD45: IFDControl (ifdwrapper.c:624) ==7070== by 0x8053D51: SCardControl (winscard.c:1436) ==7070== by 0x8056F8C: ContextThread (winscard_svc.c:455) ==7070== by 0x4033282: start_thread (in /lib/libpthread-2.5.so) ==7070== by 0x4101C6D: clone (in /lib/libc-2.5.so) ==7070== ==7070== 16 bytes in 1 blocks are possibly lost in loss record 3 of 32 ==7070== at 0x40218E4: malloc (vg_replace_malloc.c:195) ==7070== by 0x41723B2: usbi_add_pollfd (io.c:2179) ==7070== by 0x41734FF: usbi_io_init (io.c:1015) ==7070== by 0x4170F74: libusb_init (core.c:1484) ==7070== by 0x4028C8E: usb_init (core.c:145) ==7070== by 0x804D6BC: HPEstablishUSBNotifications (hotplug_libusb.c:390) ==7070== by 0x4033282: start_thread (in /lib/libpthread-2.5.so) ==7070== by 0x4101C6D: clone (in /lib/libc-2.5.so) ==7070== ==7070== 54 bytes in 3 blocks are possibly lost in loss record 13 of 32 ==7070== at 0x40218E4: malloc (vg_replace_malloc.c:195) ==7070== by 0x417630B: enumerate_device (linux_usbfs.c:733) ==7070== by 0x4176927: op_get_device_list (linux_usbfs.c:854) ==7070== by 0x41706AA: libusb_get_device_list (core.c:605) ==7070== by 0x4028362: usb_find_devices (core.c:579) ==7070== by 0x804D175: HPRescanUsbBus (hotplug_libusb.c:255) ==7070== by 0x804D6C1: HPEstablishUSBNotifications (hotplug_libusb.c:393) ==7070== by 0x4033282: start_thread (in /lib/libpthread-2.5.so) ==7070== by 0x4101C6D: clone (in /lib/libc-2.5.so) ==7070== ==7070== 136 bytes in 1 blocks are possibly lost in loss record 17 of 32 ==7070== at 0x4020CC1: calloc (vg_replace_malloc.c:418) ==7070== by 0x40102C8: allocate_dtv (in /lib/ld-2.5.so) ==7070== by 0x401038B: _dl_allocate_tls (in /lib/ld-2.5.so) ==7070== by 0x4033A7F: pthread_create@@GLIBC_2.1 (in /lib/libpthread-2.5.so) ==7070== by 0x8051E41: SYS_ThreadCreate (thread_unix.c:81) ==7070== by 0x8055F8C: CreateContextThread (winscard_svc.c:100) ==7070== by 0x804F00A: main (pcscdaemon.c:148) ==7070== ==7070== 143 bytes in 3 blocks are possibly lost in loss record 18 of 32 ==7070== at 0x40218E4: malloc (vg_replace_malloc.c:195) ==7070== by 0x4175649: cache_active_config (linux_usbfs.c:610) ==7070== by 0x4176366: enumerate_device (linux_usbfs.c:758) ==7070== by 0x4176927: op_get_device_list (linux_usbfs.c:854) ==7070== by 0x41706AA: libusb_get_device_list (core.c:605) ==7070== by 0x4028362: usb_find_devices (core.c:579) ==7070== by 0x804D175: HPRescanUsbBus (hotplug_libusb.c:255) ==7070== by 0x804D6C1: HPEstablishUSBNotifications (hotplug_libusb.c:393) ==7070== by 0x4033282: start_thread (in /lib/libpthread-2.5.so) ==7070== by 0x4101C6D: clone (in /lib/libc-2.5.so) ==7070== ==7070== 3,944 bytes in 29 blocks are possibly lost in loss record 28 of 32 ==7070== at 0x4020CC1: calloc (vg_replace_malloc.c:418) ==7070== by 0x40102C8: allocate_dtv (in /lib/ld-2.5.so) ==7070== by 0x401038B: _dl_allocate_tls (in /lib/ld-2.5.so) ==7070== by 0x4033A7F: pthread_create@@GLIBC_2.1 (in /lib/libpthread-2.5.so) ==7070== by 0x4D9B6EC: ??? ==7070== by 0x4D9BB1A: ??? ==7070== by 0x4D95548: ??? ==7070== by 0x804DD45: IFDControl (ifdwrapper.c:624) ==7070== by 0x8053D51: SCardControl (winscard.c:1436) ==7070== by 0x8056F8C: ContextThread (winscard_svc.c:455) ==7070== by 0x4033282: start_thread (in /lib/libpthread-2.5.so) ==7070== by 0x4101C6D: clone (in /lib/libc-2.5.so) ==7070== ==7070== LEAK SUMMARY: ==7070== definitely lost: 12 bytes in 1 blocks ==7070== indirectly lost: 0 bytes in 0 blocks ==7070== possibly lost: 4,293 bytes in 37 blocks ==7070== still reachable: 53,046 bytes in 133 blocks ==7070== suppressed: 0 bytes in 0 blocks ==7070== Reachable blocks (those to which a pointer was found) are not shown. ==7070== To see them, rerun with: --leak-check=full --show-reachable=yes ==7070== ==7070== For counts of detected and suppressed errors, rerun with: -v ==7070== ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 9 from 9) |