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

Group
 
 

bug #35164: reference not released after servicing proxy request

Submitter:  rajendra <rajendra123>
Submitted:  Fri 23 Dec 2011 09:06:39 PM UTC
   
 
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  In Test
* Mandatory Fields

Add a New Comment Rich Markup
   

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>
Group 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>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by rajendra123 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-12-24 CaS StatusNone Fixed
        Open/ClosedOpen In Test

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code