Hi Stefano,

On 2012.11.12 12:06, Stefano Di Martino wrote:
> is this supposed to crash, when you don't free a list?
>
> for(i = 0; i < 100; i++) {
>      cnt = libusb_get_device_list(NULL, &devs);
>      if (cnt < 0)
>          return (int) cnt;
>      //if (i < 99)
>          //libusb_free_device_list(devs, 1);
> }

Probably not.

> It crashes btw only, if I have a Cherry keyboard attached:

1. What is the exact version of libusbx you are using (should be 
something like 1.0.14.10586)?
2. On which platform?
3. Have you tested only that platform, or are you seeing the problem on 
other platforms?
4. Have you tried other HID keyboards or devices? Did they also produce 
a crash, or was it just the Cherry one?
5. Does the app crash on exit or during the loop?
6. If it crashes on exit, you're calling libusb_exit() before closing 
your program, right? If you don't, there's of course not much we can do 
in terms of performing a clean exit.


Now, I am seeing the following issue with your code on Windows when 
running git latest, past the 32 mark:

libusbx: error [set_hid_interface] program assertion failed: max USB 
interfaces reached for HID device

So I guess that, at least with regards to HID on Windows, there is 
probably something that needs to be fixed (though the likelihood of 
someone making 32 concurrent calls to get_device_list is fairly low, so, 
while we definitely want to fix it ASAP, I wouldn't see it as high 
priority).

I'm also having a massive déjà vu with regards to issuing a bunch of 
get_device_list() in succession, to try to produce an error. I think we 
fixed something there not so long ago, but I can't figure out when that 
occurred. Pretty sure it was for libusbx, yet the thread where that 
happened eludes me...

Regards,

/Pete

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel

Reply via email to