[sane-devel] Re: scanimage seg fault doing network scanning!

Per Arnold Blåsmo pab at norbit.no
Wed Aug 10 08:41:45 UTC 2005


Thanks for you answer!

I got it to work somehow, but run into other problems :-(
I will explain below as I answer some of your questions :-)

Henning Meier-Geinitz wrote:
> Hi,
> 
> On Tue, Aug 09, 2005 at 11:55:32AM +0200, Per Arnold Blåsmo wrote:
> 
>>I am trying to do a set up a server for doing scanning over the network.
>>My scanner is connected to a server running FC3. Its a Xerox WorkCenter
>>PE120i. I am able to use xsane on the server to scan images.
> 
> 
> This scanner is not in our list of supported scanners as far as I can
> see. Which backend do you use? Could you send the output of
> sane-find-scanner and scanimage -L on the server?

Thats correct, but the CD that comes with the scanner has backend for
Linux. It uses Samsungs MFP driver, but I dont think that they are
necessary. A least it tries to install 2 kernel modules for something
called 'mfpport' and 'mfpportprobe'. The problem is that my kernel is
not supported in the install package, and the source code is not
available for this modules.

It does not seem like I need those modules dough? It works without them.
I get some error message about the modules not found, but that, I
believe, comes from a "wrapper"-script that tries to do an insmod of the
modules.

scanimage and xsane on the server scans the images OK.

Also the document feeder (ADF) works.

> 
> 
>>I have set up saned and doing telnet to the port works.
> 
> 
> Which version of SANE is used on the server and which one on the
> client (scanimage --version)?

version 1.0.15 on both server and clients

On the server I run FC3. On the clients I have tried so far I have FC4
and Mandriva 2005LE.

> 
> 
>>The I add go to one of the workstations and add the server name in the
>>'net.conf' file in /etc/sane.d/ folder.
>>
>>This is the output I get.
>>
>>scanimage -L
>>[sanei_wire] sanei_w_array: DECODE: maximum amount of allocated memory
>>exceeded (limit: 1048576, new allocation: 3180390528, total: 3181439104
>>bytes)
>>Segmentation fault
> 
> 
> The first problem is that saned sent a strange value to the net
> backend. The net backend has detected that. This may be caused by a
> crash on the server.
> 
> The second problem is that there seems to be a bug in the detection of
> such problems which leeds to a segfault. Such a bug was fixed in
> sane-backends 1.0.16 but without detailed logs I can't say if it's the
> same problem.
> 
> 
>>Anybody that knows about this problem?
> 
> 
> We need more input. A full log on the client and server side may help.
> 
> Server:
> Disable saned in (x)inetd.conf
> export SANE_DEBUG_BACKEND=255 (use your backend name instead of "BACKEND")
> saned -d128 (must be restarted after each call)
> 
> Client:
> SANE_DEBUG_NET=255 scanimage -L
>

OK, I tried something like that and discovered that it worked when I ran
saned in debug mode from the command line on the server.

So I found that from xinetd config file that I ran saned as user 'saned'
and that the problem was access right to the device.

Running it as user root made it OK. I will change it to run as users
'saned' again, but have to edit hotplug to set correct access rights to
the device first.

So xsane and kooa works fine over the network.
scanimage does not work OK over the network.

