sane-project-website/old-archive/2000-12/0100.html

184 wiersze
6.4 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: seg-faults for network access</TITLE>
<META NAME="Author" CONTENT="Jochen Eisinger (jochen.eisinger@gno.de)">
<META NAME="Subject" CONTENT="Re: seg-faults for network access">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Re: seg-faults for network access</H1>
<!-- received="Sun Dec 10 05:35:00 2000" -->
<!-- isoreceived="20001210133500" -->
<!-- sent="Sun, 10 Dec 2000 14:36:48 +0100" -->
<!-- isosent="20001210133648" -->
<!-- name="Jochen Eisinger" -->
<!-- email="jochen.eisinger@gno.de" -->
<!-- subject="Re: seg-faults for network access" -->
<!-- id="3A3386F0.1E7BD672@gno.de" -->
<!-- inreplyto="20001209213618.C6330@lug.calpoly.edu" -->
<STRONG>From:</STRONG> Jochen Eisinger (<A HREF="mailto:jochen.eisinger@gno.de?Subject=Re:%20seg-faults%20for%20network%20access&In-Reply-To=&lt;3A3386F0.1E7BD672@gno.de&gt;"><EM>jochen.eisinger@gno.de</EM></A>)<BR>
<STRONG>Date:</STRONG> Sun Dec 10 2000 - 05:36:48 PST
<P>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0101.html">Jochen Eisinger: "Re: seg-faults for network access"</A>
<UL>
<LI><STRONG>Previous message:</STRONG> <A HREF="0099.html">Marko Cebokli: "UMAX transparency adapter / averaging"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0091.html">Daniel Kerry Hiltgen: "seg-faults for network access"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0101.html">Jochen Eisinger: "Re: seg-faults for network access"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0101.html">Jochen Eisinger: "Re: seg-faults for network access"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#100">[ date ]</A>
<A HREF="index.html#100">[ thread ]</A>
<A HREF="subject.html#100">[ subject ]</A>
<A HREF="author.html#100">[ author ]</A>
</UL>
<HR NOSHADE><P>
<!-- body="start" -->
<P>
Hi!
<BR>
<P>[Daniel Kerry Hiltgen]
<BR>
<EM>&gt; Does anyone know if saned and the network protocol is byte order clean,
</EM><BR>
<EM>&gt; independent of the underlying architecture? (just a hunch...)
</EM><BR>
The protocol itself is byte order clean, but not the image date
<BR>
transfer...
<BR>
<P><EM>&gt; I've got my scanner hooked up to a Sun Sparc (running linux), and I'm
</EM><BR>
<EM>&gt; trying to access it from an x86 box. Local scans on the sparc seem to
</EM><BR>
<EM>&gt; work, but it's headless/no X so I really want to use my desktop machine
</EM><BR>
<EM>&gt; to do real scans.
</EM><BR>
Do local scans work or scans over localhost?
<BR>
<P>For debugging saned/net use the following:
<BR>
<P>Start saned from commandline as
<BR>
<P># export SANE_DEBUG_YOURBACKEND=128
<BR>
# saned -d128
<BR>
<P>and start scanimage on the other pc as
<BR>
<P>$ export SANE_DEBUG_NET=128
<BR>
$ scanimage -L
<BR>
<P>note that saned also produces output for syslog.
<BR>
<P>In your case, I think, saned isn't even accessed by the net backend...
<BR>
maybe your client has no access rights on the saned port on your sparc?
<BR>
<P><EM>&gt; Here's one stack trace of the seg-fault. (I get roughly the same stack
</EM><BR>
<EM>&gt; in scanimage -L, xsane, and xscanimage)
</EM><BR>
This is always the same... sanei_w_space can't read from the pipe and
<BR>
returns. The next call to sanei_w_space generates a sig11... I've
<BR>
attached a simple patch, maybe you get a better error-msg with this one.
<BR>
<P><EM>&gt; Any thoughts? Can I provide more information that might be helpful in
</EM><BR>
<EM>&gt; diagnosing the problem? (FWIW: Mustek 1200 LS)
</EM><BR>
<P>Could you please try this patch? and if it works (e.g. doesn't segfault
<BR>
anymore), please send the output from saned &amp; scanimage... thanks
<BR>
<P>BTW. the patch was made against the current cvs tree but it should also
<BR>
work with SANE 1.0.3.
<BR>
<P>-- jochen
<BR>
<BR><P>
--- ../sane/sane-backends/sanei/sanei_wire.c Sat Aug 12 17:11:37 2000
<BR>
+++ sane-backends/sanei/sanei_wire.c Sun Dec 10 12:38:19 2000
<BR>
@@ -56,6 +56,9 @@
<BR>
&nbsp;&nbsp;&nbsp;int fd = w-&gt;io.fd;
<BR>
&nbsp;&nbsp;&nbsp;ssize_t nread, nwritten;
<BR>
&nbsp;
<BR>
+ if (w-&gt;status != 0)
<BR>
+ return;
<BR>
+
<BR>
&nbsp;&nbsp;&nbsp;if (w-&gt;buffer.curr + howmuch &gt; w-&gt;buffer.end)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;switch (w-&gt;direction)
<BR>
@@ -80,6 +83,8 @@
<BR>
&nbsp;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case WIRE_DECODE:
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;left_over = w-&gt;buffer.end - w-&gt;buffer.curr;
<BR>
+ if ((signed) (left_over &lt; 0))
<BR>
+ return;
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (left_over)
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;memcpy (w-&gt;buffer.start, w-&gt;buffer.curr, left_over);
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;w-&gt;buffer.curr = w-&gt;buffer.start;
<BR>
<P><P><P><P><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:%20seg-faults%20for%20network%20access&In-Reply-To=&lt;3A3386F0.1E7BD672@gno.de&gt;">majordomo@mostang.com</A>
</PRE>
<P><!-- body="end" -->
<HR NOSHADE>
<UL>
<!-- next="start" -->
<LI><STRONG>Next message:</STRONG> <A HREF="0101.html">Jochen Eisinger: "Re: seg-faults for network access"</A>
<LI><STRONG>Previous message:</STRONG> <A HREF="0099.html">Marko Cebokli: "UMAX transparency adapter / averaging"</A>
<LI><STRONG>In reply to:</STRONG> <A HREF="0091.html">Daniel Kerry Hiltgen: "seg-faults for network access"</A>
<!-- nextthread="start" -->
<LI><STRONG>Next in thread:</STRONG> <A HREF="0101.html">Jochen Eisinger: "Re: seg-faults for network access"</A>
<LI><STRONG>Reply:</STRONG> <A HREF="0101.html">Jochen Eisinger: "Re: seg-faults for network access"</A>
<!-- reply="end" -->
<LI><STRONG>Messages sorted by:</STRONG>
<A HREF="date.html#100">[ date ]</A>
<A HREF="index.html#100">[ thread ]</A>
<A HREF="subject.html#100">[ subject ]</A>
<A HREF="author.html#100">[ 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 Dec 10 2000 - 05:36:18 PST</EM>
</EM>
</SMALL>
</BODY>
</HTML>