[sane-devel] seg fault's

Bertrik Sikken bertrik@zonnet.nl
Sun, 30 Jun 2002 13:56:04 +0200

---(rick moranis)--- wrote:

> i've been trying to get my scanner to work with my slackware 8.1 
> system, but it doesn't seem to be fuctioning properly. slackware 8.1 
> includes sane packages 1.0.8 and xsane pages 0.86 and they seem to 
> work fine using the usb kernel method because i can locate the scanner 
> with sane-find-scanner. the compilation of testtool caused errors 
> except when using make USB=libusb and even though the program would 
> compile it would always segfault when trying to run it. i removed all 
> packages from my system and just compiled sane-backend and sane-front 
> end from source without any problems. once again, sane-find-scanner 
> detected my scanner. i compiled sane-frontends without a program and 
> noticed that it had created a gimp plugin for me. i opened gimp to see 
> if the "acquire" option had the scanner listed, but it did not. i 
> tried running xscanimage from terminal but that also segfaulted. it 
> seems every program related to sane segfaults. what can i do to fix 
> this?? sane seems to be working fine.

(background info: this is a HP3300c scanner using a test tool and SANE 
patch script from
http://sourceforge.net/projects/hp3300backend )

The fact that sane-find-scanner detects a scanner merely means that it 
found a device file
that responded properly to a specific ioctl call to report its USB 
vendor and product id.
It does not mean that the scanner is actually detected by one of the 
backends yet.

To debug the testtool, you can run gdb after it segfaulted:
'gdb testtool core'
Then type 'bt' to see the stack of function calls that happened just 
before the
program crashed. Type 'q' to exit gdb.

To debug the backend (called 'niash' after the controller chip), it 
usually helps to
'export SANE_DEBUG_NIASH=255'
and then run (for example)
'scanimage --help'
It should tell you what is happening in the communication between 
backends and hardware.

Generally it may also help to try to run the software as root. If it 
works as root but
not as a user, there must be some kind of file permission issue.

Kind regards,
Bertrik Sikken