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

Group
 
 

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

Submitter:  julian <julian_>
Submitted:  Wed 09 Nov 2011 01:26:18 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

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

 

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

Attach Files:
   
   
Comment:
   

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

    Date Changed by Updated Field Previous Value => Replaced by
    2011-11-15 CaS StatusReady For Test Fixed
        Open/ClosedIn Test Closed
    2011-11-15 CaS Assigned toCaS None
    2011-11-15 FredKiefer StatusNone Ready For Test
        Assigned toNone CaS
        Open/ClosedOpen In Test
    2011-11-09 julian_ Attached File- Added gnustepbug.zip, #24333

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code