[sane-devel] Running sane din docker

Jan De Luyck sub+sanedevel at kcore.org
Sat Jul 29 18:20:00 UTC 2017


Hello,

I'm currently trying to get Sane to run inside a docker container.
Reasons being that I can't modify the OS of the underlying machine, but
I can play with docker containers.

By sharing the /dev/bus/usb filesystem to the container, and mapping the
necessary ports, I've gotten it to run (using runit to keep the services
up and running). The scanner is detected, and I can start a remote scan
- unfortunately it never completes, it fails shortly in the scan with a
SIGPIPE error, and the client app (being scanimage or xsane) bombs out.

The docker container is based on Debian Stable, I have dbus running
inside it and ahavi is available.

Running scanimage -T returns:
$ scanimage -T
scanimage: scanning image of size 638x877 pixels at 24 bits/pixel
scanimage: acquiring RGB frame, 8 bits/sample
scanimage: reading one scanline, 1914 bytes...  FAIL No data
scanimage: reading one byte...          FAIL No data
scanimage: stepped read, 2 bytes...     FAIL No data
scanimage: stepped read, 4 bytes...     FAIL No data
scanimage: stepped read, 8 bytes...     FAIL No data
scanimage: stepped read, 16 bytes...    FAIL No data
scanimage: stepped read, 32 bytes...    FAIL No data
scanimage: stepped read, 64 bytes...    FAIL No data
scanimage: stepped read, 128 bytes...   FAIL No data
scanimage: stepped read, 256 bytes...   FAIL No data
scanimage: stepped read, 512 bytes...   FAIL No data
scanimage: stepped read, 1024 bytes...  FAIL No data
scanimage: stepped read, 2048 bytes...  FAIL No data
scanimage: stepped read, 2047 bytes...  FAIL No data
scanimage: stepped read, 1023 bytes...  FAIL No data
scanimage: stepped read, 511 bytes...   FAIL No data
scanimage: stepped read, 255 bytes...   FAIL No data
scanimage: stepped read, 127 bytes...   FAIL No data
scanimage: stepped read, 63 bytes...    FAIL No data
scanimage: stepped read, 31 bytes...    FAIL No data
scanimage: stepped read, 15 bytes...    FAIL No data
scanimage: stepped read, 7 bytes...     FAIL No data
scanimage: stepped read, 3 bytes...     FAIL No data
scanimage: received signal 13
scanimage: trying to stop scanner
Segmentation fault

The last messages I get from saned -d128 are:

[saned] do_scan: trying to write 8192 bytes to client
[saned] quit: received signal 13

Stracing saned gave me:
960  write(2, "[saned] ", 8)           = 8
1960  write(2, "do_scan: trying to read 8188 bytes from scanner\n", 48)
= 48
1960  write(2, "[saned] ", 8)           = 8
1960  write(2, "do_scan: read 8188 bytes from scanner\n", 38) = 38
1960  select(135, [4], [134], NULL, {tv_sec=0, tv_usec=0}) = 1 (out
[134], left {tv_sec=0, tv_usec=0})
1960  write(2, "[saned] ", 8)           = 8
1960  write(2, "do_scan: trying to write 8192 bytes to client\n", 46) =
46
1960  write(2, "do_scan: trying to read 8188 bytes from scanner\n", 48)
= 48
1960  write(2, "[saned] ", 8)           = 8
1960  write(2, "do_scan: read 8188 bytes from scanner\n", 38) = 38
1960  select(135, [4], [134], NULL, {tv_sec=0, tv_usec=0}) = 1 (out
[134], left {tv_sec=0, tv_usec=0})
1960  write(2, "[saned] ", 8)           = 8
1960  write(2, "do_scan: trying to write 8192 bytes to client\n", 46) =
46
1960  select(135, [4], [134], NULL, {tv_sec=0, tv_usec=0}) = 1 (out
[134], left {tv_sec=0, tv_usec=0})
1960  write(2, "[saned] ", 8)           = 8
1960  write(2, "do_scan: trying to write 8192 bytes to client\n", 46) =
46
1960  write(134,
"\0\0\37\374\372\370\373\372\370\374\373\371\374\373\371\374\373\371\374\373\371\374\373\371\371\370\3
66\372\371\367\372\371\367\373\372\370\373\372\370\372\371\367\372\371\367\371\370\366\372\372\370\372\372\370\372\372\
370\372\372\370\372\372\370\372\372\370\372\372\370\372\372\370\372\372\370\372\372\370\372\372\370\372\372\370\372\372
"..., 8192) = -1 EPIPE (Broken pipe)
1960  --- SIGPIPE {si_signo=SIGPIPE, si_code=SI_USER, si_pid=1960,
si_uid=0} ---  
1960  write(2, "[saned] ", 8)           = 8
1960  write(2, "quit: received signal 13\n", 25) = 25

Does anyone here have any idea how I could figure out what's going wrong
here? The first 8192 bytes of data get send, the second always fails.

Thanks in advance for any answers,

Jan



More information about the sane-devel mailing list