bugGNUstep - Bugs: bug #20163, Thread safety of -[GSHTTPURLHandle...


bug #20163: Thread safety of -[GSHTTPURLHandle loadInForeground]

Submitted by:  Graham J Lee <iamleeg>
Submitted on:  Wed 13 Jun 2007 11:38:44 AM UTC  
Category:  Base/Foundation Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Thu 19 Jan 2012 10:23:34 AM UTC, comment #7: 

More recent versions of the GNU runtime fix this.

Richard Frith-Macdonald <CaS>
Project Member
Fri 05 Feb 2010 06:18:01 PM UTC, comment #6: 

people should use a patched libobjc or try libobjc2 from the gnustep svn repository (or simply call a class method before starting threads).

Richard Frith-Macdonald <CaS>
Project Member
Fri 12 Jun 2009 07:14:40 AM UTC, comment #5: 

Changed status to 'fixed' since this is actually an objc runtime bug, and we have a patch to the runtime which fixes it.

Richard Frith-Macdonald <CaS>
Project Member
Mon 08 Dec 2008 08:48:25 AM UTC, comment #4: 

I added a gcc/libobjc bug report for this at

I can supply a patch against gcc subversion for the runtime if people are interested.

Richard Frith-Macdonald <CaS>
Project Member
Wed 13 Jun 2007 05:35:03 PM UTC, comment #3: 

Thanks Richard, workaround seems to do the trick :-)

Graham J Lee <iamleeg>
Wed 13 Jun 2007 05:23:52 PM UTC, comment #2: 

Calling [NSURLHandle class] before detaching any threads should work around the problem ... please give it a try.

Richard Frith-Macdonald <CaS>
Project Member
Wed 13 Jun 2007 04:53:31 PM UTC, comment #1: 

I think this might be due to an objc-runtime bug ... am investigating.

Richard Frith-Macdonald <CaS>
Project Member
Wed 13 Jun 2007 11:38:44 AM UTC, original submission:  

The attached program will attempt to fetch from an NSURLHandle multiple times, spawning multiple threads to do it.  On apple-apple-* it works as expected, and every fetch results in some data being available.  On gnu-gnu-* it doesn't work reliably, with more than one worker thread.  Sometimes it's completely successful, but sometimes some of the -[NSURLHandle loadInForeground] requests return nil and, as I've been testing with HTTP URLs, also don't have an NSHTTPPropertyStatusCodeKey; it seems like the method returns without actually having performed the load.

Graham J Lee <iamleeg>


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

Attach Files:

Attached Files
file #13037:  NSURLHandleThreads.m added by iamleeg (3KiB - text/x-objcsrc)
file #13038:  GNUmakefile added by iamleeg (166B - application/octet-stream)


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 iamleeg (Submitted the item)

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

    Only logged-in users can vote.




    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-01-19 CaS Open/ClosedAnalyzed => Closed
    2010-02-05 CaS Open/ClosedOpen => Analyzed
    2009-06-12 CaS StatusNone => Fixed
    2007-06-13 iamleeg Attached File- => Added NSURLHandleThreads.m, #13037
        Attached File- => Added GNUmakefile, #13038

    Back to the top

    Powered by Savane 3.6