Bug 81084 - Sort causes crashes
Summary: Sort causes crashes
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.2.5.2 release
Hardware: All All
: high blocker
Assignee: Deena Francis
URL:
Whiteboard: target:4.4.0 target:4.3.2 target:4.2.7
Keywords: possibleRegression
Depends on:
Blocks:
 
Reported: 2014-07-09 07:39 UTC by helplibreoffice
Modified: 2015-12-15 22:12 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Demonstration of bug (96.93 KB, application/vnd.oasis.opendocument.spreadsheet)
2014-07-17 19:27 UTC, helplibreoffice
Details
Backtrace of the sort crash in master (53.82 KB, text/plain)
2014-08-06 14:46 UTC, Deena Francis
Details

Note You need to log in before you can comment on or make changes to this bug.
Description helplibreoffice 2014-07-09 07:39:49 UTC
Hello. I am an ordinary user and I have never filed a bug report, so please forgive that I'm probably doing it all wrong.

When I try to sort in LibreOffice Calc, I routinely experience crashes.

Usually, I receive a dialog box stating "unexpected error".  Sometimes I get an "invalid vector <T> subscript".  Sometimes I get "The instruction at xxx referenced memory at yyy.  The memory could not be read.  Click on OK to terminate the program.".

I have tried numerous spreadsheets, and I experience different crashes on each one.

I have asked my manager if I can send you the spreadsheets, but she has refused.

Most of my testing was on v4.2.4.2, but I have upgraded to v4.2.5.2 and still experience numerous crashes.

For v4.2.4.2, the "xxx" above is sometimes 0x7c90100b and other times 0x7c9108f3.

I have spent a considerable amount of time trying to isolate the problems, but there seems to be multiple causes, which is making testing challenging.  I don't have any more time to allocate to this, unfortunately.

What I have concluded is that formatting seems to play a role.  I have one spreadsheet that crashes every time I try to sort.  But if I change one column from center-justified to left-justified, suddenly I can sort without a crash.

I also have concluded that conditional formatting plays a role.  When you copy a row in LO, you wind up with a separate conditional formatting rule for each row (which probably should be fixed).  In a different spreadsheet, if I delete all that conditional formatting and change it to a single conditional formatting rule for a range of cells, the sort no longer crashes LibreOffice.

I have tried this on multiple computers and get the same results.  I have verified the SHA-256 and MD5 hashes of LO, and the installation files match.

Unfortunately, we might have to switch away from LO, as we need to sort reliably without the program crashing.
Comment 1 Kevin Suo 2014-07-09 16:11:09 UTC
May be a duplicate of bug 80874?
Comment 2 helplibreoffice 2014-07-10 01:16:00 UTC
May be related to 80874.  Hard to know for sure because there are multiple scenarios that cause LO Calc to crash when performing a sort.  I wish I had the time to figure them all out, but I spent over 8 hours trying to find the common denominators, and I had to switch to other projects.
Comment 3 helplibreoffice 2014-07-17 19:27:16 UTC
Created attachment 103000 [details]
Demonstration of bug

Attached is a demonstration of this bug which causes LO Calc to fail.

To demonstrate, load the file, and perform a column sort on the first column.  Crashes every time.
Comment 4 beimaginativeegroup 2014-07-18 16:35:56 UTC
I can confirm this bug. I am getting the LibreOffice Document Recovery dialog everytime. Setting this as NEW. I am using LibreOffice 4.3.0.2 on Windows XP.
Comment 5 Kevin Suo 2014-07-18 16:59:11 UTC
With your test file, I can confirm the crash with libreoffice 4.3.0.2, Ubuntu 14.04 x86.
Set platform to ALL.
Comment 6 Clark Hartness 2014-07-25 13:00:30 UTC
Confirm Sort Crash

Ubuntu 3.13.0-32-generic 64BIT
Ubuntu 14.04.1 LTS

Version: 4.2.6.1
Build ID: 5fdddf655fba363e34f755715238d0943a44857e

Spreadsheet has conditional formatting

Sort crashes no matter what column is sorted on.
Comment 7 Deena Francis 2014-08-03 19:07:58 UTC
Confirmation of sort crash using a simple spread sheet

OS : Mac OS X 10.6.8

Libreoffice 
Version: 4.2.5.2
Build ID: 61cb170a04bb1f12e77c884eab9192be736ec5f5


Way to recreate the crash :

1. Open SCalc and create a blank spreadsheet
2. Enter the following values
    10 to A1
   -20 to A2
3. Go to Format > Conditional Formatting > Manage 
   Click Add button
   Set Condition 1 as : "Cell value is", "less than", 0
   Choose default style or create a new style.
   Set Range = A1
   Click Ok, again Click ok in Manage dialog box

4. Select A1 and A2 and go to Data > Sort and set sort key to "Column A" and 
   select ascending. Click Ok.

5. Scalc crashes


I will soon provide a trace after building libreoffice with --enable-debug.
Comment 8 Deena Francis 2014-08-06 14:46:20 UTC
Created attachment 104156 [details]
Backtrace of the sort crash in master

I will attempt to make a fix/patch for this crash.
Comment 9 ign_christian 2014-08-06 14:56:38 UTC
(In reply to comment #8)
> I will attempt to make a fix/patch for this crash.
Hi Deena.. Bug 81696 already bibisected & had debug report, and Bug 80874 also had backtrace. Perhaps those has same root and helps you to make a fix
Comment 10 beimaginativeegroup 2014-08-06 15:26:51 UTC
Deena, if you think you can assign it to yourself, please do so and set it as ASSIGNED. Thanks for your help.
Comment 11 Björn Michaelsen 2014-08-21 12:21:08 UTC
(This is an automated message.)

LibreOffice development currently prioritizes bugs with the so called MAB (most annoying bugs) -- as this bug has not run through that process (including writing a short rationale for this bug being a candidate and other who are watching the tracker bug silently approving that rationale etc.) its priority is set to high. Note this is effectively no change in the urgency assigned to this bug, as we are currently not making a difference between high and highest and severity is untouched.

You can find out more about MABs and how the process works by contacting libreoffice qa on irc:

 http://webchat.freenode.net/?channels=libreoffice-qa

The QA wiki page also gives you hints on how to get in contact with the team (if IRC fails you, your next best choice is the mailing list):

 https://wiki.documentfoundation.org/QA
Comment 12 Deena Francis 2014-08-24 20:15:08 UTC
I have submitted a patch to gerrit for review that seems to resolve this bug.
https://gerrit.libreoffice.org/#/c/11102/
Comment 13 Commit Notification 2014-08-25 11:59:35 UTC
Deena Francis committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c25ac84688b596b9990d382d550f0514161b78c2

Resolves fdo#81084 fdo#81696 fdo#80874 fdo#81010 : sort causes crash



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 14 helplibreoffice 2014-08-25 23:50:33 UTC
Thank you Deena!  I will add it as a high priority item to my testing queue.
Comment 15 Commit Notification 2014-08-27 11:37:53 UTC
Deena Francis committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=719dd447ec1ab5ed0085b4f41cfd8e76fa835106&h=libreoffice-4-3

Resolves fdo#81084 fdo#81696 fdo#80874 fdo#81010 : sort causes crash


It will be available in LibreOffice 4.3.2.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Commit Notification 2014-08-27 11:45:15 UTC
Deena Francis committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3a04813fbf9824ae6cf651bab0c3f55cf36ea8fa&h=libreoffice-4-2

Resolves fdo#81084 fdo#81696 fdo#80874 fdo#81010 : sort causes crash


It will be available in LibreOffice 4.2.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Lutz 2014-11-03 20:04:19 UTC
crashes in 4.3.6.2 as well occasionally
Comment 18 Robinson Tryon (qubit) 2015-12-15 22:12:10 UTC
Migrating Whiteboard tags to Keywords: (PossibleRegression )
[NinjaEdit]