bugGNUstep - Bugs: bug #35164, reference not released after...

 
 

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

bug #35164: reference not released after servicing proxy request

Submitted by:  rajendra <rajendra123>
Submitted on:  Fri 23 Dec 2011 09:06:39 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: In Test

Tue 27 Dec 2011 10:33:00 PM UTC, comment #2:

Thanks Rich.

I have made the change as you suggested. Which is, modified NSConnection.m line 2555 from

[decoder decodeValueOfObjCType: @encode(id) at: &object];

to

object = [decoder decodeObject];

I have tested this and I do not see the earlier issue I mentioned.

Thanks
Rajendra

rajendra <rajendra123>
Sat 24 Dec 2011 01:16:17 PM UTC, comment #1:

Thanks very much ... I fixed that by correcting the code to use -decodeObject rather than -decodeValueOfObjCType:at: so that the targetof the invocation will be autoreleased.
Please give it a try.

Richard Frith-Macdonald <CaS>
Project Member
Fri 23 Dec 2011 09:06:39 PM UTC, original submission:

Hi,
I am developing a DO application and I see that after invoking a method from client process, retain count of root object increments by 1. If I keep repeating this, retain counter keeps incrementing.

Even when connection between client and server is released properly (server process receiving proxy_release message), references are not decremented to what it was before proxy was created.

From my debugging, I see root object reference is incremented 2 times in processing the method request but release happens only 1 time. Following are the 2 places:

First place:
#1 0x00007ffff766b311 in +[GSDistantObjectPlaceHolder initWithCoder:] (self=0x7ffff7b125c0, _cmd=<optimized out>, aCoder=<optimized out>) at NSDistantObject.m:224
#2 0x00007ffff76d75ec in -[NSPortCoder decodeValueOfObjCType:at:] (self=0x77e208, _cmd=0x7ffff7b04630, type=<optimized out>, address=0x7fffffffd0a8) at NSPortCoder.m:611
#3 0x00007ffff763e26c in -[NSConnection(Private) _service:forwardForProxy:] (self=0x72fd38, _cmd=0x7ffff7b04880, aRmc=0x77e208) at NSConnection.m:2555
#4 0x00007ffff763d298 in -[NSConnection(Private) handlePortMessage:] (self=0x65d178, _cmd=0x7ffff7b93270, msg=0x72fff8) at NSConnection.m:2335

2nd place:
#1 0x00007ffff77657ef in -[GSFFIInvocation invokeWithTarget:] (self=0x77a848, _cmd=<optimized out>, anObject=0x71da58) at GSFFIInvocation.m:449
#2 0x00007ffff768cae4 in -[NSInvocation invoke] (self=0x77a848, _cmd=0x7ffff7b04930) at NSInvocation.m:627
#3 0x00007ffff763e983 in -[NSConnection(Private) _service:forwardForProxy:] (self=0x72fd38, _cmd=0x7ffff7b04880, aRmc=0x77e208) at NSConnection.m:2695
#4 0x00007ffff763d298 in -[NSConnection(Private) handlePortMessage:] (self=0x65d178, _cmd=0x7ffff7b93270, msg=0x72fff8) at NSConnection.m:2335

second retain is released when invokation is deallocated. But nobody seems to be releasing the first retain.

I think [NSConnection(Private) _service:forwardForProxy:] should release the reference after invoking the method because it gets 1 reference as part of following call:

/* Decode the object, (which is always the first argument to a method). */
[decoder decodeValueOfObjCType: @encode(id) at: &object];

When I added "[object autorelease]" after the above line then things seems to work fine. No crash and reference counts are correct after executing methods multiple times.

So this is probably a bug. I am using gnustep-base-1.23.0.

Thanks
Rajendra

rajendra <rajendra123>

 

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 CaS (Posted a comment)
  • -unavailable- added by rajendra123 (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 24 Dec 2011 01:16:17 PM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>In Test

    Back to the top


    Powered by Savane 3.1-cleanup1