FS#41726 - [xsane] hangs on start-up scanning for devices, cannot be killed, locks-up the terminal, hangs gimp

Attached to Project: Arch Linux
Opened by James (thx1138) - Wednesday, 27 August 2014, 21:32 GMT
Last edited by Doug Newgard (Scimmia) - Sunday, 15 October 2017, 16:52 GMT
Task Type Bug Report
Category Upstream Bugs
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

xsane 0.999-1

On start-up, xsane hangs with the "scanning for devices" window. The process remains in state "uninterruptible sleep" and cannot be killed. The terminal from which xsane was started also hangs. "gimp" also will not start, hanging with "Querying new Plug-ins - xsane" and creating another hung xsane process.

This all seems pretty harsh. Searching Google, it also seems to have been a problem, off and on, for many years, and still not fixed. See, for instance,

https://bugs.launchpad.net/ubuntu/+source/xsane/+bug/1242092

Alas, running "saned", as described there, does not have any effect.

Any thoughts? I've sent also a bug report to the "sane-devel" mailing list. This seems to be some kind of fundamental design problem here, without so much as at least a time-out function in the background, to put xsane back on the run-queue.


James
This task depends upon

Closed by  Doug Newgard (Scimmia)
Sunday, 15 October 2017, 16:52 GMT
Reason for closing:  Fixed
Comment by Bug41726Reporter2 (Bug41726Reporter2) - Tuesday, 21 October 2014, 08:55 GMT
I confirm the bug. I made a workaround following examples. At least it worked for me.

A RedHat bug asks to bundle systemd service files with xsane package. I think Arch should do that.

I recall better behavior under linux-lts kernel. Maybe the issue is in kernel changes from -lts to mainline.

Anyway, here are the files for current mainline kernel without a reboot. I made very minor changes from samples to match Arch. Copy the files to your sys and do

systemctl daemon-reload
systemctl enable saned.socket

And if you don't reboot, then also do

systemctl start saned.socket

Cheers


# (File A) /etc/tmpfiles.d/sane.conf
d /run/lock/sane 0775 root scanner - -



# (File B) /etc/systemd/system/saned.socket

[Unit]
Description=saned incoming socket

[Socket]
ListenStream=6566
Accept=yes
MaxConnections=1

[Install]
WantedBy=sockets.target



# (File C) /etc/systemd/system/saned@.service

[Unit]
Description=Scanner Service
Requires=saned.socket

[Service]
ExecStart=/usr/bin/saned
User=scanner
Group=scanner
StandardInput=null
StandardOutput=syslog
StandardError=syslog
Environment=SANE_CONFIG_DIR=/etc/sane.d
Comment by Bug41726Reporter2 (Bug41726Reporter2) - Tuesday, 21 October 2014, 09:00 GMT
PS Arch 'sane' package (not 'xsane') has service files so look at the diffs against mine. If I am following systemd, then mine overrode them and worked.
Comment by Bug41726Reporter2 (Bug41726Reporter2) - Tuesday, 21 October 2014, 09:19 GMT
PPS Arch 'sane' doesn't enable its own socket service. I would think it should? Could the fix be that simple?

But I also wonder why I produced different service files following (x)sane online help for systemd.

Independent of the fix, and before, the 'simple-scan' app ran the hardware without a hitch. So the bug is XSane specific. GIMP has no plugin for simple-scan, just xsane, so it remains important.
Comment by mattia (nTia89) - Sunday, 01 October 2017, 15:14 GMT
in my system xsame-0.999-1 works fine

Loading...