From owner-freebsd-gnome@FreeBSD.ORG Tue Oct 1 11:44:08 2013 Return-Path: Delivered-To: gnome@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 5D7BD725; Tue, 1 Oct 2013 11:44:08 +0000 (UTC) (envelope-from hans.petter.selasky@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id E2616238B; Tue, 1 Oct 2013 11:44:07 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id E3DB57A0A0; Tue, 1 Oct 2013 13:44:05 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 194F08F48B0; Tue, 1 Oct 2013 13:44:27 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id e1-I4MHKuF6G; Tue, 1 Oct 2013 13:44:26 +0200 (CEST) Received: from laptop015.home.selasky.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id ECE878F489C; Tue, 1 Oct 2013 13:44:25 +0200 (CEST) Message-ID: <524AB5D1.1000503@bitfrost.no> Date: Tue, 01 Oct 2013 13:45:21 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Artyom Mirgorodskiy Subject: Re: gphoto2 bus error References: <1430354.OSvlCO8lK8@notebook.alkar.net> <60028529.ObLm6B0bQB@notebook.alkar.net> <524AA6A3.6050203@bitfrost.no> <2203393.ZaYDNWG94H@notebook.alkar.net> In-Reply-To: <2203393.ZaYDNWG94H@notebook.alkar.net> Content-Type: multipart/mixed; boundary="------------000902030100020203080203" Cc: gnome@FreeBSD.org, "freebsd-current@freebsd.org" X-BeenThere: freebsd-gnome@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: GNOME for FreeBSD -- porting and maintaining List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Oct 2013 11:44:08 -0000 This is a multi-part message in MIME format. --------------000902030100020203080203 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/01/13 13:11, Artyom Mirgorodskiy wrote: > I removed old libraries: > > ls /usr/lib/libusb* > /usr/lib/libusb.a /usr/lib/libusb_p.a /usr/lib/libusbhid.so.4 > /usr/lib/libusb.so@ /usr/lib/libusbhid.a /usr/lib/libusbhid_p.a > /usr/lib/libusb.so.3 /usr/lib/libusbhid.so@ > > and reinstall gphoto2 and libgphoto2 > and have the same result :( > Hi, I quickly looked at the gphoto code and see some bugs there. Can you try the attached patch? cd /usr/ports/graphics/libgphoto2 make clean extract patch cd /usr/ports/graphics/libgphoto2/work/libgphoto2-2.4.14 cat libgphoto2.patch | patch -p1 cd /usr/ports/graphics/libgphoto2 make all deinstall install --HPS --------------000902030100020203080203 Content-Type: text/x-patch; name="libgphoto2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="libgphoto2.patch" diff --git a/libgphoto2_port/libusb1/libusb1.c b/libgphoto2_port/libusb1/libusb1.c index c6b16aa..74b722f 100644 --- a/libgphoto2_port/libusb1/libusb1.c +++ b/libgphoto2_port/libusb1/libusb1.c @@ -84,6 +84,14 @@ static int gp_nrofdevs = 0; static struct libusb_device_descriptor *gp_descs; static libusb_device **gp_devs; +static void +free_devicelist(void) +{ + if (gp_devs != NULL) + libusb_free_device_list (gp_devs, 1); + gp_devs = NULL; +} + static ssize_t load_devicelist (libusb_context *ctx) { time_t xtime; @@ -91,7 +99,7 @@ load_devicelist (libusb_context *ctx) { time(&xtime); if (xtime != gp_devslastchecked) { if (gp_nrofdevs) - libusb_free_device_list (gp_devs, 1); + free_devicelist(); free (gp_descs); gp_nrofdevs = 0; gp_devs = NULL; @@ -267,12 +275,14 @@ static int gp_port_usb_init (GPPort *port) static int gp_port_usb_exit (GPPort *port) { + /* devices must be freed before exiting the USB context */ + free_devicelist(); + if (port->pl) { libusb_exit (port->pl->ctx); free (port->pl); port->pl = NULL; } - if (gp_devs) libusb_free_device_list (gp_devs, 1); free (gp_descs); return (GP_OK); } --------------000902030100020203080203--