unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Adrien 'neox' Bourmault <neox@gnu.org>
To: 73393@debbugs.gnu.org
Cc: Adrien 'neox' Bourmault <neox@gnu.org>
Subject: [bug#73393] [PATCH v2 0/2] SANE: fix a locking bug for plustek backend
Date: Sun, 22 Sep 2024 11:07:56 +0200	[thread overview]
Message-ID: <cover.1726864525.git.neox@gnu.org> (raw)
Message-ID: <20240922090756.Vg_kOBSW4rsxEIhNt4Y93e6DH3yemuQ8tzXY99bv2Vo@z> (raw)
In-Reply-To: <3ad4ed8a692d86a9bef0b2ea56921ae2bf882957.1726827449.git.neox@gnu.org>

Hi.
While attempting to use a Canon LiDE 30 scanner, which is supported by SANE in
its current version, I noticed a malfunction with the plustek backend. No
application seemed capable of detecting the scanner, even though the
`sane-find-scanner` command indicated its presence, and the device IDs matched
those in the plustek backend configuration.

I investigated further using the following command:

  SANE_DEBUG_SANEI_USB=128 SANE_DEBUG_PLUSTEK=255 strace -fye open,openat scanimage -L

Here is a summary of the output:

  [23:00:21.688008] [plustek] usbDev_open(auto,) - 0x1c1e5630
  [pid 1209-20241] openat(AT_FDCWD</home/neox>, "/gnu/store/gzc1m4n79d1fgby8l58dsaq7nrzyhc14-sane-backend>
  [23:00:21.688089] [plustek] sanei_access_lock failed: 11
  [23:00:21.688131] [plustek] open failed: -1

It seems that the issue is the attempt to open a lock file in the store, which
is not possible due to the read-only nature of the file system.

To address this, there were two possible approaches: either move the lock file
to another location or disable the locking mechanism altogether.

After some research, I found that this bug has been resolved in both Debian [1]
and nixOS [2], and it has also been reported to the upstream project [3]. Debian
opted to disable the locking mechanism, while nixOS moved the lock file to a
runtime-generated location using systemd (by patching the install phase to
prevent the creation of the lock directory). However, since the locking
mechanism allows the use of multiple devices simultaneously[4], which can be
useful, nixOS's solution appears to be the better approach. I followed this
method, proposing to create the lock directory during the activation of the
sane service.

I tested these patch with my Canon LiDE 30 and have been able to (finally)
scan with it.

I realized I forgot to add my copyright notice in the files I
modified. This v2 fixes this.

[1] Debian bug report: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=973490
[2] nixOS bug report: https://github.com/NixOS/nixpkgs/issues/273280
[3] Upstream issue: https://gitlab.com/sane-project/backends/-/issues/363
[4] https://gitlab.com/sane-project/backends/-/issues/363#note_443142177

Adrien 'neox' Bourmault (2):
  gnu: sane-backends-minimal: fix lock path for plustek backend
  services: sane-service-type: create lock path for plustek backend

 gnu/packages/scanner.scm | 10 +++++++++-
 gnu/services/desktop.scm | 14 ++++++++++++++
 2 files changed, 23 insertions(+), 1 deletion(-)


base-commit: 1b6ce1796abdf497f61f426d61339318f4f4f23d
-- 
2.46.0





  parent reply	other threads:[~2024-09-22  9:09 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-20 19:03 [bug#73391] [PATCH 0/2] SANE: fix a locking bug for plustek backend neox
2024-09-20 19:03 ` [bug#73392] [PATCH 1/2] gnu: sane-backends-minimal: fix lock path " neox
     [not found]   ` <handler.73392.B.172685906722683.ack@debbugs.gnu.org>
2024-09-20 19:21     ` [bug#73392] Acknowledgement ([PATCH 1/2] gnu: sane-backends-minimal: fix lock path for plustek backend) Adrien 'neox' Bourmault
2024-09-20 19:03 ` [bug#73393] [PATCH 2/2] services: sane-service-type: create lock path for plustek backend neox
2024-09-22  8:55   ` Adrien 'neox' Bourmault
2024-09-20 20:39 ` neox [this message]
2024-09-20 20:39   ` [bug#73391] [PATCH v2 1/2] gnu: sane-backends-minimal: fix " neox
2024-09-21  8:03     ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-22  9:07     ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-20 20:39   ` [bug#73391] [PATCH v2 2/2] services: sane-service-type: create " neox
2024-09-21  8:03     ` [bug#73406] " Adrien 'neox' Bourmault
2024-09-22  9:07     ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-21  8:01   ` [bug#73406] [PATCH v2 0/2] SANE: fix a locking bug " Adrien 'neox' Bourmault
2024-09-22  9:07   ` [bug#73393] " Adrien 'neox' Bourmault
2024-09-24 18:51   ` Liliana Marie Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1726864525.git.neox@gnu.org \
    --to=neox@gnu.org \
    --cc=73393@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).