[sane-devel] Segfault with Lide210

stef stef.dev at free.fr
Fri Sep 23 18:07:41 UTC 2011


Le vendredi 23 septembre 2011 14:40:26, vous avez écrit :
> Hi Stef,
> 
> thanks again for the response!
> 
> Here is the gdb output, hope that it helps:
> 
> uli at pu:~/build/sane-1.0.22/sane-backends$
> gdb ./frontend/.libs/scanimage
> GNU gdb 6.8-debian
> Copyright (C) 2008 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.  Type "show
> copying"
> and "show warranty" for details.
> This GDB was configured as "i486-linux-gnu"...
> (gdb) r -v --resolution 75 -l 10 -t 10 -x 100 -y 100 --format=tiff >
> myimage.tiff
> Starting
> program: /home/uli/build/sane-1.0.22/sane-backends/frontend/.libs/scanimage
> -v --resolution 75 -l 10 -t 10 -x 100 -y 100 --format=tiff > myimage.tiff
> [Thread debugging using libthread_db enabled]
> Error while reading shared library symbols:
> Cannot find new threads: generic error
> Cannot find new threads: generic error
> (gdb) c
> Continuing.
> [New Thread 0xb74b66b0 (LWP 16190)]
> scanimage: scanning image of size 292x295 pixels at 8 bits/pixel
> scanimage: acquiring gray frame
> scanimage: min/max graylevel value = 24/255
> scanimage: read 86140 bytes in total
> 
> Program received signal SIGSEGV, Segmentation fault.
> [Switching to Thread 0xb74b66b0 (LWP 16190)]
> 0xb761636d in fclose@@GLIBC_2.1 () from /lib/tls/i686/cmov/libc.so.6
> (gdb) bt
> #0  0xb761636d in fclose@@GLIBC_2.1 () from /lib/tls/i686/cmov/libc.so.6
> #1  0xb6dfee31 in sane_genesys_cancel (handle=0x8080840) at \
>                                                    genesys.c:7906
> #2  0xb7794ddf in sane_dll_cancel (handle=0x80812e0) at dll.c:1283
> #3  0xb778323d in sane_cancel (h=0x80812e0) at dll-s.c:72
> #4  0x0804d0a3 in main (argc=13, argv=0xbfd22b14) at scanimage.c:2350
> (gdb) f 1
> #1  0xb6dfee31 in sane_genesys_cancel (handle=0x8080840) at
> genesys.c:7906
> 7906	      fclose(s->dev->binary);
> (gdb) l
> 7901	  DBG (DBG_proc, "sane_cancel: start\n");
> 7902
> 7903	  /* end binary logging if needed */
> 7904	  if (s->dev->binary!=NULL)
> 7905	    {
> 7906	      fclose(s->dev->binary);
> 7907	      s->dev->binary=NULL;
> 7908	    }
> 7909
> 7910	  s->scanning = SANE_FALSE;
> (gdb)
> 
> Somehow the 'binary' seems not to be closable.
> 
> Best regards,

	Hello,

	this variable is never initialized, could you try after applying and 
compiling this inlined patch ?

--- a/backend/genesys.c
+++ b/backend/genesys.c
@@ -6999,6 +6999,7 @@ sane_open (SANE_String_Const devicename, SANE_Handle * 
handle)
   s->dev->line_count = 0;
   s->dev->segnb = 0;
   s->dev->oe_buffer.buffer=NULL;
+  s->dev->binary=NULL;
 
   /* insert newly opened handle into list of open handles: */
   s->next = first_handle;

Regards,
	Stef



More information about the sane-devel mailing list