bugGNUstep - Bugs: bug #34782, calling -[NSUserDefaults...

 
 

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

bug #34782: calling -[NSUserDefaults setObject:forKey:] with nil object can cause crashes

Submitted by:  julian <julian_>
Submitted on:  Wed 09 Nov 2011 01:26:18 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Tue 15 Nov 2011 12:56:07 PM UTC, comment #4:

thanks i can confirm the problem is gone.

julian <julian_>
Tue 15 Nov 2011 09:49:08 AM UTC, comment #3:

Sorry, Yes I did.

Richard Frith-Macdonald <CaS>
Project Member
Tue 15 Nov 2011 08:48:17 AM UTC, comment #2:

I think Richard fixed that bug a while ago in base but forgot to state this here. Could you please give it another try?

Fred Kiefer <FredKiefer>
Project Member
Wed 09 Nov 2011 01:29:00 PM UTC, comment #1:

btw in cocoa

[[NSUserDefaults standardUserDefaults] setObject:0 forKey:@"bla"];

seems to be equivalent with

[[NSUserDefaults standardUserDefaults] removeObjectforKey:@"bla"];

julian <julian_>
Wed 09 Nov 2011 01:26:18 PM UTC, original submission:

hello again

as the title says this code can lead to crashes:

[[NSUserDefaults standardUserDefaults] setObject:0 forKey:@"bla"];

i've attached a small sample. choosing the "choose me" in the popup button opens a sheet. clicking the close button in the sheet makes the faulty user defaults call.

trying to open the sheet again terminates the app with a segfault. weirdly again i can't get a backtrace from gdb, because everything just freezes and i have to kill -9 the process from a virtual terminal.

weirdly the same call additionally causes an X11 error "X-Windows error - RenderBadPicture (invalid Picture parameter)" in my full app but not in this sample - but i guess something just goes horribly wrong and if this bug is fixed the X11 error will vanish too.

btw sorry i just now realized that is probably a bad idea to submit minimal samples that contain "@synthesize". now in pure obj-c 1.0 ;-)

julian <julian_>

 

Attached Files
file #24333:  gnustepbug.zip added by julian_ (119KiB - application/zip)

 

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 FredKiefer (Posted a comment)
  • -unavailable- added by julian_ (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 15 Nov 2011 12:59:02 PM UTCCaSStatusReady For Test=>Fixed
      Open/ClosedIn Test=>Closed
    Tue 15 Nov 2011 09:49:08 AM UTCCaSAssigned toCaS=>None
    Tue 15 Nov 2011 08:48:17 AM UTCFredKieferStatusNone=>Ready For Test
      Assigned toNone=>CaS
      Open/ClosedOpen=>In Test
    Wed 09 Nov 2011 01:26:18 PM UTCjulian_Attached File-=>Added gnustepbug.zip, #24333

    Back to the top


    Powered by Savane 3.1-cleanup1