Bug 1761145

Summary: Latest sane-backends package seems to drop support for Canon CanoScan LiDE 100
Product: [Fedora] Fedora Reporter: W. Michael Petullo <mike>
Component: sane-backendsAssignee: Nils Philippsen <nphilipp>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 30CC: nphilipp, thibault.north, zdohnal
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sane-backends-1.0.28-4.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-19 17:41:43 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description W. Michael Petullo 2019-10-12 21:21:10 UTC
Description of problem:
The latest sane-backends package seems to drop support for the Canon CanoScan LiDE 100 due to the lack of the genesys driver. Reverting to sane-backends-1.0.27-24 fixes this.

Version-Release number of selected component (if applicable):
sane-backends-1.0.28-1.fc30.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. Update to sane-backends-1.0.28-1.fc30.x86_64
2. Attach Canon CanoScan LiDE 100
3. Run sane-find-scanner
4. Run scanimage -L

Actual results:
Step 3 prints the USB details of the scanner. However, step 4 does not detect the scanner.

sane-backends-1.0.28-1.fc30.x86_64 does not provide the genesys drivers:

$ rpm -ql sane-backends-drivers-scanners | grep genesys

Expected results:
I expect the SANE subsystem to detect this scanner. It has worked in the past.

Additional info:
Downgrading to sane-backends-1.0.27-24.fc30.x86_64 fixes this. This package does provide the genesys drivers:

$ rpm -ql sane-backends-drivers-scanners | grep genesys
/usr/lib64/sane/libsane-genesys.so
/usr/lib64/sane/libsane-genesys.so.1
/usr/lib64/sane/libsane-genesys.so.1.0.27

$ sane-find-scanner 
[...]
found USB scanner (vendor=0x04a9 [Canon], product=0x1904 [CanoScan], chip=GL847) at libusb:001:008
[...]

$ scanimage -L
device `genesys:libusb:001:008' is a Canon LiDE 100 flatbed scanner

Comment 1 Zdenek Dohnal 2019-10-14 13:25:53 UTC
Hi Mike,

thank you for reporting the issue and the investigation!

Actually it was caused by missing buildrequires - gcc-c++

Genesys backend is now written in C++11 and it cannot be built without it due settings during configure phase. Buildroot did not have gcc-c++ during build and configure produced only warning about genesys will not be created.

Would you mind trying this build if it fixes it? https://koji.fedoraproject.org/koji/taskinfo?taskID=38290736

Comment 2 W. Michael Petullo 2019-10-14 13:58:26 UTC
Simple-scan detects my scanner with this update applied, but it segfaults after I push its "Scan" button:

$ simple-scan 
/usr/include/c++/9/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = short unsigned int; _Alloc = std::allocator<short unsigned int>; std::vector<_Tp, _Alloc>::reference = short unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
Aborted (core dumped)

Here is a stack trace:

/usr/include/c++/9/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = short unsigned int; _Alloc = std::allocator<short unsigned int>; std::vector<_Tp, _Alloc>::reference = short unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.

Thread 8 "scan-thread" received signal SIGABRT, Aborted.
[Switching to Thread 0x7fffe62dc700 (LWP 5200)]
0x00007ffff6ea8e35 in raise () from /lib64/libc.so.6
(gdb) ba
#0  0x00007ffff6ea8e35 in raise () from /lib64/libc.so.6
#1  0x00007ffff6e93895 in abort () from /lib64/libc.so.6
#2  0x00007fffe50860c8 in std::__replacement_assert (__file=__file@entry=0x7fffe50eb3e0 "/usr/include/c++/9/bits/stl_vector.h", __line=__line@entry=1042, __function=__function@entry=0x7fffe50ec2f8 "std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = short unsigned int; _Alloc = std::allocator<short unsigned int>; std::vector<_"..., __condition=__condition@entry=0x7fffe50eb290 "__builtin_expect(__n < this->size(), true)") at /usr/include/c++/9/x86_64-redhat-linux/bits/c++config.h:2533
#3  0x00007fffe50e51af in std::vector<unsigned short, std::allocator<unsigned short> >::operator[] (__n=<optimized out>, this=<optimized out>) at /usr/include/c++/9/bits/stl_vector.h:1040
#4  sanei_genesys_generate_gamma_buffer (dev=0x7fffdc093d70, sensor=..., bits=<optimized out>, max=65535, size=<optimized out>, gamma=0x7fffdc0a8930 "") at genesys_low.cc:1232
#5  0x00007fffe50e54ae in sanei_genesys_send_gamma_table (dev=0x7fffdc093d70, sensor=...) at genesys_low.cc:1271
#6  0x00007fffe507ecd2 in genesys_start_scan (lamp_off=0, dev=0x7fffdc093d70) at genesys.cc:3849
#7  sane_start_impl (handle=0x7fffdc0c8ae0) at genesys.cc:7230
#8  sane_start_impl (handle=0x7fffdc0c8ae0) at genesys.cc:7208
#9  0x00007fffe508040e in <lambda()>::operator() (__closure=<optimized out>) at genesys.cc:7295
#10 wrap_exceptions_to_status_code<sane_genesys_start(SANE_Handle)::<lambda()> > (func=0x7fffe50ee953 "sane_genesys_start", function=...) at genesys_error.h:165
#11 sane_genesys_start (handle=<optimized out>) at genesys.cc:7293
#12 0x000055555558b365 in ?? ()
#13 0x00007ffff7dc54c2 in g_thread_proxy () from /lib64/libglib-2.0.so.0
#14 0x00007ffff6de44c0 in start_thread () from /lib64/libpthread.so.0
#15 0x00007ffff6f6d553 in clone () from /lib64/libc.so.6
(gdb)

Comment 3 Zdenek Dohnal 2019-10-14 15:30:24 UTC
Mike,

it is a different issue, I filed bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1761530 and I'll report it upstream after I check with you if my patch is correct.

Would you mind testing this build? https://koji.fedoraproject.org/koji/taskinfo?taskID=38292099

Comment 4 W. Michael Petullo 2019-10-14 15:58:42 UTC
Same thing:

$ simple-scan 
/usr/include/c++/9/bits/stl_vector.h:1042: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = short unsigned int; _Alloc = std::allocator<short unsigned int>; std::vector<_Tp, _Alloc>::reference = short unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]: Assertion '__builtin_expect(__n < this->size(), true)' failed.
Aborted (core dumped)

Comment 5 Zdenek Dohnal 2019-10-14 16:04:41 UTC
Please follow on other bugzilla.

Comment 6 Fedora Update System 2019-10-17 12:56:15 UTC
FEDORA-2019-4c80d8cf5f has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-4c80d8cf5f

Comment 7 Fedora Update System 2019-10-17 23:42:15 UTC
sane-backends-1.0.28-3.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-4c80d8cf5f

Comment 8 Fedora Update System 2019-10-18 08:52:08 UTC
FEDORA-2019-4e0ac1c8bb has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-4e0ac1c8bb

Comment 9 Fedora Update System 2019-10-18 21:00:11 UTC
sane-backends-1.0.28-4.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-4e0ac1c8bb

Comment 10 Fedora Update System 2019-10-19 17:41:43 UTC
sane-backends-1.0.28-4.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.