Bug 1024473

Summary: Memory leak reported by valgrind
Product: [Fedora] Fedora Reporter: Christophe Fergeau <cfergeau>
Component: libusbxAssignee: Hans de Goede <hdegoede>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: cfergeau, hdegoede, jv+fedora, lucilanga, novyjindrich, rhbugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-20 14:48:20 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Christophe Fergeau 2013-10-29 17:56:50 UTC
When running remote-viewer through valgrind, I got this trace:
==13623== 48 bytes in 2 blocks are definitely lost in loss record 7,424 of 13,299
==13623==    at 0x4A06409: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==13623==    by 0x6B52971: handle_events (io.c:1940)
==13623==    by 0x6B536F2: libusb_handle_events_timeout_completed (io.c:2126)
==13623==    by 0x6B537DE: libusb_handle_events (io.c:2202)
==13623==    by 0x5C18A69: spice_usb_device_manager_usb_ev_thread (usb-device-manager.c:1149)
==13623==    by 0x3D17C6EA04: g_thread_proxy (gthread.c:798)
==13623==    by 0x3134A07F32: start_thread (pthread_create.c:309)
==13623==    by 0x31342F4EAC: clone (clone.S:111)

This is with libusbx-1.0.17-1.fc20.x86_64 (happened with 1.0.16 as well).
I couldn't spot an obvious leak looking at the code. I can reliably reproduce it, so let me know if more tests are needed. I'm logging this here to not forget, let me know if this should go elsewhere.

Comment 1 Hans de Goede 2013-11-20 12:23:18 UTC
Hi,

I believe this may be fixed by the 3 commits I've just pushed to libusbx git:
https://github.com/libusbx/libusbx/commits/master

Can you build libusbx from master and give that a try?

Thanks & Regards,

Hans

Comment 2 Christophe Fergeau 2013-11-20 14:48:20 UTC
Hmm just tried to reproduce, but I did not manage to reproduce, even with f20 libusbx, and I did not leave enough details about the exact setup I was using :(
Let's just say it's fixed, and I'll reopen if I see that again.