Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.gnustep.bug > #4078

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

From Larry Campbell <INVALID.NOREPLY@gnu.org>
Newsgroups gnu.gnustep.bug
Subject [bug #46956] Thread safety issues in NSUserDefaults.m cause unwarranted exceptions to be raised
Date 2016-01-23 21:24 +0000
Message-ID <mailman.2811.1453584293.843.bug-gnustep@gnu.org> (permalink)
References <20160123-211950.sv28252.3225@savannah.gnu.org>

Show all headers | View raw


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/

Back to gnu.gnustep.bug | Previous | Next | Find similar


Thread

[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

csiph-web