[sane-devel] saned problems with 1.0.10-pre3 (incl. segfault)

Lee Howard faxguy@howardsilvan.com
Tue, 28 Jan 2003 17:04:39 -0800


On 2003.01.28 12:38 Henning Meier-Geinitz wrote:

> From man saned: "Note that both examples assume that there is a saned
>        group and a saned user.  If you follow this example, please
>        make sure that the access permissions on the special device are
>        set such that saned can access the scanner (the program
>        generally needs read and write access to scanner devices)." :-)

Somehow I missed that. :-)  Sorry.


> So I assume it's a plustek problem even if I don't see any obvious
> bug.
> 
> > [dll] load: dlopen()ing `/usr/lib/sane/libsane-net.so.1'
> > [dll] init: initializing backend `net'
> > [dll] init: backend `net' is version 1.0.10
> > Segmentation fault (core dumped)
> 
> Looks like it happens in sane_open. Please Try setting "export
> SANE_DEBUG_PLUSTEK=255" also

Here you go...

[saned] main: starting debug mode (level 128)
[saned] main: trying to get port for service `sane' (getservbyname)
[saned] main: port is 6566
[saned] main: socket ()
[saned] main: setsockopt ()
[saned] main: bind ()
[saned] main: listen ()
[saned] main: waiting for control connection
[saned] saned from sane-backends 1.0.10-pre3 ready
[saned] check_host: access by remote host: 192.168.0.3
[saned] check_host: remote host is not IN_LOOPBACK
[saned] check_host: local hostname: bilbo.x101.com
[saned] check_host: local hostname (from DNS): bilbo.x101.com
[saned] check_host: local host address (from DNS): 192.168.0.1
[saned] check_host: remote host doesn't have same addr as local
[saned] check_host: opening config file: /etc/hosts.equiv
[saned] check_host: can't open config file: /etc/hosts.equiv (No such 
file or directory)
[saned] check_host: opening config file: saned.conf
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# saned.conf'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# The contents of the saned.conf 
file is a list of host'
[saned] check_host: config file line: `# names or IP addresses that are 
permitted by saned to'
[saned] check_host: config file line: `# use local SANE devices in a 
networked configuration.'
[saned] check_host: config file line: `# The hostname matching is not 
case-sensitive.'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `#scan-client.somedomain.firm'
[saned] check_host: config file line: `#192.168.0.1'
[saned] check_host: config file line: `#'
[saned] check_host: config file line: `# NOTE: /etc/inetd.conf (or 
/etc/xinetd.conf) and'
[saned] check_host: config file line: `# /etc/services must also be 
properly configured to start'
[saned] check_host: config file line: `# the saned daemon as documented 
in saned(1), services(4)'
[saned] check_host: config file line: `# and inetd.conf(4) (or 
xinetd.conf(5)).'
[saned] check_host: config file line: `'
[saned] check_host: config file line: `192.168.0.1'
[saned] check_host: config file line: `192.168.0.2'
[saned] check_host: config file line: `192.168.0.3'
[saned] init: access by root@192.168.0.3 accepted
[sanei_debug] Setting debug level of dll to 128.
[dll] sane_init: SANE dll backend version 1.0.8 from sane-backends 
1.0.10-pre3
[dll] add_backend: adding backend `net'
[dll] add_backend: adding backend `plustek'
[saned] process_request: waiting for request
[saned] process_request: got request 2
[dll] load: searching backend `plustek' in `/usr/lib/sane'
[dll] load: trying to load `/usr/lib/sane/libsane-plustek.so.1'
[dll] load: dlopen()ing `/usr/lib/sane/libsane-plustek.so.1'
[dll] init: initializing backend `plustek'
[sanei_debug] Setting debug level of plustek to 255.
[plustek] Plustek backend V0.45-3, part of sane-backends 1.0.10-pre3
[plustek] ># Plustek-SANE Backend configuration file<
[plustek] ># For use with Plustek parallel-port scanners and<
[plustek] ># LM9831/2/3 based USB scanners<
[plustek] >#<
[plustek] ># For parport devices use the parport section<
[plustek] >#<
[plustek] >[parport]<
[plustek] next device is a PARPORT device
[plustek] >device /dev/pt_drv<
[plustek] Decoding device name >/dev/pt_drv<
[plustek] ><
[plustek] >#<
[plustek] ># leave the default values as specified in /etc/modules.conf<
[plustek] >#<
[plustek] >option warmup    -1<
[plustek] Decoding option >warmup<
[plustek] >option lOffOnEnd -1<
[plustek] Decoding option >lOffOnEnd<
[plustek] >option lampOff   -1<
[plustek] Decoding option >lampOff<
[plustek] ><
[plustek] ><
[plustek] >#<
[plustek] ># The USB section:<
[plustek] ># each device needs at least two lines:<
[plustek] ># - [usb] vendor-ID and product-ID<
[plustek] ># - device devicename<
[plustek] ># i.e. for Plustek (0x07B3) UT12/16/24 (0x0017)<
[plustek] ># [usb] 0x07B3 0x0017<
[plustek] ># device /dev/usb/scanner0<
[plustek] ># or<
[plustek] ># device libusb:bbb:ddd<
[plustek] ># where bbb is the busnumber and ddd the device number<
[plustek] ># make sure that your user has access to 
/proc/bus/usb/bbb/ddd<
[plustek] >#<
[plustek] ># additionally you can specify some options<
[plustek] ># warmup, lOffOnEnd, lampOff<
[plustek] >#<
[plustek] ># For autodetection use<
[plustek] ># [usb]<
[plustek] ># device /dev/usb/scanner0<
[plustek] >#<
[plustek] ># or simply<
[plustek] ># [usb]<
[plustek] >#<
[plustek] ># or if you want a specific device but you have no idea 
about<
[plustek] ># the device node or you use libusb, simply set vendor- and 
product-ID<
[plustek] ># [usb] 0x07B3 0x0017<
[plustek] ># device auto<
[plustek] >#<
[plustek] ># NOTE: autodetection is safe, as it uses the info it got<
[plustek] >#       from the USB subsystem. If you're not using the<
[plustek] >#       autodetection, you MUST have attached that device<
[plustek] >#       at your USB-port, that you have specified...<
[plustek] >#<
[plustek] ><
[plustek] >[usb]<
[plustek] attach (/dev/pt_drv, 0xbfffd6a0, (nil))
[plustek] Device configuration:
[plustek] device name  : >/dev/pt_drv<
[plustek] porttype     : 0
[plustek] USB-ID       : ><
[plustek] warmup       : -1s
[plustek] lampOff      : -1
[plustek] lampOffOnEnd : -1
[plustek] skipCalibr.  : 0
[plustek] skipFine     : 0
[plustek] skipFineWhite: 0
[plustek] invertNegs.  : 0
[plustek] pos_x        : 0
[plustek] pos_y        : 0
[plustek] pos_shading_y: -1
[plustek] neg_x        : 0
[plustek] neg_y        : 0
[plustek] neg_shading_y: -1
[plustek] tpa_x        : 0
[plustek] tpa_y        : 0
[plustek] tpa_shading_y: -1
[plustek] red gain     : -1
[plustek] green gain   : -1
[plustek] blue gain    : -1
[plustek] red Gamma    : 1.00
[plustek] green Gamma  : 1.00
[plustek] blue Gamma   : 1.00
[plustek] gray Gamma   : 1.00
[plustek] ---------------------
[plustek] drvopen()
[plustek] open: can't open /dev/pt_drv as a device
[plustek] open failed: -1
[plustek] next device is a USB device (autodetection)
[plustek] next device is an USB device
[plustek] ><
[plustek] >#<
[plustek] ># options for the previous USB entry<
[plustek] >#<
[plustek] ># switch lamp off after xxx secs, 0 disables the feature<
[plustek] >option lampOff 300<
[plustek] Decoding option >lampOff<
[plustek] ><
[plustek] ># warmup period in seconds, 0 means no warmup<
[plustek] >option warmup 15<
[plustek] Decoding option >warmup<
[plustek] ><
[plustek] ># 0 means leave lamp-status untouched, not 0 means switch 
off<
[plustek] ># on sane_close<
[plustek] >option lOffOnEnd 1<
[plustek] Decoding option >lOffOnEnd<
[plustek] ><
[plustek] >#<
[plustek] ># options to tweak the image start-position<
[plustek] ># (WARNING: there's no internal range check!!!)<
[plustek] >#<
[plustek] ># for the normal scan area<
[plustek] >#<
[plustek] >option posOffX 0<
[plustek] Decoding option >posOffX<
[plustek] >option posOffY 0<
[plustek] Decoding option >posOffY<
[plustek] ><
[plustek] ># for transparencies<
[plustek] >option tpaOffX 0<
[plustek] Decoding option >tpaOffX<
[plustek] >option tpaOffY 0<
[plustek] Decoding option >tpaOffY<
[plustek] ><
[plustek] ># for negatives<
[plustek] >option negOffX 0<
[plustek] Decoding option >negOffX<
[plustek] >option negOffY 0<
[plustek] Decoding option >negOffY<
[plustek] ><
[plustek] >#<
[plustek] ># for setting the calibration strip position<
[plustek] ># (WARNING: there's no internal range check!!!)<
[plustek] ># -1 means use built in<
[plustek] >#<
[plustek] >option posShadingY -1<
[plustek] Decoding option >posShadingY<
[plustek] >option tpaShadingY -1<
[plustek] Decoding option >tpaShadingY<
[plustek] >option negShadingY -1<
[plustek] Decoding option >negShadingY<
[plustek] ><
[plustek] >#<
[plustek] ># to invert the negatives, 0 disables the feature<
[plustek] >#<
[plustek] >option invertNegatives 0<
[plustek] Decoding option >invertNegatives<
[plustek] ><
[plustek] ># for skipping whole calibration step<
[plustek] >option skipCalibration 0<
[plustek] Decoding option >skipCalibration<
[plustek] ><
[plustek] ># for skipping entire fine calibration step<
[plustek] ># coarse calibration is done<
[plustek] >option skipFine 0<
[plustek] Decoding option >skipFine<
[plustek] ><
[plustek] ># discard the result of the fine white calibration<
[plustek] >option skipFineWhite 0<
[plustek] Decoding option >skipFineWhite<
[plustek] ><
[plustek] ># for replacing the gain values found during<
[plustek] ># calibration<
[plustek] >option red_gain   -1<
[plustek] Decoding option >red_gain<
[plustek] >option green_gain -1<
[plustek] Decoding option >green_gain<
[plustek] >option blue_gain  -1<
[plustek] Decoding option >blue_gain<
[plustek] ><
[plustek] >#<
[plustek] ># for adjusting the default gamma values<
[plustek] >#<
[plustek] >option redGamma         1.0<
[plustek] Decoding option >redGamma<
[plustek] >option greenGamma       1.0<
[plustek] Decoding option >greenGamma<
[plustek] >option blueGamma        1.0<
[plustek] Decoding option >blueGamma<
[plustek] >option grayGamma        1.0<
[plustek] Decoding option >grayGamma<
[plustek] ><
[plustek] >#<
[plustek] ># to enable TPA (non Plustek devices only)<
[plustek] ># 0 means default behaviour as specified in the internal 
tables<
[plustek] ># 1 means enable<
[plustek] >#<
[plustek] >option enableTPA 0<
[plustek] Decoding option >enableTPA<
[plustek] ><
[plustek] >#<
[plustek] ># and of course the device-name<
[plustek] >#<
[plustek] ># device /dev/usb/scanner0<
[plustek] >device auto<
[plustek] Decoding device name >auto<
[plustek] ><
[plustek] >#<
[plustek] ># to define a new device, start with a new section:<
[plustek] ># [usb] or [parport]<
[plustek] >#<
[plustek] attach (auto, 0xbfffd6a0, (nil))
[plustek] Device configuration:
[plustek] device name  : >auto<
[plustek] porttype     : 1
[plustek] USB-ID       : ><
[plustek] warmup       : 15s
[plustek] lampOff      : 300
[plustek] lampOffOnEnd : 1
[plustek] skipCalibr.  : 0
[plustek] skipFine     : 0
[plustek] skipFineWhite: 0
[plustek] invertNegs.  : 0
[plustek] pos_x        : 0
[plustek] pos_y        : 0
[plustek] pos_shading_y: -1
[plustek] neg_x        : 0
[plustek] neg_y        : 0
[plustek] neg_shading_y: -1
[plustek] tpa_x        : 0
[plustek] tpa_y        : 0
[plustek] tpa_shading_y: -1
[plustek] red gain     : -1
[plustek] green gain   : -1
[plustek] blue gain    : -1
[plustek] red Gamma    : 1.00
[plustek] green Gamma  : 1.00
[plustek] blue Gamma   : 1.00
[plustek] gray Gamma   : 1.00
[plustek] ---------------------
[plustek] drvopen()
[plustek] usbDev_open(auto,)
[plustek] Autodetection...
[plustek] Checking for 0x07b3-0x0010
[plustek] Checking for 0x07b3-0x0011
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0015
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0013
[plustek] Checking for 0x07b3-0x0013
[plustek] Checking for 0x07b3-0x0011
[plustek] Checking for 0x07b3-0x0010
[plustek] Checking for 0x07b3-0x0014
[plustek] Checking for 0x07b3-0x0015
[plustek] Checking for 0x07b3-0x0014
[plustek] Checking for 0x07b3-0x0016
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0017
[plustek] Checking for 0x07b3-0x0007
[plustek] Checking for 0x07b3-0x000f
[plustek] Checking for 0x07b3-0x000f
[plustek] Checking for 0x07b3-0x0005
[plustek] Checking for 0x07b3-0x0014
[plustek] Checking for 0x07b3-0x0012
[plustek] Checking for 0x0400-0x1000
[plustek] Checking for 0x0400-0x1001
[plustek] Checking for 0x0458-0x2007
[plustek] Checking for 0x0458-0x2008
[plustek] Checking for 0x0458-0x2009
[plustek] Checking for 0x0458-0x2013
[plustek] Checking for 0x0458-0x2015
[plustek] Checking for 0x0458-0x2016
[plustek] Checking for 0x03f0-0x0505
[plustek] Checking for 0x03f0-0x0605
[plustek] Checking for 0x04b8-0x010f
[plustek] Checking for 0x04b8-0x011d
[plustek] Checking for 0x1606-0x0060
[plustek] Checking for 0x1606-0x0160
[plustek] Checking for 0x04a9-0x2206
[plustek] Checking for 0x04a9-0x2207
[plustek] Checking for 0x04a9-0x220d
[plustek] Checking for 0x04a9-0x220e
[plustek] No supported device found!
[plustek] open failed: -1
[dll] init: backend `plustek' is version 1.0.0
[plustek] sane_get_devices (0xbffff7a8, 1)
[dll] load: searching backend `net' in `/usr/lib/sane'
[dll] load: trying to load `/usr/lib/sane/libsane-net.so.1'
[dll] load: dlopen()ing `/usr/lib/sane/libsane-net.so.1'
[dll] init: initializing backend `net'
[dll] init: backend `net' is version 1.0.10
Segmentation fault (core dumped)

