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

Group
 
 

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

Submitter:  Sergei Golovin <svg>
Submitted:  Thu 02 Oct 2014 01:38:55 PM UTC
   
 
Category:  Libraries Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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

 

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

Attach Files:
   
   
Comment:
   

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
  • -email is unavailable- added by CaS (Posted a comment)
  • -email is unavailable- added by svg (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-10-03 CaS StatusNone Fixed
        Open/ClosedOpen Closed
    2014-10-02 svg Attached File- Added ConsequentWebServers.tar.bz2, #32211
        Attached File- Added mainIOThreadRRCBalancing.patch, #32212

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code