• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: printf leaks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printf leaks


  • Subject: Re: printf leaks
  • From: Lukas Westermann <email@hidden>
  • Date: Thu, 11 Jul 2002 16:25:02 +0200
  • Organization: AdNovum

Well, so just no longer use printf :P
Anyway, if you are only writing Cocoa, you wont
longer need printf or other Standard C Functions.
Erm, does cout leaks too ?

Greets
Luki

Nick wrote:

Ouch. It leeks on my system too. This does not bode well for the Darwin developers. Is that what they call a 'stable' release?


Nick


On Thursday, July 11, 2002, at 08:53 AM, Paul Fox wrote:

To: email@hidden
Subject: Re: VERY BAD: Memory leak in printf?
X-Mailer: Created by CRiSP-Mail v6.3 (CRiSP v8.0.6b)
Date: Thu, 11 Jul 2002 13:20:25 +0000

If I run 'leaks' on my running app, I appear to get memory
leaks from inside printf:

abridged stack trace:

-[NSView _recursiveDisplayAllDirtyWithLockFocus:visRect:] | -[NSView _drawRect:clip:] | -[CrispVi
ew drawRect:] | printf | vfprintf | cvt | __dtoa | malloc | malloc_zone_malloc

Is this a false report? Known bug in printf? Nothing to worry about?

thanx


Oh dear. This is a _very_bad_ memory leak in printf.
I tried some simple code, such as:

printf("%d\n", i);

in a loop. No bug.

I tried:

printf("%g\n", f);

in a loop. No bug.

The bug appears to be if more than one float spec is used. The following
chews memory like there is no tomorrow. I'll see if I can raise a bug
on it if I can find the page:

int main(int argc, char **argv)
{ int i = 0, j;
float f = 0;

while (1) {
for(j = 0; j < 1000; j++, i++, f++)
printf("%d %u %x %g,%g,%g,%g\n",
i, i, i, f, f, f, f);
sleep(1);
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.



--
+---------------------------------------------------------------------+
Lukas Westermann mailto:email@hidden


AdNovum Informatik AG http://www.adnovum.ch phone: +41 (1) 272 6111
Roentgenstrasse 22, CH-8005 Zuerich fax: +41 (1) 272 6312
+---------------------------------------------------------------------+
AdNovum Software Inc. San Mateo, CA 94404 phone: +1 (650) 525 9322
1400 Fashion Island Boulevard, Suite 309 fax: +1 (650) 525 9324
+---------------------------------------------------------------------+
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: (no subject) (From: Nick <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: Re: Cocoa Printing, Getting correct margins
  • Previous by thread: Re: (no subject)
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread