Al 18/09/10 11:55, En/na Luca Olivetti ha escrit:
Al 17/09/10 22:10, En/na Luca Olivetti ha escrit:
Al 17/09/10 17:37, En/na Luca Olivetti ha escrit:
En/na Luca Olivetti ha escrit:
En/na Luca Olivetti ha escrit:

Since I still have the RPMs built under mandriva 2009.1, I replaced
everything with the old versions (gnustep-base included) and the stack
smashing is still there, so it's either another library causing it (it
happens in libc) or an underlying problem in sope/sogo.


Well, I really need some help here (not knowing much about objective c
and gdb).

google helped ;-)

I loaded the database with just one of the events causing the crash, I
attached the debugger to the running sogo and I can inspect the full
backtrace.

The problem appears to be here:
...
#7 0xb757cfd0 in -[iCalMonthlyRecurrenceCalculator
recurrenceRangesWithinCalendarDateRange:] (self=0xa2bdcf0,
_cmd=0xb759f9f0,
_r=0xa5c6c20) at iCalMonthlyRecurrenceCalculator.m:433
433 }
Current language: auto; currently objective-c
(gdb)


Not very helpful (to me) since line 433 is the closing bracket of the
method, so let's see with what parameters it was called:

Well, that's actually the point. It appears that "ranges" gets messed
up.
I stepped in the program, and when it calls the method
"_addInstanceWithStartDate" (line 418 of
iCalMonthlyRecurrenceCalculator.m), inside that method at line 170 it
does:

[_ranges addObject: r]

Just before that line:

(gdb) p -[_ranges count]
$9 = 0


But right after executing it:

(gdb) p -[_ranges count]
$11 = 4294967295

I also stepped into the -[GSMutableArray addObject:] method and it seems
to do the right thing:

(gdb) break iCalMonthlyRecurrenceCalculator.m:170
Breakpoint 1 at 0xb757c08a: file iCalMonthlyRecurrenceCalculator.m, line
170.
(gdb) c
Continuing.

Breakpoint 1, -[iCalMonthlyRecurrenceCalculator
_addInstanceWithStartDate:limitDate:limitRange:toArray:]
(self=0xa48bdd8,
_cmd=0xb759b138, _startDate=0xa6199d0, _until=0x0, _r=0x925cf68,
_ranges=0xa619970) at iCalMonthlyRecurrenceCalculator.m:170
170 [_ranges addObject: r];
(gdb) s
-[GSMutableArray addObject:] (self=0xb759247c, _cmd=0xa48bdd8,
anObject=0xb70050c0) at GSArray.m:408
408 {
(gdb) s
409 if (anObject == nil)
(gdb) s
414 if (_count >= _capacity)
(gdb) s
429 _contents_array[_count] = RETAIN(anObject);
(gdb) p _count
$1 = 0
(gdb) p _capacity
$2 = 2
(gdb) next
430 _count++; /* Do this AFTER we have retained the object. */
(gdb) p _count
$3 = 0
(gdb) next
431 }
(gdb) p _count
$4 = 1
(gdb) next
-[iCalMonthlyRecurrenceCalculator
_addInstanceWithStartDate:limitDate:limitRange:toArray:]
(self=0xa48bdd8, _cmd=0xb759b138,
_startDate=0xa6199d0, _until=0x0, _r=0x925cf68, _ranges=0xa619970) at
iCalMonthlyRecurrenceCalculator.m:171
171 [r release];
(gdb) p _count
No symbol "_count" in current context.
(gdb) p -[_ranges count]
$5 = 4294967295

BTW, that's UINT_MAX (or 0xFFFFFFFF).

Any idea of what could corrupt ranges here?

I suspected a mismatch in the layout of the structures due to
differences in the compiler used (I don't know if it applies to
objective c).
It appears that the gnustep-base rpm was built with gcc-4.4.0, while the
currently installed gcc is 4.4.1, so I rebuilt the gnustep-base rpms.
NSMutableArray is used extensively in sogo but I can only see it failing
here.

I now rebuilt everything with gnustep-base-1.20.1 but the problem persists.

I now tried to initialize ranges with

ranges = [[NSMutableArray alloc] initWithCapacity: numberOfMonthsInRange]

instead of

ranges = [NSMutableArray] arrayWithCapacity: numberOfMonthsInRange]

that gets rid of the 4294967295 issue, but it still smashes the stack when the method returns (i.e. on the closing bracket at line 433).

Bye
--
Luca Olivetti
Wetron Automatización S.A. http://www.wetron.es/
Tel. +34 93 5883004 (Ext.133)  Fax +34 93 5883007
--
users@sogo.nu
https://inverse.ca/sogo/lists

Reply via email to