Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.gnustep.bug > #4078 > unrolled thread

[bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted exceptions to be raised

Started byLarry Campbell <INVALID.NOREPLY@gnu.org>
First post2016-01-23 21:24 +0000
Last post2016-01-23 21:24 +0000
Articles 1 — 1 participant

Back to article view | Back to gnu.gnustep.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted exceptions to be raised Larry Campbell <INVALID.NOREPLY@gnu.org> - 2016-01-23 21:24 +0000

#4078 — [bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted exceptions to be raised

FromLarry Campbell <INVALID.NOREPLY@gnu.org>
Date2016-01-23 21:24 +0000
Subject[bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted exceptions to be raised
Message-ID<mailman.2811.1453584293.843.bug-gnustep@gnu.org>
Follow-up Comment #1, bug #46956 (project gnustep):

(sorry for the formatting; don't know how to get bugzilla to preserve
indentation)

Part, but not all, of the problem is that parsingArguments is being protected
by the _lock ivar, but because parsingArguments is file static, and you can
have multiple NSUserDefaults objects in play, that's not sufficient. You need
to use classLock here.

But you can still end up with the second thread trying to call
_createArgumentDictionary getting a nil arguments dictionary. Since my
applications don't use that, I stopped there. I'll shortly be attaching a
patch that fixes that, and that adds a sleep-and-retry loop for the case where
some thread needs the standardUserDefaults but another thread is still in the
process of creating it. We probably need a similar sleep-and-retry loop for
_createArgumentDictionary but I didn't go that far because, as I said, I don't
use it.


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?46956>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/

[toc] | [standalone]


Back to top | Article view | gnu.gnustep.bug


csiph-web