This is the output from 'scanimage -L'
> SANE_DEBUG_NET=255 scanimage -L
> [sanei_debug] Setting debug level of net to 255.
> [net] sane_init: authorize = 0x804ac8b, version_code = 0xbf94ed08
> [net] sane_init: SANE net backend version 1.0.13 (AF-indep+IPv6) from sane-backends 1.0.15
> [net] sane_init: Client has little endian byte order
> [net] sane_init: searching for config file
> [net] sane_init: trying to add 192.168.1.5
> [net] add_device: adding backend 192.168.1.5
> [net] add_device: backend 192.168.1.5 added
> [net] sane_init: done reading config
> [net] sane_init: evaluating environment variable SANE_NET_HOSTS
> [net] sane_init: done
> [net] sane_get_devices: local_only = 0
> [net] connect_dev: trying to connect to 192.168.1.5
> [net] connect_dev: [0] connection succeeded (IPv4)
> [net] connect_dev: sanei_w_init
> [net] connect_dev: net_init (user=xxx, local version=1.0.3)
> [net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
> [net] connect_dev: done
> [net] sane_get_devices: got 192.168.1.5:xerox_pe120:XEROX WorkCentre PE120 Series on USB:0
> [net] sane_get_devices: finished (1 devices)
> device `net:192.168.1.5:xerox_pe120:XEROX WorkCentre PE120 Series on USB:0' is a XEROX WorkCentre PE120 Series on USB:0 Flatbed Scanner
> [net] sane_exit: exiting
> [net] sane_exit: closing dev 0x9097ab0, ctl=3
> [net] sane_exit: finished.


This is the output when trying to scan an image:

> SANE_DEBUG_NET=255 scanimage >test.pnm
> [sanei_debug] Setting debug level of net to 255.
> [net] sane_init: authorize = 0x804ac8b, version_code = 0xbffd39c8
> [net] sane_init: SANE net backend version 1.0.13 (AF-indep+IPv6) from sane-backends 1.0.15
> [net] sane_init: Client has little endian byte order
> [net] sane_init: searching for config file
> [net] sane_init: trying to add 192.168.1.5
> [net] add_device: adding backend 192.168.1.5
> [net] add_device: backend 192.168.1.5 added
> [net] sane_init: done reading config
> [net] sane_init: evaluating environment variable SANE_NET_HOSTS
> [net] sane_init: done
> [net] sane_get_devices: local_only = 0
> [net] connect_dev: trying to connect to 192.168.1.5
> [net] connect_dev: [0] connection succeeded (IPv4)
> [net] connect_dev: sanei_w_init
> [net] connect_dev: net_init (user=xxx, local version=1.0.3)
> [net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
> [net] connect_dev: done
> [net] sane_get_devices: got 192.168.1.5:xerox_pe120:XEROX WorkCentre PE120 Series on USB:0
> [net] sane_get_devices: finished (1 devices)
> [net] sane_open("192.168.1.5:xerox_pe120:XEROX WorkCentre PE120 Series on USB:0")
> [net] sane_open: host = 192.168.1.5, device = xerox_pe120:XEROX WorkCentre PE120 Series on USB:0
> [net] sane_open: device found in list
> [net] sane_open: net_open
> [net] sane_open: success
> [net] sane_control_option: option 0, action 0
> [net] sane_control_option: getting option descriptors
> [net] fetch_options: 0x80a6980
> [net] fetch_options: get_option_descriptors
> [net] fetch_options: creating 12 local option descriptors
> [net] fetch_options: copying 12 option descriptors
> [net] fetch_options: 12 options fetched
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_control_option: option 0, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_get_option_descriptor: option 0
> [net] sane_get_option_descriptor: option 1
> [net] sane_get_option_descriptor: option 2
> [net] sane_get_option_descriptor: option 3
> [net] sane_get_option_descriptor: option 4
> [net] sane_get_option_descriptor: option 5
> [net] sane_get_option_descriptor: option 6
> [net] sane_get_option_descriptor: option 7
> [net] sane_get_option_descriptor: option 8
> [net] sane_get_option_descriptor: option 9
> [net] sane_control_option: option 9, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_get_option_descriptor: option 10
> [net] sane_control_option: option 10, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_get_option_descriptor: option 11
> [net] sane_control_option: option 7, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_control_option: option 8, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_control_option: option 7, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_get_option_descriptor: option 9
> [net] sane_control_option: option 9, action 1
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_control_option: option 8, action 0
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_get_option_descriptor: option 10
> [net] sane_control_option: option 10, action 1
> [net] sane_control_option: remote control option
> [net] sane_control_option: done (Success)
> [net] sane_start
> [net] sane_start: remote start
> [net] sane_start: server has little endian byte order
> [net] sane_start: remote start finished, data at port 55112
> [net] sane_start: done (Success)
> [net] sane_get_parameters
> [net] sane_get_parameters: remote get parameters
> [net] sane_get_parameters: returned status Success
> [net] sane_read: handle=0x80a6980, data=0xbffd3b30, max_length=32768, length=0xbffdcb60
> [net] sane_read: reading paket length
> [net] sane_read: read 4 bytes, 0 from 4 total
> [net] sane_read: next record length=-1 bytes
> [net] sane_read: received error signal
> [net] sane_read: error code Error during device I/O
> [net] do_cancel: 0x80a6980
> [net] do_cancel: closing data pipe
> scanimage: sane_read: Error during device I/O
> [net] sane_close: handle 0x80a6980
> [net] sane_close: removing cached option descriptors
> [net] sane_close: removing local option descriptors
> [net] sane_close: net_close
> [net] sane_close: done
> [net] sane_exit: exiting
> [net] sane_exit: closing dev 0x80a6ab0, ctl=3
> [net] sane_exit: finished.

This is the output running scanimage locally on the server:

> SANE_DEBUG_NET=255 scanimage >test.pnm
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpport.ko': No such file or directory
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpportprobe.ko': No such file or directory
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpport.ko': No such file or directory
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpportprobe.ko': No such file or directory
> [sanei_debug] Setting debug level of net to 255.
> [net] sane_init: authorize = 0x8049220, version_code = 0xbff9dccc
> [net] sane_init: SANE net backend version 1.0.13 (AF-indep+IPv6) from sane-backends 1.0.15
> [net] sane_init: Client has little endian byte order
> [net] sane_init: searching for config file
> [net] sane_init: trying to add localhost
> [net] add_device: adding backend localhost
> [net] add_device: backend localhost added
> [net] sane_init: done reading config
> [net] sane_init: evaluating environment variable SANE_NET_HOSTS
> [net] sane_init: done
> [net] sane_get_devices: local_only = 0
> [net] connect_dev: trying to connect to localhost
> [net] connect_dev: [0] connection succeeded (IPv4)
> [net] connect_dev: sanei_w_init
> [net] connect_dev: net_init (user=pab, local version=1.0.3)
> [net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
> [net] connect_dev: done
> [net] sane_get_devices: got localhost:xerox_pe120:XEROX WorkCentre PE120 Series on USB:0
> [net] sane_get_devices: finished (1 devices)
> scanimage: WARNING: read more data than announced by backend (26083328/26071038)[net] sane_exit: exiting
> [net] sane_exit: closing dev 0x8fddab8, ctl=3
> [net] sane_exit: finished.

As you can see the image is scanned with a warning when running locally
bit exits with an I/O error when scanned via the network.
Also when scanning locally you can see the attempt to do an insmod of
the kernel modules. I dont think that those kernel modules are necessary
and that they do not have anything to do with the error.

I can use xsane or kooka, but I would prefer to use scanimage since I
want to make a script to do the scanning "automatically" and produce a
pdf file (using convert) of the documents. The documents are testreports
  with several pages from a production line and therefore I want does in
PDF for archiving.

So any idea about what is wrong with scanimage?

Trying to use scanadf segfaults both locally and via network.
Here is the output:

> SANE_DEBUG_NET=255 scanadf >testadf.pnm 
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpport.ko': No such file or directory insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpportprobe.ko': No such file or directory
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpport.ko': No such file or directory
> insmod: can't read '/lib/modules/2.6.10-1.741_FC3smp/kernel/drivers/mfpportctrl/mfpportprobe.ko': No such file or directory
> [sanei_debug] Setting debug level of net to 255.
> [net] sane_init: authorize = (nil), version_code = 0xbfe9861c
> [net] sane_init: SANE net backend version 1.0.13 (AF-indep+IPv6) from sane-backends 1.0.15
> [net] sane_init: Client has little endian byte order
> [net] sane_init: searching for config file
> [net] sane_init: trying to add localhost
> [net] add_device: adding backend localhost
> [net] add_device: backend localhost added
> [net] sane_init: done reading config
> [net] sane_init: evaluating environment variable SANE_NET_HOSTS
> [net] sane_init: done
> [net] sane_get_devices: local_only = 0
> [net] connect_dev: trying to connect to localhost
> [net] connect_dev: [0] connection succeeded (IPv4)
> [net] connect_dev: sanei_w_init
> [net] connect_dev: net_init (user=pab, local version=1.0.3)
> [net] connect_dev: freeing init reply (status=Success, remote version=1.0.3)
> [net] connect_dev: done
> [net] sane_get_devices: got localhost:xerox_pe120:XEROX WorkCentre PE120 Series on USB:0
> [net] sane_get_devices: finished (1 devices)
> Segmentation fault
??

> Bye,
>   Henning
> 
Per A.




More information about the sane-devel mailing list