kopia lustrzana https://gitlab.com/sane-project/website
82 wiersze
4.4 KiB
HTML
82 wiersze
4.4 KiB
HTML
<!-- received="Fri Apr 30 04:43:22 1999 PDT" -->
|
||
<!-- sent="Fri, 30 Apr 1999 14:48:58 +0300" -->
|
||
<!-- name="Milon Firikis" -->
|
||
<!-- email="milonf@ariadne-t.gr" -->
|
||
<!-- subject="Re: Possible fix for Sane 1.0.1 segfault in RedHat 5.1 (net)" -->
|
||
<!-- id="" -->
|
||
<!-- inreplyto="Possible fix for Sane 1.0.1 segfault in RedHat 5.1 (net)" -->
|
||
<title>sane-devel: Re: Possible fix for Sane 1.0.1 segfault in RedHat 5.1 (net)</title>
|
||
<h1>Re: Possible fix for Sane 1.0.1 segfault in RedHat 5.1 (net)</h1>
|
||
<b>Milon Firikis</b> (<a href="mailto:milonf@ariadne-t.gr"><i>milonf@ariadne-t.gr</i></a>)<br>
|
||
<i>Fri, 30 Apr 1999 14:48:58 +0300</i>
|
||
<p>
|
||
<ul>
|
||
<li> <b>Messages sorted by:</b> <a href="date.html#412">[ date ]</a><a href="index.html#412">[ thread ]</a><a href="subject.html#412">[ subject ]</a><a href="author.html#412">[ author ]</a>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0413.html">Petter Reinholdtsen: "libtool 1.3 - finally"</a>
|
||
<li> <b>Previous message:</b> <a href="0411.html">Russell W. Behne: "Re: HP ScanJet Plus"</a>
|
||
<li> <b>Maybe in reply to:</b> <a href="0398.html">Graham Stoney: "Possible fix for Sane 1.0.1 segfault in RedHat 5.1 (net)"</a>
|
||
<!-- nextthread="start" -->
|
||
<!-- reply="end" -->
|
||
</ul>
|
||
<!-- body="start" -->
|
||
Graham Stoney wrote:<br>
|
||
<i>> </i><br>
|
||
<i>> [Milon Firikis]</i><br>
|
||
<i>> > I keep getting SIGSEGVs in redhat 5.1</i><br>
|
||
<i>> ></i><br>
|
||
<i>> > I have reported it some time ago... but I am not qualified to find</i><br>
|
||
<i>> > the solution...</i><br>
|
||
<i>> </i><br>
|
||
<i>> I've just tried using the net backend on redhat 5.1, and also got SIGSEGVs.</i><br>
|
||
<i>> It looks like I'm qualified to offer the fix below, but I don't know for sure</i><br>
|
||
<i>> whether it fixes Milon's problem. If it does, his SIGSEGV is likely to turn</i><br>
|
||
<i>> into an error message, though it may not mean that scanning actually works.</i><br>
|
||
<i>> </i><br>
|
||
<i>> My problem was that my backend was not setting the type field for option</i><br>
|
||
<i>> descriptor zero, causing sanei_w_call to fail with wire.status == EINVAL</i><br>
|
||
<i>> because it didn't know how to encode the descriptor's value. In sane-1.0.1,</i><br>
|
||
<i>> backend/net.c:sane_control_option fails to check whether</i><br>
|
||
<i>> sanei_w_call(...,SANE_NET_CONTROL_OPTION,...) succeeds before using the reply</i><br>
|
||
<i>> info. If it fails, we get a segfault. Perhaps something in Milon's config is</i><br>
|
||
<i>> causing this call to fail, but as far as I can see it will cause disaster on</i><br>
|
||
<i>> any system when the sanei_w_call in sane_control_option fails. The first</i><br>
|
||
<i>> patch below adds the missing test, and fixes the segfault.</i><br>
|
||
<p>
|
||
I don't have any kind of bacckend (except net) enabled in my dll.conf.<br>
|
||
It still segfaults where it should return "no devices available)<br>
|
||
<p>
|
||
<i>> </i><br>
|
||
<i>> While looking at the existing backends, I noticed that very few of them set</i><br>
|
||
<i>> the "type" field on option descriptor zero correctly. Most rely on a memset</i><br>
|
||
<i>> of all the option descriptors to set it to zero, giving it a value of</i><br>
|
||
<i>> SANE_TYPE_BOOL. It's meant to be a SANE_TYPE_INT however; we're just lucky</i><br>
|
||
<i>> that the encoding for BOOL and INT is the same, so it works. The remaining</i><br>
|
||
<i>> patches explicitly set the type for the first descriptor to SANE_TYPE_INT in</i><br>
|
||
<i>> all the backends that appear (to my untrained eye) to get it wrong.</i><br>
|
||
<p>
|
||
true SANE_TYPE_INT!=SANE_TYPE_INT, but in practice this cannot lead to a<br>
|
||
SIGSEGV and most certainly it's not Redahat5.1 specific<br>
|
||
<p>
|
||
So I assume you don't use memset to clear the option descriptor space.<br>
|
||
So you find a bug, but unfortuately is not applied to my problem (I<br>
|
||
tested your patch on the net.c and I failed).<br>
|
||
<p>
|
||
MF<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">majordomo@mostang.com</a>
|
||
</pre>
|
||
<!-- body="end" -->
|
||
<p>
|
||
<ul>
|
||
<!-- next="start" -->
|
||
<li> <b>Next message:</b> <a href="0413.html">Petter Reinholdtsen: "libtool 1.3 - finally"</a>
|
||
<li> <b>Previous message:</b> <a href="0411.html">Russell W. Behne: "Re: HP ScanJet Plus"</a>
|
||
<li> <b>Maybe in reply to:</b> <a href="0398.html">Graham Stoney: "Possible fix for Sane 1.0.1 segfault in RedHat 5.1 (net)"</a>
|
||
<!-- nextthread="start" -->
|
||
<!-- reply="end" -->
|
||
</ul>
|