sane-project-website/old-archive/1999-04/0412.html

82 wiersze
4.4 KiB
HTML
Czysty Wina Historia

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

<!-- 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>&gt; </i><br>
<i>&gt; [Milon Firikis]</i><br>
<i>&gt; &gt; I keep getting SIGSEGVs in redhat 5.1</i><br>
<i>&gt; &gt;</i><br>
<i>&gt; &gt; I have reported it some time ago... but I am not qualified to find</i><br>
<i>&gt; &gt; the solution...</i><br>
<i>&gt; </i><br>
<i>&gt; I've just tried using the net backend on redhat 5.1, and also got SIGSEGVs.</i><br>
<i>&gt; It looks like I'm qualified to offer the fix below, but I don't know for sure</i><br>
<i>&gt; whether it fixes Milon's problem. If it does, his SIGSEGV is likely to turn</i><br>
<i>&gt; into an error message, though it may not mean that scanning actually works.</i><br>
<i>&gt; </i><br>
<i>&gt; My problem was that my backend was not setting the type field for option</i><br>
<i>&gt; descriptor zero, causing sanei_w_call to fail with wire.status == EINVAL</i><br>
<i>&gt; because it didn't know how to encode the descriptor's value. In sane-1.0.1,</i><br>
<i>&gt; backend/net.c:sane_control_option fails to check whether</i><br>
<i>&gt; sanei_w_call(...,SANE_NET_CONTROL_OPTION,...) succeeds before using the reply</i><br>
<i>&gt; info. If it fails, we get a segfault. Perhaps something in Milon's config is</i><br>
<i>&gt; causing this call to fail, but as far as I can see it will cause disaster on</i><br>
<i>&gt; any system when the sanei_w_call in sane_control_option fails. The first</i><br>
<i>&gt; 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>&gt; </i><br>
<i>&gt; While looking at the existing backends, I noticed that very few of them set</i><br>
<i>&gt; the "type" field on option descriptor zero correctly. Most rely on a memset</i><br>
<i>&gt; of all the option descriptors to set it to zero, giving it a value of</i><br>
<i>&gt; SANE_TYPE_BOOL. It's meant to be a SANE_TYPE_INT however; we're just lucky</i><br>
<i>&gt; that the encoding for BOOL and INT is the same, so it works. The remaining</i><br>
<i>&gt; patches explicitly set the type for the first descriptor to SANE_TYPE_INT in</i><br>
<i>&gt; 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>