• 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: (no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Nick <email@hidden>
  • Date: Thu, 11 Jul 2002 10:20:25 -0400

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.

  • Follow-Ups:
    • Re: printf leaks
      • From: Lukas Westermann <email@hidden>
References: 
 >(no subject) (From: Paul Fox <email@hidden>)

  • Prev by Date: Re: NSTask, NSFileHandle, readInBackgroundAndNotify and avoiding polling
  • Next by Date: Re: printf leaks
  • Previous by thread: (no subject)
  • Next by thread: Re: printf leaks
  • Index(es):
    • Date
    • Thread