sane-project-website/old-archive/2001-02/0214.html

208 wiersze
7.2 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
<TITLE>sane-devel: Re: always Segmentation Fault</TITLE>
<META NAME="Author" CONTENT="abel deuring (adeuring@gmx.net)">
<META NAME="Subject" CONTENT="Re: always Segmentation Fault">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: always Segmentation Fault</H1>
<!-- received="Sun Feb 25 05:34:52 2001" -->
<!-- isoreceived="20010225133452" -->
<!-- sent="Sun, 25 Feb 2001 14:57:43 +0100" -->
<!-- isosent="20010225135743" -->
<!-- name="abel deuring" -->
<!-- email="adeuring@gmx.net" -->
<!-- subject="Re: always Segmentation Fault" -->
<!-- id="3A990F57.DAF9D600@gmx.net" -->
<!-- inreplyto="01022302483402.00354@gen" -->
<STRONG>From:</STRONG> abel deuring (<A HREF="mailto:adeuring@gmx.net?Subject=Re:%20always%20Segmentation%20Fault&In-Reply-To=&lt;3A990F57.DAF9D600@gmx.net&gt;"><EM>adeuring@gmx.net</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Feb 25 2001 - 05:57:43 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0215.html">Peter Kirchgessner: "Re: HP 5100C and SANE"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0213.html">Shea Martin: "Re: Snapscan problem"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0197.html">Christoph H.: "always Segmentation Fault"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0218.html">Christoph H.: "Re: always Segmentation Fault"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0218.html">Christoph H.: "Re: always Segmentation Fault"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#214">[ date ]</A>
<A HREF="index.html#214">[ thread ]</A>
<A HREF="subject.html#214">[ subject ]</A>
<A HREF="author.html#214">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
&quot;Christoph H.&quot; wrote:
<BR>
<EM>&gt;
</EM><BR>
<EM>&gt; Hi!
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; A few month ago I changed my system from Slackware 7 to Debian 2.2.
</EM><BR>
<EM>&gt; Under Slackware I used my Mustek ScanExpress 12000 SP without problems, but
</EM><BR>
<EM>&gt; now (under Debian) I always get a Segmentation Fault error with any of the programs included
</EM><BR>
<EM>&gt; in the sane-package, if they try to access the scanner device /dev/sg2.
</EM><BR>
<EM>&gt; Nothing was changed of the hardware configuration!
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; My configuration:
</EM><BR>
<EM>&gt; - SCSI-adapter: AHA-2940U PCI
</EM><BR>
<EM>&gt; - Scanner: Mustek 12000-SP
</EM><BR>
<EM>&gt; - Linux: Debian 2.2 Potato
</EM><BR>
<EM>&gt; - Kernel: 2.2.17 (self-compiled with support for generic SCSI devices (32k buffer))
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I tried it with:
</EM><BR>
<EM>&gt; - Sane 1.0.1 (included in Debian 2.2)
</EM><BR>
<EM>&gt; - Sane 1.0.3 (self-compiled)
</EM><BR>
<EM>&gt; - Sane 1.0.4 (self-compiled)
</EM><BR>
<EM>&gt; --&gt; always the same: Segmentation fault
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; I don't know what to do, please help me.
</EM><BR>
<EM>&gt;
</EM><BR>
<EM>&gt; Perhaps the strace-output of scanimage can help you to give me a hint how to solve the problem:
</EM><BR>
<EM>&gt; (I think it has something to do with the &quot;inappropriate ioctl for device&quot;-error at the end of the output)
</EM><BR>
<P>Christoph,
<BR>
<P>This is probably caused by sanei_scsi_open_extended. This function uses
<BR>
some ioctl calls to detect the version of the SG driver. If the &quot;get
<BR>
version&quot; ioctl fails, Sane assumes that the oldest SG driver is
<BR>
installed.
<BR>
<P><EM>&gt;
</EM><BR>
<EM>&gt; ------------------------------
</EM><BR>
<EM>&gt; # strace /usr/local/bin/scanimage
</EM><BR>
[...]
<BR>
<EM>&gt; open(&quot;/dev/sg2&quot;, O_RDWR) = 6
</EM><BR>
<EM>&gt; close(6) = 0
</EM><BR>
<EM>&gt; open(&quot;/proc/sys/kernel/sg-big-buff&quot;, O_RDONLY) = 6
</EM><BR>
<EM>&gt; read(6, &quot;32768\n&quot;, 31) = 6
</EM><BR>
<EM>&gt; close(6) = 0
</EM><BR>
<EM>&gt; open(&quot;/dev/sg2&quot;, O_RDWR|O_EXCL) = 6
</EM><BR>
<EM>&gt; ioctl(6, TIOCSCCINI, 0xbfffca88) = -1 ENOTTY (Inappropriate ioctl for device)
</EM><BR>
<EM>&gt; ioctl(6, TIOCGKISS, 0x40169c60) = -1 ENOTTY (Inappropriate ioctl for device)
</EM><BR>
<EM>&gt; brk(0x8054000) = 0x8054000
</EM><BR>
<EM>&gt; rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
</EM><BR>
<EM>&gt; rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
</EM><BR>
<EM>&gt; rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
</EM><BR>
<EM>&gt; write(6, &quot;*\0\0\0\204\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0&quot;..., 42) = 42
</EM><BR>
<EM>&gt; rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
</EM><BR>
<EM>&gt; select(7, [6], NULL, NULL, NULL) = 1 (in [6])
</EM><BR>
<EM>&gt; rt_sigprocmask(SIG_BLOCK, ~[], [], 8) = 0
</EM><BR>
<EM>&gt; read(6, &quot;&quot;, 132) = 0
</EM><BR>
<P>The return value 0 for the read call is weird. A read call to the SG
<BR>
driver should return at least sizeof(sg_header) bytes.
<BR>
<P><EM>&gt; rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
</EM><BR>
<EM>&gt; --- SIGSEGV (Segmentation fault) ---
</EM><BR>
<EM>&gt; +++ killed by SIGSEGV +++
</EM><BR>
<P>The segfault below is probably caused by:
<BR>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nread = read (req-&gt;fd, &amp;req-&gt;sgdata.cdb,
<BR>
req-&gt;sgdata.cdb.hdr.reply_len);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[...]
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;nread -= sizeof (req-&gt;sgdata.cdb.hdr);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[...]
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memcpy (req-&gt;dst, req-&gt;sgdata.cdb.data, nread);
<BR>
<P>in sanei_scsi_req_wait.
<BR>
<P>I'd recommend to install a more recent version of the SG driver.
<BR>
<P>Abel
<BR>
<P><PRE>
--
Source code, list archive, and docs: <A HREF="http://www.mostang.com/sane/">http://www.mostang.com/sane/</A>
To unsubscribe: echo unsubscribe sane-devel | mail <A HREF="mailto:majordomo@mostang.com?Subject=Re:%20always%20Segmentation%20Fault&In-Reply-To=&lt;3A990F57.DAF9D600@gmx.net&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0215.html">Peter Kirchgessner: "Re: HP 5100C and SANE"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0213.html">Shea Martin: "Re: Snapscan problem"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0197.html">Christoph H.: "always Segmentation Fault"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0218.html">Christoph H.: "Re: always Segmentation Fault"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0218.html">Christoph H.: "Re: always Segmentation Fault"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#214">[ date ]</A>
<A HREF="index.html#214">[ thread ]</A>
<A HREF="subject.html#214">[ subject ]</A>
<A HREF="author.html#214">[ author ]</A>
</UL>
<!-- trailer="footer" -->
<HR NOSHADE>
<P>
<SMALL>
<EM>
This archive was generated by <A HREF="http://www.hypermail.org/">hypermail 2b29</A>
: <EM>Sun Feb 25 2001 - 05:39:25 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>