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.
|