I debugged this a while ago and it is very tricky ;) Basically: libgphoto2 loads and unloads its usb drivers. one of them is the usb0 driver. The usb0 driver on load starts a pthread to communicate with udev. on tear down, it tries to kill this thread again, but as this happens in "dlclose()" the thread cannot terminate due to a deadlock. After debugging the best way is probably to no longer build the old libusb 0 driver anymore, as the libusb 1 driver works nicely.