Bug 44900 - CPU eating after opening or saving with password
Summary: CPU eating after opening or saving with password
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
Master old -3.6
Hardware: Other Linux (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-18 06:12 UTC by Laurent Godard
Modified: 2015-10-23 08:49 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Valgrind of the use case (457.59 KB, application/zip)
2012-01-18 06:12 UTC, Laurent Godard
Details
valgrind with debug symbol on simpler save as case (1.56 MB, application/zip)
2012-01-20 05:10 UTC, Laurent Godard
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Laurent Godard 2012-01-18 06:12:52 UTC
Created attachment 55735 [details]
Valgrind of the use case

create a basic library and protect it by password
restart lirbeoffice

go to Tools > macro and open your basic library (double click on it)
provide the asked password

--> all is fine except that then libreoffice starts eating 43% of CPU
(even without doing nothing)

no problem on libro343 (so sounds like a regression to me)

here is the valgring result
the loops come from MNS_XPCOM_EventLoop
Comment 1 Michael Meeks 2012-01-18 10:38:18 UTC
So - more information much appreciated. While it is doing all this work it should not be, can you get the result of:

thread apply all backtrace

from a build with debugsymbols present - and attach that here ? When you say it is eating CPU without doing anything - is the application otherwise responsive & functioning, but just burning lots of CPU ? or is it not re-drawing & unresponsive ?
Comment 2 August Sodora 2012-01-18 12:28:32 UTC
I just tried to reproduce this to get a backtrace and MNS_XPCOM_EventLoop was
never getting called; is this not a problem with --disable-mozilla?
Comment 3 Laurent Godard 2012-01-19 05:55:23 UTC
bt while doing nothing once CPU is at 43%

(gdb) thread apply all backtrace

Thread 12 (Thread 0xb2466b70 (LWP 8387)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7ce6a06 in gettimeofday () at ../sysdeps/unix/syscall-template.S:82
#2  0xac34cc4c in _PR_UNIX_GetInterval () at ../../../../../pr/src/md/unix/unix.c:3032
#3  0xac336a3e in PR_IntervalNow () at ../../../../pr/src/misc/prinrval.c:77
#4  0xac34b26e in PR_Sleep (ticks=1) at ../../../../pr/src/pthreads/ptthread.c:811
#5  0xabebc60c in MNS_XPCOM_EventLoop () at /home/lgodard/projets/libreoffice/build/git/master/libo/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx:228
#6  0xabebc752 in MNS_Mozilla_UI_Thread (arg=0xa035a10) at /home/lgodard/projets/libreoffice/build/git/master/libo/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx:258
#7  0xb7f6f981 in osl_thread_start_Impl (pData=0xa0f70e8) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/osl/unx/thread.c:292
#8  0xb7c47cc9 in start_thread (arg=0xb2466b70) at pthread_create.c:304
#9  0xb7d2c69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 7 (Thread 0xaf806b70 (LWP 8377)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7d1ddf6 in __poll (fds=0xb7db4ff4, nfds=1, timeout=1000) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb26b99f4 in x11::SelectionManager::dispatchEvent (this=0x8a9edc0, millisec=1000) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/unx/generic/dtrans/X11_selection.cxx:3737
#3  0xb26b9c6c in x11::SelectionManager::run (pThis=0x8a9edc0) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/unx/generic/dtrans/X11_selection.cxx:3775
#4  0xb26aac75 in call_SelectionManager_run (pMgr=0x8a9edc0) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/unx/generic/dtrans/X11_selection.cxx:108
#5  0xb7f6f981 in osl_thread_start_Impl (pData=0x8ab4498) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/osl/unx/thread.c:292
#6  0xb7c47cc9 in start_thread (arg=0xaf806b70) at pthread_create.c:304
#7  0xb7d2c69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 6 (Thread 0xb0050b70 (LWP 8376)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7d1ddf6 in __poll (fds=0xb7db4ff4, nfds=2, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb269697c in ICEConnectionWorker () at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/unx/generic/app/sm.cxx:665
#3  0xb7f6f981 in osl_thread_start_Impl (pData=0x8a5a468) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/osl/unx/thread.c:292
#4  0xb7c47cc9 in start_thread (arg=0xb0050b70) at pthread_create.c:304
#5  0xb7d2c69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 5 (Thread 0xb0b22b70 (LWP 8375)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7d1ddf6 in __poll (fds=0xb7db4ff4, nfds=1, timeout=-1) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb2795a1b in g_poll () from /lib/libglib-2.0.so.0
#3  0xb278843c in ?? () from /lib/libglib-2.0.so.0
#4  0xb2788ba7 in g_main_loop_run () from /lib/libglib-2.0.so.0
#5  0xb29a59c4 in ?? () from /usr/lib/libgio-2.0.so.0
#6  0xb27af48f in ?? () from /lib/libglib-2.0.so.0
#7  0xb7c47cc9 in start_thread (arg=0xb0b22b70) at pthread_create.c:304
#8  0xb7d2c69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 4 (Thread 0xb1c65b70 (LWP 8374)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7d2d898 in accept () at ../sysdeps/unix/sysv/linux/i386/socket.S:97
#2  0xb7f661ea in osl_acceptPipe (pPipe=0x88451e8) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/osl/unx/pipe.c:430
#3  0xb7f32bca in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsofficeapp.so
#4  0xb7f350c9 in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsofficeapp.so
#5  0xb7f6f981 in osl_thread_start_Impl (pData=0x8843a98) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/osl/unx/thread.c:292
#6  0xb7c47cc9 in start_thread (arg=0xb1c65b70) at pthread_create.c:304
#7  0xb7d2c69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

---Type <return> to continue, or q <return> to quit---
Thread 2 (Thread 0xb47a1b70 (LWP 8372)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7c4c884 in pthread_cond_timedwait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_timedwait.S:236
#2  0xb7d39df4 in __pthread_cond_timedwait (cond=0xb7fdb1e0, mutex=0xb7fdb080, abstime=0xb47a1220) at forward.c:152
#3  0xb7f7b544 in rtl_cache_wsupdate_wait (seconds=10) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/rtl/source/alloc_cache.cxx:1411
#4  0xb7f7b724 in rtl_cache_wsupdate_all (arg=0xa) at /home/lgodard/projets/libreoffice/build/git/master/libo/sal/rtl/source/alloc_cache.cxx:1551
#5  0xb7c47cc9 in start_thread (arg=0xb47a1b70) at pthread_create.c:304
#6  0xb7d2c69e in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:130

Thread 1 (Thread 0xb49a37f0 (LWP 8367)):
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7d1ddf6 in __poll (fds=0xb7db4ff4, nfds=6, timeout=1620) at ../sysdeps/unix/sysv/linux/poll.c:87
#2  0xb2795a1b in g_poll () from /lib/libglib-2.0.so.0
#3  0xb278843c in ?? () from /lib/libglib-2.0.so.0
#4  0xb2788848 in g_main_context_iteration () from /lib/libglib-2.0.so.0
#5  0xb2ed3c58 in GtkData::Yield (this=0x87cdc40, bWait=true, bHandleAllCurrentEvents=false) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/unx/gtk/app/gtkdata.cxx:599
#6  0xb2ed6a95 in GtkInstance::Yield (this=0x87cdbd0, bWait=true, bHandleAllCurrentEvents=false) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/unx/gtk/app/gtkinst.cxx:605
#7  0xb68354c4 in ImplYield (i_bWait=true, i_bAllEvents=false) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/source/app/svapp.cxx:455
#8  0xb6831d0e in Application::Yield (i_bAllEvents=false) at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/source/app/svapp.cxx:489
#9  0xb6831ca8 in Application::Execute () at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/source/app/svapp.cxx:432
#10 0xb7f18199 in ?? () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsofficeapp.so
#11 0xb683ba5b in ImplSVMain () at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/source/app/svmain.cxx:178
#12 0xb683bba0 in SVMain () at /home/lgodard/projets/libreoffice/build/git/master/libo/vcl/source/app/svmain.cxx:215
#13 0xb7f35881 in soffice_main () from /home/lgodard/projets/libreoffice/build/git/master/libo/solver/unxlngi6.pro/installation/opt/program/libsofficeapp.so
#14 0x080485c0 in ?? ()
#15 0xb7c72ce7 in __libc_start_main (main=0x8048594, argc=3, ubp_av=0xbfffefa4, init=0x80485f0, fini=0x80485e0, rtld_fini=0xb7ff0b60 <_dl_fini>, stack_end=0xbfffef9c) at libc-start.c:226
#16 0x08048501 in ?? ()
Comment 4 Laurent Godard 2012-01-19 06:14:16 UTC
i do not reproduce under windows XP on 3.5beta3
Comment 5 Michael Meeks 2012-01-19 08:42:30 UTC
Thanks for the trace - it looks normal-ish; though the MNS_Mozilla_UI_Thread is a bit unusual to see that lingering around :-)

I suspect we have a leaked idle handler that is waking those loops up constantly and banging the CPU for no good reason; hmm ...
Comment 6 Laurent Godard 2012-01-19 10:37:28 UTC
by commenting (for testing purposes) the line
http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/mozab/bootstrap/MNSInit.cxx#299

--> the library is correctly unprotected
--> no more cpu eating by soffice
Comment 7 Laurent Godard 2012-01-20 00:22:49 UTC
this behaviour is reproduced when savin a clac file with password
once saved with password, CPU is at 43 %

--> i'll change the description
Comment 8 Laurent Godard 2012-01-20 05:10:47 UTC
Created attachment 55829 [details]
valgrind with debug symbol on simpler save as case

the valgrind is started just befor hitting the save button after giving passwords
Comment 9 QA Administrators 2014-06-25 17:37:57 UTC
Please read this message in its entirety before responding.

Your bug was confirmed at least 1 year ago and has not had any activity on it for over a year. Your bug is still set to NEW which means that it is open and confirmed. It would be nice to have the bug confirmed on a newer version than the version reported in the original report to know that the bug is still present -- sometimes a bug is inadvertently fixed over time and just never closed.

If you have time please do the following:
1) Test to see if the bug is still present on a currently supported version of LibreOffice (preferably 4.2 or newer).
2) If it is present please leave a comment telling us what version of LibreOffice and your operating system.
3) If it is NOT present please set the bug to RESOLVED-WORKSFORME and leave a short comment telling us your version and Operating System

Please DO NOT
1) Update the version field
2) Reply via email (please reply directly on the bug tracker)
3) Set the bug to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 
LibreOffice is powered by a team of volunteers, every bug is confirmed (triaged) by human beings who mostly give their time for free. We invite you to join our triaging by checking out this link:
https://wiki.documentfoundation.org/QA/BugTriage

There are also other ways to get involved including with marketing, UX, documentation, and of course developing -  http://www.libreoffice.org/get-help/mailing-lists/. 

Lastly, good bug reports help tremendously in making the process go smoother, please always provide reproducible steps (even if it seems easy) and attach any and all relevant material
Comment 10 QA Administrators 2015-07-18 17:43:54 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present on a currently supported version of LibreOffice (4.4.1 or later): https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the version of LibreOffice and your operating system, and any changes you see in the bug behavior
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to "inherited from OOo"; 4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for your help!

-- The LibreOffice QA Team This NEW Message was generated on: 2015-07-18
Comment 11 Laurent Godard 2015-10-23 08:49:02 UTC
not reproduced for a long time