> > >Could you try to run saned in gdb directly? Maybe that gives more
> > >information.
> >
> > I'm not a gdb expert.  How do I do this?
> 
> gdb saned
> run -d128
> 
> Now start scanimage. When saned crahes, run bt to show the backtrace.

....
[dll] init: backend `plustek' is version 1.0.0
[plustek] sane_get_devices (0xbffff7a8, 1)
[dll] load: searching backend `net' in `/usr/lib/sane'
[dll] load: trying to load `/usr/lib/sane/libsane-net.so.1'
[dll] load: dlopen()ing `/usr/lib/sane/libsane-net.so.1'
[dll] init: initializing backend `net'
[dll] init: backend `net' is version 1.0.10
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x0804ada3 in strcpy () at strcpy:-1
-1	strcpy: No such file or directory.
	in strcpy
(gdb) bt
#0  0x0804ada3 in strcpy () at strcpy:-1
#1  0x08050a80 in _IO_stdin_used ()
#2  0x0804b7d2 in strcpy () at strcpy:-1
#3  0x4009f657 in __libc_start_main (main=0x804b420 <strcpy+7224>, 
argc=2, ubp_av=0xbffff994,     init=0x80492e0 <_init>, fini=0x804e8f0 
<_fini>, rtld_fini=0x4000dcd4 <_dl_fini>,     stack_end=0xbffff98c) at 
../sysdeps/generic/libc-start.c:129
(gdb) 
Hope this helps.

Remember that
   1) the permissions on the server prohibit saned from access, and
   2) the client executes 'scanimage --help -d "net:192.168.0.1"

Thanks.

Lee.