[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-06-02 Thread Jan Kundrát
https://bugs.kde.org/show_bug.cgi?id=451059

Jan Kundrát  changed:

   What|Removed |Added

 CC||j...@kde.org

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-04-11 Thread Amaury Pouly
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #10 from Amaury Pouly  ---
(In reply to Amaury Pouly from comment #9)
> I cannot explain yet *how* this can possibly lock for 10 seconds however.
I think this behaviour comes from QLockFile:
https://github.com/RSATom/Qt/blob/master/qtbase/src/corelib/io/qlockfile.cpp
In QLockFile::tryLock(), the sleep time is doubled on every failure, up to 5
seconds. So if all okular instances rush to lock the file, it is actually
possible that this happens.

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-04-11 Thread Amaury Pouly
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #9 from Amaury Pouly  ---
Hi, I have made progress on this (I think)!
By running okular in a debugger and stopping the program when it freezes, I
have noticed that almost every time the backtrace is as follows (slightly
abbreviated):

#0  0x76231be5 in __GI___clock_nanosleep (clock_id=clock_id@entry=0,
flags=flags@entry=0, req=0x7fffd0f0, rem=0x7fffd0f0) at
../sysdeps/unix/sysv/linux/clock_nanosleep.c:43
#1  0x76236ca3 in __GI___nanosleep (req=, rem=) at ../sysdeps/unix/sysv/linux/nanosleep.c:25
#2  0x7686ca5d in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#3  0x7674b01f in QLockFile::tryLock(int) () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#4  0x779adc59 in KConfigIniBackend::lock (this=0x556e12b0) at
./src/core/kconfigini.cpp:632
#5  0x77998796 in KConfigPrivate::lockLocal (this=0x556e2a90) at
./src/core/kconfig.cpp:123
#6  KConfig::sync (this=0x556e2b50) at ./src/core/kconfig.cpp:422
#7  0x77c97c0e in KMainWindow::saveAutoSaveSettings (this=) at ./src/kmainwindow.cpp:882
#8  0x7684c123 in ?? () from /usr/lib/x86_64-linux-gnu/libQt5Core.so.5
#9  0x7684ffca in QTimer::timeout(QTimer::QPrivateSignal) () from
/usr/lib/x86_64-linux-gnu/libQt5Core.so.5

Recall that I have many (20+) instances of okular running so my theory is now
that there might be a lot of contention on the config file lock. This can be
easily checked by running (in my case):
inotifywait -m -r /home/pamaury/.config/
and observe that okular is *very very frequently* taking a lock okularrc.lock
to write okularrc.
Actually, this is slightly scary: just switching between virtual desktop will
trigger a flurry of creation/deletion of this file.
I cannot explain yet *how* this can possibly lock for 10 seconds however.

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-08 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #8 from Albert Astals Cid  ---
Personally i don't :/

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-07 Thread Amaury Pouly
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #7 from Amaury Pouly  ---
(In reply to Albert Astals Cid from comment #6)
> But if it happens just by switching virtual desktops, it has nothing to do
> with dbus?
> 
> dbus is not involved in that scenario that i can see

That's a good point.
Do you have any advice on how I could track down this problem?

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-04 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #6 from Albert Astals Cid  ---
But if it happens just by switching virtual desktops, it has nothing to do with
dbus?

dbus is not involved in that scenario that i can see

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-02 Thread Amaury Pouly
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #5 from Amaury Pouly  ---
(In reply to Albert Astals Cid from comment #4)
> I just tried with 32 okular instances open and the canOpenDocs elapsed time
> for all the instances when opening a new one never took more than 75ms
> (tried 20 times or so), which makes sense, canOpenDocs should be very fast
> since it do much.
> 
> When you say "open a new document", how exactly are you opening it?
> 
> Any peculiarity of your system that you think may cause this? Remote NFS
> file system? weird libc? weird dbus rules?

I usually either open it using Dolphin or using Zotero, but it can also happen
just when switching between virtual desktops and not opening anything (less
common though). Everything is local (not NFS), nothing particularly custom, no
special dbus rules.

When it happens, switching between virtual desktops is a often a trigger. For
example:
1) open file A.pdf => fast
2) switch to other virtual desktop
3) open file A.pdf => slow
4) close it, open A.pdf => fast
5) switch to other virtual desktop
6) open A.pdf => slow

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-02 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #4 from Albert Astals Cid  ---
I just tried with 32 okular instances open and the canOpenDocs elapsed time for
all the instances when opening a new one never took more than 75ms (tried 20
times or so), which makes sense, canOpenDocs should be very fast since it do
much.

When you say "open a new document", how exactly are you opening it?

Any peculiarity of your system that you think may cause this? Remote NFS file
system? weird libc? weird dbus rules?

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-02 Thread Amaury Pouly
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #3 from Amaury Pouly  ---
(In reply to Albert Astals Cid from comment #2)
> I understand you don't have tabs enabled, right?

Yes that's correct.

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-02 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=451059

--- Comment #2 from Albert Astals Cid  ---
I understand you don't have tabs enabled, right?

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-02 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=451059

Albert Astals Cid  changed:

   What|Removed |Added

 CC||aa...@kde.org
   Severity|major   |normal

--- Comment #1 from Albert Astals Cid  ---
This is not major by any definition of major.

-- 
You are receiving this mail because:
You are watching all bug changes.

[okular] [Bug 451059] Okular freezes for up to 10 seconds when loading a document or switching windows

2022-03-02 Thread Amaury Pouly
https://bugs.kde.org/show_bug.cgi?id=451059

Amaury Pouly  changed:

   What|Removed |Added

 CC||amaury.po...@gmail.com

-- 
You are receiving this mail because:
You are watching all bug changes.