Bug 78617 - segfault when sorting by columns (with certain data in the columns)
Summary: segfault when sorting by columns (with certain data in the columns)
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:6.5.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-12 16:51 UTC by Sasha
Modified: 2019-11-18 18:30 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
gdbtrace of the crash (13.48 KB, text/plain)
2014-05-12 16:51 UTC, Sasha
Details
file for crash replication (see comment #2) (37.14 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-05-14 16:22 UTC, Sasha
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sasha 2014-05-12 16:51:59 UTC
Created attachment 98936 [details]
gdbtrace of the crash

The macro does some counting, then sorting (vertically and horizontally). Specific data in specific cells causes a crash (nothing special about the data, it has the same format as all the other data and works fine in other cells). I could see for a split moment that the sorting completes, but then the LibreOffice Calc crashes. Attached is the gdbtrace (the main thing -- without it I wouldn't even log the bug). 

P.S I tried clearing .config/libreoffice folder, but it did not help
Comment 1 Laurent Godard 2014-05-13 07:02:02 UTC
giving the macro itself would help
Comment 2 Sasha 2014-05-14 16:20:48 UTC
OK, I need to change the description of the bug (I have changed the summary title of the bug, too). I have stripped the file as much as I could and tried to run manually what the macro does, and I have now very clear replication steps

Please see the second file attached (moo2.odt):
1) Select the cell range C8-J19
2) Go to menu Data -> Sort 
3) Choose to sort by "Row 17", then "Row 18", then "Row 19", all "Descending"
4) Choose to sort "Left to right (sort columns)"
5) Hit "Sort" and observe the crash

Examples that make crash NOT to happen (why???):
1) Get rid of the superscript in the cell that has it
2) Get rid of the data in one of the cells (or both)
3) Choose to sort Row 17 by "Ascending" (other two rows still by "Descending")

Hopefully this detailed analysis helps :-)
Comment 3 Sasha 2014-05-14 16:22:21 UTC
Created attachment 99036 [details]
file for crash replication (see comment #2)
Comment 4 Terrence Enger 2014-05-14 18:36:46 UTC
I am moving "Calc" from Summary to Component.  Based on familiarity
with pathnames in the backtraces, I am setting platform Linux,

FWIW, I do not see the crash with a debug build of commit 49dff05
(2014-05-12) on debian-wheezy 64-bit.  In addition to Sasha's STR, I
selected Data > Sort > Options > "Left to right".

@Sasha,

Please tell us what version of LibreOffice you are using and what
platform you are running on.

Thanks,
Terry.
Comment 5 Sasha 2014-05-15 00:59:48 UTC
I am running Arch Linux with kernel 3.14.2-1-pae

LibreOffice: 4.2.4.2 420m0(Build:2)
Comment 6 Sasha 2014-05-15 01:02:57 UTC
Another little bit of information: if I turn the superscript character in the corresponding cell to normal character, I get no segfault
Comment 7 Sasha 2014-05-15 01:05:12 UTC
Forgot to mention that mine is a 32-bit system
Comment 8 Joel Madero 2014-05-17 03:14:39 UTC
Ubuntu 14.04 x64
LibreOffice 4.2.4.2 release

No crash following comment 2 - marking as WFM. Please try with a fresh profile: https://wiki.documentfoundation.org/UserProfile

If you can still reproduce with a fresh profile set the bug to UNCONFIRMED again and I'll try to find a third person to test.
Comment 9 Sasha 2014-05-19 05:35:38 UTC
I removed the entire profile directory (mv .config/libreoffice/4 .config/libreoffice/4.tmp), the segfault is still happening.

I get these two lines on the command prompt when it fails:

(soffice:8475): GLib-CRITICAL **: Source ID 300 was not found when attempting to remove it

(soffice:8475): GLib-CRITICAL **: Source ID 315 was not found when attempting to remove it
Comment 10 Buovjaga 2014-10-24 15:13:00 UTC
Can't repro on Arch build 4.3.2.2 or Windows alpha build Version: 4.4.0.0.alpha1+
Build ID: 0a82645c360158f9cc0fdabe2a52f1ff8f981bed
TinderBox: Win-x86@39, Branch:master, Time: 2014-10-24_06:59:23

Sasha, can you test with 4.3.2.2?
Comment 11 Robinson Tryon (qubit) 2015-12-18 10:24:07 UTC Comment hidden (obsolete)
Comment 12 Xisco Faulí 2016-09-19 16:48:05 UTC Comment hidden (obsolete)
Comment 13 Commit Notification 2019-11-18 18:30:51 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/00e1adec49c50f9128dd02ae721e62ae3e729ad6

crashtesting fdo78617-2.ods

It will be available in 6.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.