VirtualBox

Ignore:
Timestamp:
Jul 6, 2021 10:58:38 AM (3 years ago)
Author:
vboxsync
Message:

Additions: X11: seamless: prevent hang on shutdown, bugref:10032.

This commit adds return code check when notifying X11 monitor thread
to shutdown. At some circumstances (when X11 is no longer running) this
operation might fail and service will hang or crash on shutdown.
In such situation, simply skip problematic de-init path and proceed to
service termination.

Also in this commit, do not try to wait for X11 monitor thread termination
second time, in pfnTerm(), since it was already done/attempted in pfnStop().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/x11/VBoxClient/seamless.cpp

    r86873 r90055  
    158158int SeamlessMain::term(void)
    159159{
    160     int rc;
    161 
    162     if (mX11MonitorThread)
    163     {
    164         rc = RTThreadWait(mX11MonitorThread, RT_MS_30SEC, NULL);
    165         if (RT_SUCCESS(rc))
    166         {
    167             mX11MonitorThread = NIL_RTTHREAD;
    168         }
    169         else
    170             VBClLogError("Failed to stop X11 monitor thread, rc=%Rrc\n", rc);
    171     }
    172     else
    173         rc = VINF_SUCCESS;
    174 
    175160    mX11Monitor.uninit();
    176 
    177     return rc;
     161    return VINF_SUCCESS;
    178162}
    179163
     
    298282
    299283    mX11MonitorThreadStopping = true;
    300     mX11Monitor.interruptEventWait();
     284    if (!mX11Monitor.interruptEventWait())
     285    {
     286        VBClLogError("Unable to notify X11 monitor thread\n");
     287        return VERR_INVALID_STATE;
     288    }
    301289
    302290    int rcThread;
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette