[sane-devel] Problems with mustek_pp and releasing the parallel port

Jim George jim.george@blueyonder.co.uk
Wed, 7 Jan 2004 21:39:06 -0000 (GMT)


Hi Eddy,

see in-line below.

Jim

> Hi Jim,
>
> I think it's normal that saned exits after one scan. Normally, it's
> xinetd that restarts saned when a new request comes in.
> To restart saned in gdb, you only have to enter "r" at the prompt  and
> then you can perform another scan.
>
> What surprises me is that, now, saned doesn't hang at the end.
> IIRC, when you started saned -d128 without gdb, it did hang.
>
> I'm getting confused. Could you repeat the following tests, such
> that I get a clear picture:
>
> 1) With xinetd
>
SuSE uses inetd not xinetd

>    - Make sure xinetd is running (/etc/rc.d/init.d/xinetd restart). -
> scanimage -d net:localhost:mustek_pp:Mustek-1200CP > test.pnm
>
>    * Does scanimage hang?
Yes

>    * If it hangs and you kill scanimage, is saned still running?
>      (ps aux | grep saned)
Yes

>    * If saned still runs, just kill it.
>
Done

> 2) Without xinetd, no gdb
>
>    - Make sure xinetd is stopped (/etc/rc.d/init.d/xinetd stop).
>    - SANE_DEBUG_MUSTEK_PP=255 saned -d128
>    - In another window:
>        scanimage -d net:localhost:mustek_pp:Mustek-1200CP > test.pnm
>
>    * Does scanimage hang?
It didn't even get started.  I got the following error message:
scanimage: open of device net:localhost:mustek_pp:Mustek-1200CP failed:
Invalid argument

>    * Does saned exit? (It should).
This was all the output from saned when it exited (it didn't hang).
[saned] main: starting debug mode (level 128)
[saned] main: trying to get port for service `sane' (getaddrinfo)
[saned] main: [0] socket () using IPv6
[saned] main: [0] setsockopt ()
[saned] main: [0] bind () to port 6566
[saned] main: [0] listen ()
[saned] main: [1] socket () using IPv4
[saned] main: [1] setsockopt ()
[saned] main: [1] bind () to port 6566
[saned] main: [1] bind failed: Address already in use
[saned] main: waiting for control connection
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.13 ready
[saned] check_host: access by remote host: ::1
[saned] check_host: remote host is IN6_LOOPBACK: access granted
[saned] init: access granted
[saned] init: access granted to jgeorge@::1
[saned] process_request: waiting for request
[saned] process_request: got request 2
[saned] process_request: access to resource `mustek_pp' granted
[sanei_debug] Setting debug level of mustek_pp to 255.
[mustek_pp] sane-mustek_pp, version 0.12-alpha. build for SANE 1.0.13
[mustek_pp] backend by Jochen Eisinger <jochen.eisinger@gmx.net>
[mustek_pp] cis_attach: couldn't attach to `parport0' (Invalid argument)
[mustek_pp] sane_open: unknown devicename ``Mustek-1200CP''
[saned] process_request: waiting for request
[saned] process_request: got request 10
[mustek_pp] sane_exit: all drivers unloaded
[saned] quit: exiting

>    * If it hangs, please show the last few lines of debug output.

>
> 3) Without xinetd, in gdb
>
>    - Make sure xinetd is stopped (/etc/rc.d/init.d/xinetd stop).
>    - SANE_DEBUG_MUSTEK_PP=255 gdb saned
>    - At the gdb prompt: r -d128
>    - In another window:
>        scanimage -d net:localhost:mustek_pp:Mustek-1200CP > test.pnm
>
>    * Does scanimage hang?
No it exits immediately with the following error message:
scanimage: open of device net:localhost:mustek_pp:Mustek-1200CP failed:
Invalid argument

>    * Does saned exit (ie., do you get the gdb prompt back)?
Yes it exited and I did get back to the gdb prompt.  Here is the output.
GNU gdb 5.2.1
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i586-suse-linux"...
(gdb) r -d128
Starting program: /usr/sbin/saned -d128
[saned] main: starting debug mode (level 128)
[saned] main: trying to get port for service `sane' (getaddrinfo)
[saned] main: [0] socket () using IPv6
[saned] main: [0] setsockopt ()
[saned] main: [0] bind () to port 6566
[saned] main: [0] listen ()
[saned] main: [1] socket () using IPv4
[saned] main: [1] setsockopt ()
[saned] main: [1] bind () to port 6566
[saned] main: [1] bind failed: Address already in use
[saned] main: waiting for control connection
[saned] saned (AF-indep+IPv6) from sane-backends 1.0.13 ready
[saned] check_host: access by remote host: ::1
[saned] check_host: remote host is IN6_LOOPBACK: access granted
[saned] init: access granted
[saned] init: access granted to jgeorge@::1
[saned] process_request: waiting for request
[saned] process_request: got request 2
[saned] process_request: access to resource `mustek_pp' granted
[sanei_debug] Setting debug level of mustek_pp to 255.
[mustek_pp] sane-mustek_pp, version 0.12-alpha. build for SANE 1.0.13
[mustek_pp] backend by Jochen Eisinger <jochen.eisinger@gmx.net>
[mustek_pp] cis_attach: couldn't attach to `parport0' (Invalid argument)
[mustek_pp] sane_open: unknown devicename ``Mustek-1200CP''
[saned] process_request: waiting for request
[saned] process_request: got request 10
[mustek_pp] sane_exit: all drivers unloaded
[saned] quit: exiting

Program exited normally.
(gdb)

>    * If saned hangs, hit Ctrl-C in the gdb window and request a
>      stack trace: bt
>    * To restart saned: just enter "r" at the gdb prompt.
>
> If a certain test doesn't give any problems, please repeat it a few
> times to make sure it isn't just luck.
>
All three tests gave problems as you can see.

> Best regards,
>
> Eddy
>
>
> ---------------------------------------------------------------
> Tiscali ADSL: 12 maanden aan  29,50 €/maand! Snel Internet, en voor
> iedereen. http://reg.tiscali.be/default.asp?lg=nl