SEGFAULT when reinitializing a scanner
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
sane-backends (Ubuntu) |
Expired
|
Low
|
Unassigned |
Bug Description
I have Canon Lide 220. I have libsane from Xenial (1.0.25) compiled with debuild. If I initialize the scanner with sane_open(), then immediately de-initialize it with sane_close(), and then sane_open() again, sane_start() will crash after that. The crash happens in genesys_
value=dev-
The issue is that if I reinitialize the scanner, its gamma table is lost (dev->sensor.
In genesys_
if (dev->already_
{
DBG (DBG_info, "%s: already initialized, nothing to do\n", __FUNCTION__);
return SANE_STATUS_GOOD;
}
So it becomes
/* if (dev->already_
{
DBG (DBG_info, "%s: already initialized, nothing to do\n", __FUNCTION__);
return SANE_STATUS_GOOD;
}
*/
After this ugly hack sane will reinitialize the gamma table every time, and the application will not crash. Sample C++ app is attached. Simply compile and run with Lide 220 connected.
ProblemType: Bug
DistroRelease: Ubuntu 14.04
Package: libsane 1.0.25+
ProcVersionSign
Uname: Linux 3.13.0-66-generic i686
ApportVersion: 2.14.1-0ubuntu3.19
Architecture: i386
CurrentDesktop: KDE
Date: Tue Mar 15 17:36:02 2016
InstallationDate: Installed on 2015-10-24 (144 days ago)
InstallationMedia: Kubuntu 14.04.3 LTS "Trusty Tahr" - Beta i386 (20150805)
SourcePackage: sane-backends
UpgradeStatus: No upgrade log present (probably fresh install)
Status changed to 'Confirmed' because the bug affects multiple users.