From owner-freebsd-current@FreeBSD.ORG Wed Oct 2 06:24:18 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id D8928728 for ; Wed, 2 Oct 2013 06:24:18 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id 6A8452058 for ; Wed, 2 Oct 2013 06:24:18 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id 547867A125; Wed, 2 Oct 2013 08:24:16 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id BA9BA8F7954; Wed, 2 Oct 2013 08:24:37 +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 hY-R+i-9Qs+Q; Wed, 2 Oct 2013 08:24:36 +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 F248E8F7912; Wed, 2 Oct 2013 08:24:35 +0200 (CEST) Message-ID: <524BBC5A.6060108@bitfrost.no> Date: Wed, 02 Oct 2013 08:25:30 +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: John Subject: Re: gphoto2 bus error References: <20131001135021.GA56944@potato.growveg.org> In-Reply-To: <20131001135021.GA56944@potato.growveg.org> Content-Type: multipart/mixed; boundary="------------030305040700030006020803" Cc: freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 02 Oct 2013 06:24:18 -0000 This is a multi-part message in MIME format. --------------030305040700030006020803 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 10/01/13 15:50, John wrote: > sorry, forgot to change "From:", sending again > > On Tue, Oct 01, 2013 at 02:45:29PM +0100, John wrote: >> On Tue, Oct 01, 2013 at 02:41:22PM +0200, Hans Petter Selasky wrote: >>> >>> Hi, >>> >>> Could you enter "bt" in GDB and show the output when this crash happens? >>> >>> --HPS >> >> Sure! Thanks for looking at the problem. >> >> Program received signal SIGBUS, Bus error. >> [Switching to Thread 802c07400 (LWP 101021/scanimage)] >> 0x00000008063c1829 in scsi_inquiry () >> from /usr/local/lib/sane/libsane-microtek2.so.1 >> (gdb) bt >> #0 0x00000008063c1829 in scsi_inquiry () >> from /usr/local/lib/sane/libsane-microtek2.so.1 >> #1 0x00000008063b384c in attach () >> from /usr/local/lib/sane/libsane-microtek2.so.1 >> #2 0x00000008063b4a69 in attach_one () >> from /usr/local/lib/sane/libsane-microtek2.so.1 >> #3 0x000000080083205b in sanei_scsi_find_devices () >> from /usr/local/lib/libsane.so.1 >> #4 0x000000080082ef1e in sanei_config_attach_matching_devices () >> from /usr/local/lib/libsane.so.1 >> #5 0x00000008063b4993 in sane_microtek2_init () >> from /usr/local/lib/sane/libsane-microtek2.so.1 >> #6 0x000000080083acb4 in init () from /usr/local/lib/libsane.so.1 >> #7 0x000000080083a944 in sane_dll_get_devices () >> from /usr/local/lib/libsane.so.1 >> #8 0x0000000000402089 in ?? () >> #9 0x0000000000401c41 in ?? () >> #10 0x0000000800628000 in ?? () >> #11 0x0000000000000000 in ?? () >> (gdb) >> >> -- >> John > Hi, Can you try to apply the attached patch to: cd /usr/ports/graphics/sane-backends make clean extract patch cd /usr/ports/graphics/sane-backends/work/sane-backends-1.0.23 cat sane-backend-debug.diff | patch -p1 cd /usr/ports/graphics/sane-backends make all deinstall install Maybe you can figure out exactly what line is causing the crash by adding more printf's like shown in the attached patch. --HPS --------------030305040700030006020803 Content-Type: text/x-patch; name="sane-backend-debug.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sane-backend-debug.diff" diff --git a/backend/microtek2.c b/backend/microtek2.c index d56e568..1aafa80 100644 --- a/backend/microtek2.c +++ b/backend/microtek2.c @@ -4276,6 +4276,8 @@ scsi_send_gamma(Microtek2_Scanner *ms) /*---------- scsi_inquiry() --------------------------------------------------*/ +#include + static SANE_Status scsi_inquiry(Microtek2_Info *mi, char *device) { @@ -4286,6 +4288,7 @@ scsi_inquiry(Microtek2_Info *mi, char *device) size_t size; int sfd; + printf("A %p %s\n", mi, device); DBG(30, "scsi_inquiry: mi=%p, device='%s'\n", (void *) mi, device); @@ -4296,6 +4299,8 @@ scsi_inquiry(Microtek2_Info *mi, char *device) return status; } + printf("B\n"); + INQ_CMD(cmd); INQ_SET_ALLOC(cmd, INQ_ALLOC_L); result = (uint8_t *) alloca(INQ_ALLOC_L); @@ -4306,6 +4311,8 @@ scsi_inquiry(Microtek2_Info *mi, char *device) return SANE_STATUS_NO_MEM; } + printf("C\n"); + size = INQ_ALLOC_L; status = sanei_scsi_cmd(sfd, cmd, sizeof(cmd), result, &size); if ( status != SANE_STATUS_GOOD ) @@ -4315,6 +4322,8 @@ scsi_inquiry(Microtek2_Info *mi, char *device) return status; } + printf("D\n"); + INQ_GET_INQLEN(inqlen, result); INQ_SET_ALLOC(cmd, inqlen + INQ_ALLOC_L); result = alloca(inqlen + INQ_ALLOC_L); @@ -4328,6 +4337,8 @@ scsi_inquiry(Microtek2_Info *mi, char *device) if (md_dump >= 2 ) dump_area2(cmd, sizeof(cmd), "inquiry"); + printf("E\n"); + status = sanei_scsi_cmd(sfd, cmd, sizeof(cmd), result, &size); if ( status != SANE_STATUS_GOOD ) { @@ -4337,12 +4348,16 @@ scsi_inquiry(Microtek2_Info *mi, char *device) } sanei_scsi_close(sfd); + printf("F\n"); + if (md_dump >= 2 ) { dump_area2((uint8_t *) result, size, "inquiryresult"); dump_area((uint8_t *) result, size, "inquiryresult"); } + printf("G\n"); + /* copy results */ INQ_GET_QUAL(mi->device_qualifier, result); INQ_GET_DEVT(mi->device_type, result); @@ -4352,6 +4367,7 @@ scsi_inquiry(Microtek2_Info *mi, char *device) INQ_GET_REV(mi->revision, (char *)result); INQ_GET_MODELCODE(mi->model_code, result); + printf("H\n"); return SANE_STATUS_GOOD; } --------------030305040700030006020803--