<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_UNCONFIRMED "
   title="UNCONFIRMED - soffice process hanging on exit (mutex related)"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=122871">122871</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>soffice process hanging on exit (mutex related)
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>LibreOffice
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>6.1.4.2 release
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>OpenBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>UNCONFIRMED
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>framework
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>libreoffice-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>robert@openbsd.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Description:
There has been a bug that has been annoying me for some time now.
Whenever exiting the soffice UI the UI closes, but then the soffice process
is lurking around in sleep mode, probably waiting for on a mutex.

On exit Desktop::DeInit() is called which calls RequestHandler::Disable() for
and the process gets stuck in there.

#1  0x0000014efd92ef6b in _sem_wait (sem=0x14f122f1240, can_eintr=0,
abstime=0x0, delayed_cancel=0x14efeb676d0 <_initial_thread+200>) at
/usr/src/lib/librthread/synch.h:41
#2  0x0000014efd9301fb in pthread_join (thread=0x14f122f1240, retval=0x0) at
/usr/src/lib/librthread/rthread.c:304
#3  0x0000014ec411b345 in desktop::RequestHandler::Disable() () from
/usr/local/lib/libreoffice/program/libsofficeapp.so
#4  0x0000014ec40ee26b in desktop::Desktop::DeInit() () from
/usr/local/lib/libreoffice/program/libsofficeapp.so
#5  0x0000014eaafc1c05 in DeInitVCL() () from
/usr/local/lib/libreoffice/program/libvcllo.so
#6  0x0000014eaafc1310 in ImplSVMain() () from
/usr/local/lib/libreoffice/program/libvcllo.so
#7  0x0000014eaafc26d3 in SVMain() () from
/usr/local/lib/libreoffice/program/libvcllo.so
#8  0x0000014ec41200c1 in soffice_main () from
/usr/local/lib/libreoffice/program/libsofficeapp.so
#9  0x0000014c56927331 in main ()

In the Desktop::Init() function ::Disable is only called on some specific
process types and doing the same in ::DeInit fixes the issue for me.
I don't know if this is the right way but here is the patch that I am
running with now:

--- desktop/source/app/app.cxx.orig
+++ desktop/source/app/app.cxx
@@ -551,6 +551,7 @@ void Desktop::InitFinished()

 void Desktop::DeInit()
 {
+    const CommandLineArgs& rCmdLineArgs = GetCommandLineArgs();                
     try {
         // instead of removing of the configManager just let it commit all the
changes                              
         utl::ConfigManager::storeConfigItems();
@@ -567,7 +568,9 @@ void Desktop::DeInit()
         // clear lockfile
         m_xLockfile.reset();

-        RequestHandler::Disable();
+        if ( !rCmdLineArgs.GetUnknown().isEmpty()
+                  || rCmdLineArgs.IsHelp() || rCmdLineArgs.IsVersion() )       
+            RequestHandler::Disable();
         if( pSignalHandler )
             osl_removeSignalHandler( pSignalHandler );
     } catch (const RuntimeException&) {


Steps to Reproduce:
1. Exit LibreOffice on OpenBSD
2.
3.

Actual Results:
Process hangs.

Expected Results:
Process should exit.


Reproducible: Always


User Profile Reset: No



Additional Info:</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>