bugGNUstep - Bugs: bug #43348, [WebServer] Retain/release balance...

 
 

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

bug #43348: [WebServer] Retain/release balance is broken for main IOThread

Submitted by:  Sergei Golovin <svg>
Submitted on:  Thu 02 Oct 2014 01:38:55 PM UTC  
 
Category: LibrariesSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Fri 03 Oct 2014 05:02:54 AM UTC, comment #1:

Thanks very much ... that's great. I applied your patch.

Richard Frith-Macdonald <CaS>
Project Member
Thu 02 Oct 2014 01:38:55 PM UTC, original submission:

----- it is what i previously reported in the mail list --------
I need to start NSURLConnection tests consequently.
That means that after a test starting WebServer has been completed another test is started.
If the former shuts down it's WebServer instance the latter should start it's own instance.
There is the problem i have. It seems the second WebServer instance starts fine but any connection
to it fails for 'Connection refused'. And i get

Uncaught exception NSInternalInconsistencyException, reason: Deallocating an active thread without [+exit]!

at the end of the second test on destroying of the WebServer instance.

A simplified test session is attached.
------------------ the end of the report ---------------------

Since that time I have found that it is the retain/release cycle for the main IOThread is unbalanced and is the culprit.
There is assigning of the main thread in the method -[WebServer _setup]

_ioMain->thread = [NSThread currentThread];

Later the test session tries to destroy the WebServer instance as a usual cleaning practice. It leads eventually to deallocation of the main IOThread. The method -[IOThread dealloc] tries to release not-retained (see above) ivar 'thread'

[thread release];

that causes the exception.
The trivial patch curing the problem for me is attached.

Sergei Golovin <svg>

 

Attached Files
file #32211:  ConsequentWebServers.tar.bz2 added by svg (1KiB - application/x-bzip2)
file #32212:  mainIOThreadRRCBalancing.patch added by svg (462B - text/x-patch)

 

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 svg (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 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 03 Oct 2014 05:02:54 AM UTCCaSStatusNone=>Fixed
      Open/ClosedOpen=>Closed
    Thu 02 Oct 2014 01:38:55 PM UTCsvgAttached File-=>Added ConsequentWebServers.tar.bz2, #32211
      Attached File-=>Added mainIOThreadRRCBalancing.patch, #32212

    Back to the top


    Powered by Savane 3.1-cleanup1