Hi,
On 06/14/2013 11:31 AM, Xiaofan Chen wrote:
On Fri, Jun 14, 2013 at 4:08 PM, Hans de Goede <hdego...@redhat.com> wrote:
Hmm, as Nathan has already pointed out this is caused by pthread_create
failing. I think you may be running out of resources and/or hitting
a ulimit.
This may also be related to the udev fd not being non-blocking issue
Chris Dickens reported.
I've just pushed 2 patches to master, one to log the error code when
pthread_create fails, and a cleaned-up version of Chris' non-blocking
patch.
Can you please retry with the latest master, and tell us what the error
code is (if it still fails) ?
It still fails.
Hmm, ok, error 11 is EAGAIN, so indeed you're running out of some resource.
Can you give the attached patch a try please ?
Regards,
Hans
>From 170399a85efe90cdc8f42e937b94e39cc3e43e21 Mon Sep 17 00:00:00 2001
From: Hans de Goede <hdego...@redhat.com>
Date: Fri, 14 Jun 2013 11:51:38 +0200
Subject: [PATCH] linux_udev: Join the hotplug-event-thread when we stop event
monitoring
To ensure that it is stopped before we continue (and if later libusb
gets re-initialized start another thread).
Signed-off-by: Hans de Goede <hdego...@redhat.com>
---
libusb/os/linux_udev.c | 11 ++++++-----
libusb/version_nano.h | 2 +-
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/libusb/os/linux_udev.c b/libusb/os/linux_udev.c
index 29c949a..abecdd4 100644
--- a/libusb/os/linux_udev.c
+++ b/libusb/os/linux_udev.c
@@ -119,16 +119,17 @@ int linux_udev_stop_event_monitor(void)
assert(udev_monitor != NULL);
assert(udev_monitor_fd != -1);
- /* Cancel the event thread. This is the only way to garauntee the thread
- exits since closing the monitor fd won't necessarily cause poll
- to return. */
- pthread_cancel(linux_event_thread);
-
/* Release the udev monitor */
udev_monitor_unref(udev_monitor);
udev_monitor = NULL;
udev_monitor_fd = -1;
+ /* Cancel the event thread. This is the only way to garauntee the
+ thread exits since closing the monitor fd won't necessarily cause
+ poll to return. */
+ pthread_cancel(linux_event_thread);
+ pthread_join(linux_event_thread, NULL);
+
/* Clean up the udev context */
udev_unref(udev_ctx);
udev_ctx = NULL;
diff --git a/libusb/version_nano.h b/libusb/version_nano.h
index 5a98334..60306bf 100644
--- a/libusb/version_nano.h
+++ b/libusb/version_nano.h
@@ -1 +1 @@
-#define LIBUSB_NANO 10741
+#define LIBUSB_NANO 10742
--
1.8.2.1
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel