kopia lustrzana https://gitlab.com/sane-project/website
226 wiersze
7.5 KiB
HTML
226 wiersze
7.5 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: pnm backend crashes graphical frontends (patch?)</TITLE>
|
|
<META NAME="Author" CONTENT="Henning Meier-Geinitz (hmg-ml@gmx.de)">
|
|
<META NAME="Subject" CONTENT="Re: pnm backend crashes graphical frontends (patch?)">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: pnm backend crashes graphical frontends (patch?)</H1>
|
|
<!-- received="Mon Sep 25 11:58:45 2000" -->
|
|
<!-- isoreceived="20000925185845" -->
|
|
<!-- sent="Mon, 25 Sep 2000 21:09:44 +0200" -->
|
|
<!-- isosent="20000925190944" -->
|
|
<!-- name="Henning Meier-Geinitz" -->
|
|
<!-- email="hmg-ml@gmx.de" -->
|
|
<!-- subject="Re: pnm backend crashes graphical frontends (patch?)" -->
|
|
<!-- id="20000925210944.C10590@hmg1.vortex.swb.de" -->
|
|
<!-- inreplyto="00092510593600.00347@slowcrap" -->
|
|
<STRONG>From:</STRONG> Henning Meier-Geinitz (<A HREF="mailto:hmg-ml@gmx.de?Subject=Re:%20pnm%20backend%20crashes%20graphical%20frontends%20(patch?)&In-Reply-To=<20000925210944.C10590@hmg1.vortex.swb.de>"><EM>hmg-ml@gmx.de</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Mon Sep 25 2000 - 12:09:44 PDT
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0261.html">Henning Meier-Geinitz: "SANE BeOS port"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0259.html">Bruce DeVisser: "HP 5100C debugging help needed"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0254.html">mh: "pnm backend crashes graphical frontends (patch?)"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0267.html">mh: "Re: pnm backend crashes graphical frontends (patch?)"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0267.html">mh: "Re: pnm backend crashes graphical frontends (patch?)"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#260">[ date ]</A>
|
|
<A HREF="index.html#260">[ thread ]</A>
|
|
<A HREF="subject.html#260">[ subject ]</A>
|
|
<A HREF="author.html#260">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hi,
|
|
<BR>
|
|
<P>On Mon, Sep 25, 2000 at 10:50:47AM +0200, mh wrote:
|
|
<BR>
|
|
<EM>> I don't know, whether this is of interest, since I can't find it on the
|
|
</EM><BR>
|
|
<EM>> TODO list.
|
|
</EM><BR>
|
|
<P>If something crashes in SANE it will be always of interest :-)
|
|
<BR>
|
|
<P><EM>> It seems that the pnm backend (still) randomly crashes the graphical
|
|
</EM><BR>
|
|
<EM>> frontends.
|
|
</EM><BR>
|
|
<EM>> (activate "Three-Pass Simulation"->scan preview->deactivate
|
|
</EM><BR>
|
|
<EM>> "Three-Pass Simulation"->activate "Grayify" and "Hand-Scanner
|
|
</EM><BR>
|
|
<EM>> Simulation"->scan preview->crash)
|
|
</EM><BR>
|
|
<P>I can't reproduce this here (no crash) but this needn't mean anything.
|
|
<BR>
|
|
<P><EM>> IMHO the problem is a static variable which is used as a counter
|
|
</EM><BR>
|
|
<EM>> for an array. This one "points" outside the array under several
|
|
</EM><BR>
|
|
<EM>> circumstances.
|
|
</EM><BR>
|
|
<P>Are you talking about rgbleftover? Where exactly does the pnm backend crash?
|
|
<BR>
|
|
<P><EM>> Can someone test the attached patch (for pnm.c in Sane-1.0.3) and
|
|
</EM><BR>
|
|
<EM>> confirm that it fixes the problem? (it does for me)
|
|
</EM><BR>
|
|
<P>I didn't look too close at the code but are you sure that moving the three
|
|
<BR>
|
|
variables inside the function will cure the segfaults? Isn't this just good
|
|
<BR>
|
|
luck?
|
|
<BR>
|
|
<P>Could you locate the exact problem with gdb?
|
|
<BR>
|
|
<P>While trying to reproduce "your" bug I found another one: pnm.c doesn't like
|
|
<BR>
|
|
changing the frame type and bit depth during runtime! If you load a 1 bit
|
|
<BR>
|
|
lineart pnm and than a 8 bit gray --> segfault (in the frontend preview). If
|
|
<BR>
|
|
you load a grayscale (8 bit) and then color (3*8 bit) -> segfault. pnm.c
|
|
<BR>
|
|
initializes params.dpth and ppm_type at the beginning but not after a change
|
|
<BR>
|
|
of the input image (at least not in every case).
|
|
<BR>
|
|
<P>This reveals another problem: xscanimage doesn't test if it gets too much
|
|
<BR>
|
|
data from the backend (at least in preview mode).
|
|
<BR>
|
|
<P>Here is a patch for pnm.c (against latest cvs). This is just a quick hack. I
|
|
<BR>
|
|
will look more closely at pnm.c during the next days/weeks. Maybe I can find
|
|
<BR>
|
|
other bugs. Any ideas for fixes or addional features?
|
|
<BR>
|
|
<P>Bye,
|
|
<BR>
|
|
Henning
|
|
<BR>
|
|
<P><P>Index: backend/pnm.c
|
|
<BR>
|
|
===================================================================
|
|
<BR>
|
|
RCS file: /cvsroot/external/sane/backend/pnm.c,v
|
|
<BR>
|
|
retrieving revision 1.2
|
|
<BR>
|
|
diff -u -r1.2 pnm.c
|
|
<BR>
|
|
--- pnm.c 2000/08/12 15:09:29 1.2
|
|
<BR>
|
|
+++ pnm.c 2000/09/25 19:06:19
|
|
<BR>
|
|
@@ -414,17 +414,21 @@
|
|
<BR>
|
|
{
|
|
<BR>
|
|
/* Binary monochrome. */
|
|
<BR>
|
|
parms.depth = 1;
|
|
<BR>
|
|
- gray = SANE_TRUE;
|
|
<BR>
|
|
-
|
|
<BR>
|
|
ppm_type = ppm_bitmap;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
else if (!strncmp (buf, "P5", 2))
|
|
<BR>
|
|
{
|
|
<BR>
|
|
/* Grayscale. */
|
|
<BR>
|
|
- gray = SANE_TRUE;
|
|
<BR>
|
|
+ parms.depth = 8;
|
|
<BR>
|
|
ppm_type = ppm_greyscale;
|
|
<BR>
|
|
+ }
|
|
<BR>
|
|
+ else if (!strncmp (buf, "P6", 2))
|
|
<BR>
|
|
+ {
|
|
<BR>
|
|
+ /* Color. */
|
|
<BR>
|
|
+ parms.depth = 8;
|
|
<BR>
|
|
+ ppm_type = ppm_color;
|
|
<BR>
|
|
}
|
|
<BR>
|
|
- else if (strncmp (buf, "P6", 2))
|
|
<BR>
|
|
+ else
|
|
<BR>
|
|
{
|
|
<BR>
|
|
DBG(2, "%s is not a recognized PPM\n", filename);
|
|
<BR>
|
|
fclose (fn);
|
|
<BR>
|
|
@@ -444,7 +448,7 @@
|
|
<BR>
|
|
parms.lines = -1;
|
|
<BR>
|
|
else
|
|
<BR>
|
|
parms.lines = y;
|
|
<BR>
|
|
- if (gray)
|
|
<BR>
|
|
+ if ((ppm_type == ppm_greyscale) || (ppm_type == ppm_bitmap) || gray)
|
|
<BR>
|
|
parms.format = SANE_FRAME_GRAY;
|
|
<BR>
|
|
else
|
|
<BR>
|
|
{
|
|
<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:%20pnm%20backend%20crashes%20graphical%20frontends%20(patch?)&In-Reply-To=<20000925210944.C10590@hmg1.vortex.swb.de>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0261.html">Henning Meier-Geinitz: "SANE BeOS port"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0259.html">Bruce DeVisser: "HP 5100C debugging help needed"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0254.html">mh: "pnm backend crashes graphical frontends (patch?)"</A>
|
|
<!-- nextthread="start" -->
|
|
<LI><STRONG>Next in thread:</STRONG> <A HREF="0267.html">mh: "Re: pnm backend crashes graphical frontends (patch?)"</A>
|
|
<LI><STRONG>Reply:</STRONG> <A HREF="0267.html">mh: "Re: pnm backend crashes graphical frontends (patch?)"</A>
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#260">[ date ]</A>
|
|
<A HREF="index.html#260">[ thread ]</A>
|
|
<A HREF="subject.html#260">[ subject ]</A>
|
|
<A HREF="author.html#260">[ 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>Mon Sep 25 2000 - 11:59:44 PDT</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|