[okular] [Bug 393478] crash when I exit presentation mode and enter again

Tobias Deiminger bugzilla_noreply at kde.org
Mon Sep 17 08:10:02 BST 2018


https://bugs.kde.org/show_bug.cgi?id=393478

--- Comment #12 from Tobias Deiminger <haxtibal at posteo.de> ---
Ok, got it. It's this place in PresentationWidget::inhibitPowerManagement
  m_sleepInhibitCookie = reply.value().fileDescriptor();

We must not store QDBusUnixFileDescriptor::fileDescriptor, but clone it before.
>From http://doc.qt.io/qt-5/qdbusunixfiledescriptor.html#fileDescriptor
"It is ok to use it while this object is valid, but if one wants to store it
for longer use, the file descriptor should be cloned using the Unix dup(2),
dup2(2) or dup3(2) functions."

Changing the code to
  m_sleepInhibitCookie = dup( reply.value().fileDescriptor() );
avoids crashing.

Let me gather a bit more context to see if it's really that simple, then I'll
send a patch at Phabricator. Maybe one can try and confirm the above code
change in the meantime?

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Okular-devel mailing list