[Libreoffice] Crash in master: Sum button in sc
Soeren Moeller
soerenmoeller2001 at gmail.com
Wed Jan 26 14:59:43 PST 2011
Thanks for the answer. I now used gdb to locate the segfault, and
found it to happen when ScViewFunc called ScRangeList.front() with an
empty range list, which resulted in a segfault while trying to
retrieve the first element of the list. I have prepared the attached
patch, adding a check for empty list in ScViewFunc. (As it here
opposed to ScRangeList, was possible to check that not returning an
element was handled ok.) This removes the crash, and the sum button
seems to work fine again. Although it maybe still would make sense to
check the other uses of ScRangeList.front() for similar problems, I
will try to look into this later on, but this patch shoul at least
make this use safe.
Regards
Sören Möller
(LGPLv3+ / MPL)
2011/1/26 Kohei Yoshida <kyoshida at novell.com>:
> Hi Soeren,
>
> On Tue, 2011-01-25 at 23:13 +0100, Soeren Moeller wrote:
>> Hi
>>
>> I just noticed a bug in master (pull about 1h ago):
>> When I in calc press the sum button (shaped like a sigma), then calc
>> crashes instantly and without any message. This seems to happen only
>> when calc doesn't guess a sum area by itself. (E.g. if there are
>> numbers in the cells above the marked cell, calc suggest those cells
>> as a sum area, and it works fine, but if there are no cells with
>> numbers nearby it crashes). Using the sum function through the
>> Function Wizard works fine, though.
>
> Well, I'm not surprised; after all it's master where things are fairly
> unstable, and crashes are common occurrences. :-)
>
> Having said that, it's good to catch these nasty crashes early, and I'm
> glad you brought this issue to light.
>
> Are you familiar with getting stack traces with gdb? That would be the
> first step when investigating a crash. To get a meaningful stack trace
> you need to re-build the sc module with debug symbol compiled in.
>
> http://wiki.documentfoundation.org/Development/Native_Build#Partial_debug_build
>
> Once done, start Calc, attach gdb, reproduce the crash and get a
> backtrace in gdb. That will give you the location of the crash from
> which you can sniff around the code to see what's going wrong.
>
>> I'm just getting used to the codebase, so it would be nice if someone
>> who is more into it would take a look, and check if the error can be
>> reproduced by others. I can reproduce it even after a "make clean; ./g
>> pull; make; make dev-install".
>
> Yup, this is perfectly reproducible.
>
> Anyway, it would be great if you could get a backtrace output from gdb
> to see where the crash occurs.
>
> Let me know if you need additional help.
>
> Best,
>
> Kohei
>
> --
> Kohei Yoshida, LibreOffice hacker, Calc
> <kyoshida at novell.com>
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Added-check-for-empty-rRangeList-in-ScViewFunc.patch
Type: text/x-patch
Size: 1769 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110126/e712a80c/attachment-0001.bin>
More information about the LibreOffice
mailing list