kopia lustrzana https://gitlab.com/sane-project/website
112 wiersze
4.2 KiB
HTML
112 wiersze
4.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: [dev] Memory access violations and leaks</TITLE>
|
|
<META NAME="Author" CONTENT="Henning Meier-Geinitz (henning@meier-geinitz.de)">
|
|
<META NAME="Subject" CONTENT="Re: [dev] Memory access violations and leaks">
|
|
</HEAD>
|
|
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
|
|
<H1>Re: [dev] Memory access violations and leaks</H1>
|
|
<!-- received="Tue May 8 11:49:42 2001" -->
|
|
<!-- isoreceived="20010508184942" -->
|
|
<!-- sent="Tue, 8 May 2001 21:02:16 +0200" -->
|
|
<!-- isosent="20010508190216" -->
|
|
<!-- name="Henning Meier-Geinitz" -->
|
|
<!-- email="henning@meier-geinitz.de" -->
|
|
<!-- subject="Re: [dev] Memory access violations and leaks" -->
|
|
<!-- id="20010508210216.D8948@vortex.swb.de" -->
|
|
<!-- inreplyto="3AF6F250.28998D9A@satzbau-gmbh.de" -->
|
|
<STRONG>From:</STRONG> Henning Meier-Geinitz (<A HREF="mailto:henning@meier-geinitz.de?Subject=Re:%20[dev]%20Memory%20access%20violations%20and%20leaks&In-Reply-To=<20010508210216.D8948@vortex.swb.de>"><EM>henning@meier-geinitz.de</EM></A>)<BR>
|
|
<STRONG>Date:</STRONG> Tue May 08 2001 - 12:02:16 PDT
|
|
<P>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0100.html">Nick Lamb: "Re: EOF detection"</A>
|
|
<UL>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0098.html">Henning Meier-Geinitz: "Re: SANE CVS mails"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0087.html">abel deuring: "Re: [dev] Memory access violations and leaks"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#99">[ date ]</A>
|
|
<A HREF="index.html#99">[ thread ]</A>
|
|
<A HREF="subject.html#99">[ subject ]</A>
|
|
<A HREF="author.html#99">[ author ]</A>
|
|
</UL>
|
|
<HR NOSHADE><P>
|
|
<!-- body="start" -->
|
|
<P>
|
|
Hi,
|
|
<BR>
|
|
<P>On Mon, May 07, 2001 at 09:06:56PM +0200, abel deuring wrote:
|
|
<BR>
|
|
<EM>> I don't think that this is a memory leak:
|
|
</EM><BR>
|
|
<P>[...]
|
|
<BR>
|
|
<P>The mtrace program just looks if the memory is freed explicitely
|
|
<BR>
|
|
before exiting. If it's allocated only once and not again with every
|
|
<BR>
|
|
call of an often called functionthere is no real need to fix this.
|
|
<BR>
|
|
<P>On the other hand it's not that complicated in the case of the
|
|
<BR>
|
|
sane_get_devices() function so I think we should fix it there.
|
|
<BR>
|
|
<P><EM>> num_alloced is a static variable, initialized to zero, fd_info is a
|
|
</EM><BR>
|
|
<EM>> static variable too, hence malloc is only called during the first call
|
|
</EM><BR>
|
|
<EM>> of sanei_scsi_open[_extended]. A corresponding call to free is indeed
|
|
</EM><BR>
|
|
<EM>> missing, but since the memory block pointed to by fd_info should be
|
|
</EM><BR>
|
|
<EM>> available during the entire program run time, we would need to put this
|
|
</EM><BR>
|
|
<EM>> into an exit handler function.
|
|
</EM><BR>
|
|
<P>If it's to complicated, don't do it.
|
|
<BR>
|
|
<P><EM>> But fd_info is not properly initialized. I'm quite surprised that this
|
|
</EM><BR>
|
|
<EM>> did not cause problems...
|
|
</EM><BR>
|
|
<P>Quite often we find errors we are not searching for :-)
|
|
<BR>
|
|
<P>Bye,
|
|
<BR>
|
|
Henning
|
|
<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:%20[dev]%20Memory%20access%20violations%20and%20leaks&In-Reply-To=<20010508210216.D8948@vortex.swb.de>">majordomo@mostang.com</A>
|
|
</PRE>
|
|
<P><!-- body="end" -->
|
|
<HR NOSHADE>
|
|
<UL>
|
|
<!-- next="start" -->
|
|
<LI><STRONG>Next message:</STRONG> <A HREF="0100.html">Nick Lamb: "Re: EOF detection"</A>
|
|
<LI><STRONG>Previous message:</STRONG> <A HREF="0098.html">Henning Meier-Geinitz: "Re: SANE CVS mails"</A>
|
|
<LI><STRONG>In reply to:</STRONG> <A HREF="0087.html">abel deuring: "Re: [dev] Memory access violations and leaks"</A>
|
|
<!-- nextthread="start" -->
|
|
<!-- reply="end" -->
|
|
<LI><STRONG>Messages sorted by:</STRONG>
|
|
<A HREF="date.html#99">[ date ]</A>
|
|
<A HREF="index.html#99">[ thread ]</A>
|
|
<A HREF="subject.html#99">[ subject ]</A>
|
|
<A HREF="author.html#99">[ 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>Tue May 08 2001 - 11:51:14 PDT</EM>
|
|
</EM>
|
|
</SMALL>
|
|
</BODY>
|
|
</HTML>
|