bugGNUstep - Bugs: bug #35192, Memory leak in NSException

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #35192: Memory leak in NSException

Submitted by:  Larry Campbell <lcampbel>
Submitted on:  Thu 29 Dec 2011 05:53:08 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Fred Kiefer <FredKiefer>
Open/Closed: Closed

Tue 03 Jan 2012 09:38:48 AM UTC, comment #1:

I added your patch to base. Thank you very much for it!

Please give it another try.

Fred Kiefer <FredKiefer>
Project MemberIn charge of this item.
Thu 29 Dec 2011 05:53:08 PM UTC, original submission:

In trunk, at NSException.m line 960, in this snippet:

====================
- (void) raise
{
if (_reserved == 0)
{
_reserved = NSZoneCalloc([self zone], 2, sizeof(id));
}
_e_stack = [GSStackTrace new]; // leak
====================

If you're re-raising an exception, _e_stack is already populated, and so the assignment clobbers the existing pointer and leaks it. I think the existing stack trace should be preserved by changing the last line of the snippet to:

if (_e_stack == nil)
_e_stack = [GSStackTrace new];

Larry Campbell <lcampbel>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by FredKiefer (Posted a comment)
  • -unavailable- added by lcampbel (Submitted the item)
  • -unavailable- added by lcampbel
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 21 Jan 2014 08:07:42 AM UTCFredKieferStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Tue 03 Jan 2012 09:38:48 AM UTCFredKieferStatusNone=>Ready For Test
      Assigned toNone=>FredKiefer
      Open/ClosedOpen=>In Test
    Thu 29 Dec 2011 05:53:08 PM UTClcampbelCarbon-Copy-=>Added -unavailable-

    Back to the top


    Powered by Savane 3.1-cleanup1