bugÉtoilé - Bugs: bug #10375, Grr crashes when fetching data...

 
 
Show feedback again

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

bug #10375: Grr crashes when fetching data from a feed

Submitted by:  Maurizio Tomasi <zio_tom78>
Submitted on:  Thu 22 Nov 2007 05:37:25 PM UTC  
 
Category: Grr / RSSKitSeverity: 3 - Normal
Priority: 5 - NormalStatus: None
Privacy: PublicAssigned to: Guenther Noack <guenther>
Open/Closed: OpenOperating System: GNU/Linux

Fri 29 Oct 2010 06:26:31 PM UTC, comment #1:

Guenther, can I close this given that Grr is not hosted in Etoile repository anymore or do you want to keep it open as a reminder?

Quentin Mathé <qmathe>
Project Administrator
Thu 22 Nov 2007 05:37:25 PM UTC, original submission:

I have downloaded the source code of Etoile SVN (snapshot of 19-11-2007) and am playing with it under the following configuration:

Ubuntu Linux 7.10 (gutsy)
Gnome 2.20.1 (using Xgl + compiz)
gcc 4.1.3
GNUstep-back-0.13.0
GNUstep-base-1.15.1
GNUstep-gui-0.13.0
GNUstep-make-2.0.2

When I run Grr, it crashes with SIGSEGV very often while fetching data from a feed (any URL can potentially trigger the crash). A GDB backtrace is attached.

The problem seems to be in the RSSKit library. In the file Etoile/Frameworks/RSSKit/RSSArticleCreationListener.m, line 321, the "unlocalizedDefaults" static variable is used in a [NSCalendarDate dateWithString:] call.

After some debug, I found that `unlocalizedDefaults' is correctly initialized (line 289) and accessed a number of times without problems. But at some time, the variable apparently goes crazy, as this GDB session shows:

=======================================================
(gdb) frame 3
#3 0xb7fd0c5a in -[RSSArticleComposer setDateFromString:] (self=0x8534588, _cmd=0xb7fd8530,
str=0x8386240) at RSSArticleCreationListener.m:318
318 d = [NSCalendarDate dateWithString: str
(gdb) print unlocalizedDefaults
$1 = (class NSDictionary *) 0x84a9a30
(gdb) print *unlocalizedDefaults
$2 = {{isa = 0xdeadface}}
(gdb) po unlocalizedDefaults

Program received signal SIGSEGV, Segmentation fault.
0xb783b434 in objc_msg_lookup () from /usr/lib/libobjc.so.1
=======================================================

I have checked the address of the pointer (0x84a9a30), it did not change during the program execution.

I have found that this problem can be avoided by tweaking a bit the code (RSSArticleCreationListener.m lines 288-290):

if (unlocalizedDefaults == nil) {
unlocalizedDefaults = [[NSUserDefaults _unlocalizedDefaults]; // private NSDictionary method.
}

into

if (unlocalizedDefaults == nil) {
unlocalizedDefaults = [[NSUserDefaults standardUserDefaults] dictionaryRepresentation];
}

I decided to do this change because I found in the GNUstep source that _unlocalizedDefaults is a deprecated function and tried therefore to find something else. But I am not really sure about the correctness of this substitution, and why using `_unlocalizedDefaults' could mess up the memory.

Maurizio Tomasi <zio_tom78>

 

Attached Files
file #3242:  Grr-backtrace added by zio_tom78 (4kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by qmathe (Posted a comment)
  • -unavailable- added by zio_tom78 (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 29 Oct 2010 06:26:31 PM UTCqmatheAssigned toNone=>guenther
    Thu 22 Nov 2007 05:37:25 PM UTCzio_tom78Attached File-=>Added Grr-backtrace, #3242
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup