Bug 36406 - EDITING - Saveas Hangs in Calc after an edit or on time interval set to save a copy.
Summary: EDITING - Saveas Hangs in Calc after an edit or on time interval set to save ...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
3.3.1 release
Hardware: Other Linux (All)
: medium normal
Assignee: Kohei Yoshida
URL:
Whiteboard: target:3.4
Keywords: perf
Depends on:
Blocks:
 
Reported: 2011-04-19 19:03 UTC by Russ Fineman
Modified: 2015-12-15 11:31 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Problem spreadsheet ref: comment #13 (487.05 KB, application/vnd.oasis.opendocument.spreadsheet)
2011-05-04 09:40 UTC, Russ Fineman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Russ Fineman 2011-04-19 19:03:24 UTC
openSUSE 11.4 ( 2.6.37 kernel)
LibreOffice LibreOffice 3.3.1 OOO330m19 (Build:8) tag libreoffice-3.3.1.2
KDE 4.6.2 release 3

Intel(R) Core(TM)2 Duo CPU E7200 @ 2.53GHz
  Speed:  1,596.00 MHz
  Cores:  2
Total memory (RAM):  7.8 GiB
  Free memory:  2.5 GiB (+ 4.3 GiB Caches)
  Free swap:  10.0 GiB

Vendor:  nVidia Corporation
  Model:  GeForce 8400 GS (0x0404)
  2D driver:  nvidia
  3D driver:  NVIDIA 270.18

Noticed problem after upgrade from LibreOffice 3.3.1 (//download.opensuse.org/distribution/11.4/repo/oss/) to LibreOffice 3.3.2 ( http://download.opensuse.org/repositories/LibreOffice:/Stable/openSUSE_11.4).
Today I droped back to 3.3.1, problem still there.

I open spreadsheet (multiple sheets and pages). Either add data, or delete data. If the time comes for an automatic backup (10 minutes) or I click save, it hangs the spreadsheet for at least a minute before it completes, sometimes it times out and crashes. You are able to recover afterwards and data is lost. When hung system monitor shows soffice.bin using 100% of a cpu. (169 MB of memory).

I have turned off Desktop effects.

Any Idea what I should look at? Logs show nothing. Bugzilla shows no reports.
Comment 1 Russ Fineman 2011-04-19 19:05:59 UTC
Note title should read Calc after an Edit.
Comment 2 Kohei Yoshida 2011-04-19 19:10:34 UTC
What would help most is if you could attach the document that you had open at the time that happened.
Comment 3 Rainer Bielefeld Retired 2011-04-19 23:31:36 UTC
NOT reproducible with "LibreOffice 3.3.2  – WIN7  Home Premium  (64bit) German UI [OOO330m19 (Build:202 / tag 3.3.2.2)]"

Modified OS due to report. 

Excelpt OS ist sounds similar to
Bug 36051 - FILESAVE When save a big spreadsheet in xls format calc freezes

@Russ Fineman:
I am not familiar with openSUSE, is your version 32bit or 64bit?
Do you only see that problem with a particular document or with all spreadsheets?

May I ask you to read  hints on <http://wiki.documentfoundation.org/BugReport> carefully? Complete issue-related information will help a lot to find out what your problem is (and a sample document, of course).
Comment 4 Russ Fineman 2011-04-20 09:38:13 UTC
(In reply to comment #2)
> What would help most is if you could attach the document that you had open at
> the time that happened.

The spread sheet contains a lot of personal medical information. Would prefer not to attach it but will if absolutely necessary. Let me know.
Comment 5 Russ Fineman 2011-04-20 10:03:42 UTC
(In reply to comment #3)
> NOT reproducible with "LibreOffice 3.3.2  – WIN7  Home Premium  (64bit) German
> UI [OOO330m19 (Build:202 / tag 3.3.2.2)]"
> 
> Modified OS due to report. 
> 
> Excelpt OS ist sounds similar to
> Bug 36051 - FILESAVE When save a big spreadsheet in xls format calc freezes
> 
> @Russ Fineman:
> I am not familiar with openSUSE, is your version 32bit or 64bit?
> Do you only see that problem with a particular document or with all
> spreadsheets?
> 
> May I ask you to read  hints on <http://wiki.documentfoundation.org/BugReport>
> carefully? Complete issue-related information will help a lot to find out what
> your problem is (and a sample document, of course).

I am running the 64 bit version of openSUSE 11.4.  The spreadsheet is ods  and was originally produced on OpenOffice. It was working fine, When SUSE started supplying LibreOffice instead of OpenOffice. I did not try this spreadsheet until after I upgraded to 3.3.2. Then problem appeared. I dropped back to see if 3.3.1  worked, It did not have problem before upgrade, It now has problem also. 

I will read the document, but I thought I added everything, I will include more next time. I'll also check bug mentioned above, it did not show when I searched bugzilla. Must have been my parameters.

Note: Thought I put in sheet size but apparently just said "Multiple sheets and sizes". This spread is 10 sheets and 2-3 pages on some of them.

See Comment #4 about supplying the spreadsheet, I will if you really need it. May Blank out some cells. Also I plan to try some small spreadsheets, single sheet and see if it happens. Will post result.

Thanks for your replies.
Comment 6 Russ Fineman 2011-04-22 19:57:49 UTC
(In reply to comment #4)
> (In reply to comment #2)
> > What would help most is if you could attach the document that you had open at
> > the time that happened.
> 
> The spread sheet contains a lot of personal medical information. Would prefer
> not to attach it but will if absolutely necessary. Let me know.

Looks like I will have to send the document, after I remove some of the personal info. I will substitute dummy info in its place and make sure it still hamgs. Where do I send it or can attachments be added here and accepted?

I will try to get it done this weekend.

Thanks
Comment 7 Russ Fineman 2011-04-25 11:38:13 UTC
(In reply to comment #2)
> What would help most is if you could attach the document that you had open at
> the time that happened.

Attached is the strace log from a hang today. Notice toward end it has a resource unavailable set of messages. Is this the disk? The disk is a 1TB internal drive. (about four months old).

I am running 

opensuse 11.4 latest updates., 

LibreOffice LibreOffice 3.3.1 OOO330m19 (Build:8) tag libreoffice-3.3.1.2

kde4.6.2 release 3.

Note: Today I said Save after on row of spreadsheet 3 was changed. I have attached the strace.log, can also try a back trace or Valagrid if you need it. I am also going to move the file to another disc drive and see if that helps. If it works there I will modify it and take out a couple of personal items, and put dummy items in there place. If fails to often to try how it is now, and I loose the data I just enter during recovery.

Thanks for you help.

Can I download the version fro your website and compile it to run in parallel somehow (not programmer but would be willing to try with some guidence.

Thanks
Comment 8 Russ Fineman 2011-04-25 16:53:17 UTC
(In reply to comment #2)
> What would help most is if you could attach the document that you had open at
> the time that happened.

Been trying to get an strace log to you but cannot get it down to 1MB, best I can do is 10MB. tried zip, bzip2 and gzip. all to big. Can I send it directly to you?
Comment 9 Rainer Bielefeld Retired 2011-04-30 00:57:27 UTC
@Kohei
Can the offered strace log help to get some progress here?
Comment 10 Russ Fineman 2011-04-30 06:42:45 UTC
I did a trace but it is to large to attach to this bug. I looked for a site where I can make it available. Do you know of one? Imagebam will not post it since its not formatted for them.

Let me know and I will post it. Second I can save a spreadsheet as a csv with a hangup at least one of them. I will try the big one today and post results.
Comment 11 J. Scott Edwards 2011-05-02 06:24:34 UTC
I'm having the same issue on gNewSense Linux (derived from Ubuntu).  I created a new spreadsheet, filled in a few rows and clicked on the Save button.  It hung for several minutes and I finally had to kill it.

Started it up again and it lost several of the rows, tried to do a "Save As" from the menu without doing any further changes and it hung again.

When it hangs there is a defunct process:

Before:
sedwards 14916  0.0  0.0   1904   636 pts/1    S+   06:43   0:00 strace /opt/libreoffice/program/soffice -calc
sedwards 14917  0.0  0.0   1772   512 pts/1    S+   06:43   0:00 /bin/sh /opt/libreoffice/program/soffice -calc
sedwards 14927  3.9  2.9 200916 90544 pts/1    Sl+  06:43   0:02 /opt/libreoffice/program/soffice.bin -calc
sedwards 14944  0.0  0.0   2644  1004 pts/8    R+   06:44   0:00 ps aux

After:
sedwards 14916  0.0  0.0   1904   636 pts/1    S+   06:43   0:00 strace /opt/libreoffice/program/soffice -calc
sedwards 14917  0.0  0.0   1772   512 pts/1    S+   06:43   0:00 /bin/sh /opt/libreoffice/program/soffice -calc
sedwards 14927  1.1  2.9 203100 91924 pts/1    Sl+  06:43   0:03 /opt/libreoffice/program/soffice.bin -calc
sedwards 14945  0.0  0.0      0     0 pts/1    Z+   06:45   0:00 [soffice.bin] <defunct>
sedwards 14952  0.0  0.0   2644  1004 pts/8    R+   06:48   0:00 ps aux


The strace didn't show anything when it hung.  This all happened when it started up:

read(3, "Linux\n", 128)                 = 6
read(3, "", 128)                        = 0
close(3)                                = 0
wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 14926
stat64("/etc/adabasrc", 0xbfe50af8)     = -1 ENOENT (No such file or directory)
clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0xb7dea6f8) = 14927
rt_sigaction(SIGTERM, {0x8055a30, ~[RTMIN RT_1], 0}, NULL, 8) = 0
wait4(-1,

And when I hit Control=C after it hung it just did this:

wait4(-1,  <unfinished ...>
Comment 12 Russ Fineman 2011-05-02 07:43:44 UTC
(In reply to comment #11)
> I'm having the same issue on gNewSense Linux (derived from Ubuntu).  I created
> a new spreadsheet, filled in a few rows and clicked on the Save button.  It
> hung for several minutes and I finally had to kill it.
> 
> Started it up again and it lost several of the rows, tried to do a "Save As"
> from the menu without doing any further changes and it hung again.
> 
> When it hangs there is a defunct process:
> 
> Before:
> sedwards 14916  0.0  0.0   1904   636 pts/1    S+   06:43   0:00 strace
> /opt/libreoffice/program/soffice -calc
> sedwards 14917  0.0  0.0   1772   512 pts/1    S+   06:43   0:00 /bin/sh
> /opt/libreoffice/program/soffice -calc
> sedwards 14927  3.9  2.9 200916 90544 pts/1    Sl+  06:43   0:02
> /opt/libreoffice/program/soffice.bin -calc
> sedwards 14944  0.0  0.0   2644  1004 pts/8    R+   06:44   0:00 ps aux
> 
> After:
> sedwards 14916  0.0  0.0   1904   636 pts/1    S+   06:43   0:00 strace
> /opt/libreoffice/program/soffice -calc
> sedwards 14917  0.0  0.0   1772   512 pts/1    S+   06:43   0:00 /bin/sh
> /opt/libreoffice/program/soffice -calc
> sedwards 14927  1.1  2.9 203100 91924 pts/1    Sl+  06:43   0:03
> /opt/libreoffice/program/soffice.bin -calc
> sedwards 14945  0.0  0.0      0     0 pts/1    Z+   06:45   0:00 [soffice.bin]
> <defunct>
> sedwards 14952  0.0  0.0   2644  1004 pts/8    R+   06:48   0:00 ps aux
> 
> 
> The strace didn't show anything when it hung.  This all happened when it
> started up:
> 
> read(3, "Linux\n", 128)                 = 6
> read(3, "", 128)                        = 0
> close(3)                                = 0
> wait4(-1, [{WIFEXITED(s) && WEXITSTATUS(s) == 0}], 0, NULL) = 14926
> stat64("/etc/adabasrc", 0xbfe50af8)     = -1 ENOENT (No such file or directory)
> clone(child_stack=0, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD,
> child_tidptr=0xb7dea6f8) = 14927
> rt_sigaction(SIGTERM, {0x8055a30, ~[RTMIN RT_1], 0}, NULL, 8) = 0
> wait4(-1,
> 
> And when I hit Control=C after it hung it just did this:
> 
> wait4(-1,  <unfinished ...>

Sounds like they are related, mine usually takes a little while to startup but always starts, then when I do a save as or save it hangs as described above, but usually if I wait a couple of minutes, it finishes the save, but occasional it will time out and I've lost all changes. 

If I new what to look for in the strace, I cut it out and send it. The strace itself is 300+ MB. I can get it down to 10 MB or so but max on this list is 1000KB. Tried suse paste but it hangs after a while, determined it is size of file.
Comment 13 Kohei Yoshida 2011-05-04 07:06:53 UTC
Strace doesn't help (much) in this case and we need the document.
Comment 14 J. Scott Edwards 2011-05-04 07:49:52 UTC
> Strace doesn't help (much) in this case and we need the document.

In my case there is no document, I just create a new spreadsheet, type "Testing" in box A1, click on the file menu -> "Save As...", and bam! it's hung.

I thought I would try to be helpful and see if I could debug it myself.  Ha!  This is just crazy, it took all afternoon yesterday to download additional packages, and all night to build.  Now when I try to run it, it seg faults.  I'm going to try to make a debug build, but this isn't a good start :(
Comment 15 Kohei Yoshida 2011-05-04 08:00:12 UTC
(In reply to comment #14)
> > Strace doesn't help (much) in this case and we need the document.
> 
> In my case there is no document, I just create a new spreadsheet, type
> "Testing" in box A1, click on the file menu -> "Save As...", and bam! it's
> hung.

Then your issue is most likely a different issue.  Please file a separate bug for your specific case so that we can track it separately.  Thanks.
Comment 16 Russ Fineman 2011-05-04 09:40:35 UTC
Created attachment 46326 [details]
Problem spreadsheet ref: comment #13

Attached is the spreadsheet that hangs when "save" or "save as" is used. only change I made is to change names on sheets. Also note that it delays briefly on opening.

Please destroy when your done.
Comment 17 Kohei Yoshida 2011-05-04 10:31:39 UTC
Thanks.  For future reference, you could simply private-mail the document to one of us if the document contains confidential info... Sorry I wasn't clear about this.

FYI once the file is attached, it's pretty much there semi-permanently and we don't have any way to remove it (without contacting the bugzilla admin that is, and he is very elusive).

(In reply to comment #16)
> Created an attachment (id=46326) [details]
> Problem spreadsheet ref: comment #13
> 
> Attached is the spreadsheet that hangs when "save" or "save as" is used. only
> change I made is to change names on sheets. Also note that it delays briefly on
> opening.
> 
> Please destroy when your done.
Comment 18 Kohei Yoshida 2011-05-04 10:42:21 UTC
I'll take this.  Calc indeed performs some computation when it saves, and given the size of the document (not very big) it shouldn't spend that much time.
Comment 19 Russ Fineman 2011-05-04 17:30:25 UTC
(In reply to comment #18)
> I'll take this.  Calc indeed performs some computation when it saves, and given
> the size of the document (not very big) it shouldn't spend that much time.

I changed the name's and everything else is providers and $, mainly.

If you need anything else let me know. I have another spreadsheet that also does this. It has a lot of confidential info so I will not send this. The document I sent was originally built on OOo, don't remember which version.

Thanks for your assistance.
Comment 20 Kohei Yoshida 2011-05-04 19:38:20 UTC
Ok.  The problem lies in the sheet named 'Drugs', where you see a whole lot of manual page breaks across the entire sheet!  Just scroll down and see those blue lines all the way down to the last row!

Now, I really don't think you entered these manual breaks manually.  Do you have any idea how those manual row breaks ended up there?  Russ?

For the record, I've seen another document that had similar symptoms, and the user has no clue how those manual breaks ended up in the document.
Comment 21 Kohei Yoshida 2011-05-04 19:40:20 UTC
Bubli.  A deja vu moment.
Comment 22 Kohei Yoshida 2011-05-04 19:59:33 UTC
Russ, please do the following.

1. Switch to sheet 'Drugs'.
2. Select row 213.
3. Hit shift+ctrl-Down arrow to select all rows from 213 to the last row.
4. Right-click on the row headers and select "Delete Rows".

Now save the document.  It shouldn't hang like it did before.
Comment 23 Kohei Yoshida 2011-05-04 21:48:19 UTC
So, I made the following change

http://cgit.freedesktop.org/libreoffice/calc/commit/?h=libreoffice-3-4&id=c66d1b9fcc2244b4fd8940f17ebf4e772f09c84e

to avoid using invalidated iterators after the erase() call of std::set.  While I have no direct evidence that this indeed caused those manual breaks to show up, I couldn't find any other likely spot.  So this must be it.

Russ, unfortunately I can't do anything with your existing documents with those erroneous manual breaks, but erasing them should be hopefully easy enough for your documents.
Comment 24 Russ Fineman 2011-05-05 07:38:15 UTC
Thank You!!!
Yes I followed your steps and deleted all the page breaks, the document now saves in a couple of seconds. Also opens a lot faster. i tried it on the document I sent you and on the original, both worked.

I have no idea how those page breaks got in the sheet. I have noticed them before on several spreadsheets. I now have a way to clear them and hopefully will not experience any more issues like this. 

The patch you put in is for 3.4 which I do not have yet. I can clear them manually until a SUSE RPM comes out.

Again thanks for your quick response. Let me know if I can help test anything.
Comment 25 Robinson Tryon (qubit) 2015-12-15 11:31:11 UTC
Migrating Whiteboard tags to Keywords: (perf)
[NinjaEdit]