VirtualBox

Changeset 69989 in vbox for trunk/src/VBox/GuestHost/OpenGL


Ignore:
Timestamp:
Dec 7, 2017 4:25:08 PM (7 years ago)
Author:
vboxsync
Message:

Additions/common/OpenGL: fix regressions from r117617/public r68472.
bugref:9060: vboxvideo: hanging login screen starting Ubuntu 17.10 guest with 3D
r117617/public r68472 and the follow-up switched from using duplicate code in
the X11 libGL code to access the guest driver and HGCM to using the common
code. It contained at least two problems: it failed to initialise the
runtime library before calling into the Guest library and it changed error
checking semantics slightly, causing us to fail to handle a too-small-buffer
error and sending GNOME Shell into an endless loop. This change fixes that
and also adds todo comments to other places where the error handling should
be cleaned up, but which I do not want to change and test just now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c

    r69500 r69989  
    3737#include "cr_process.h"
    3838
     39#include <iprt/initterm.h>
    3940#include <iprt/thread.h>
    4041
     
    705706
    706707        rc = crVBoxHGCMCall(conn, &parms.hdr, sizeof(parms));
    707         callRes = parms.hdr.Hdr.rc;
     708        callRes = parms.hdr.Hdr.rc; /** @todo now rc == parms.hdr.Hdr.rc */
    708709    }
    709710    else
     
    719720
    720721        rc = crVBoxHGCMCall(conn, &parms.hdr, sizeof(parms));
    721         callRes = parms.hdr.Hdr.rc;
     722        callRes = parms.hdr.Hdr.rc; /** @todo now rc == parms.hdr.Hdr.rc */
    722723    }
    723724
     
    759760    rc = crVBoxHGCMCall(conn, &parms.hdr, sizeof(parms));
    760761
    761     if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc))
     762    if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc) /** @todo now rc == parms.hdr.Hdr.rc */)
    762763    {
    763764        crWarning("SHCRGL_GUEST_FN_READ failed with %x %x\n", rc, parms.hdr.Hdr.rc);
     
    835836
    836837            rc = crVBoxHGCMCall(conn, &wbParms.hdr, sizeof(wbParms));
    837             if (RT_FAILURE(rc) || RT_FAILURE(wbParms.hdr.Hdr.rc))
     838            if (RT_FAILURE(rc) || RT_FAILURE(wbParms.hdr.Hdr.rc) /** @todo now rc == wbParms.hdr.Hdr.rc */)
    838839            {
    839840                crError("SHCRGL_GUEST_FN_WRITE_BUFFER (%i) failed with %x %x\n", wbParms.pBuffer.u.Pointer.size, rc, wbParms.hdr.Hdr.rc);
     
    866867#endif
    867868
    868     if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc))
    869     {
    870 
    871         if ((VERR_BUFFER_OVERFLOW == parms.hdr.Hdr.rc) && RT_SUCCESS(rc))
     869    if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc) /** @todo now rc == parms.hdr.Hdr.rc */)
     870    {
     871
     872        if ((VERR_BUFFER_OVERFLOW == parms.hdr.Hdr.rc) /* && RT_SUCCESS(rc) */)
    872873        {
    873874            /* reallocate buffer and retry */
     
    991992    rc = crVBoxHGCMCall(conn, &parms.hdr, sizeof(parms));
    992993
    993     if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc))
     994    if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc) /** @todo now rc == parms.hdr.Hdr.rc */)
    994995    {
    995996        crDebug("SHCRGL_GUEST_FN_READ failed with %x %x\n", rc, parms.hdr.Hdr.rc);
     
    11941195    if (RT_SUCCESS(rc))
    11951196    {
    1196         rc =  parms.hdr.Hdr.rc;
     1197        rc =  parms.hdr.Hdr.rc; /** @todo now rc == parms.hdr.Hdr.rc */
    11971198        if (RT_SUCCESS(rc))
    11981199        {
     
    12561257    rc = crVBoxHGCMCall(conn, &parms.hdr, sizeof(parms));
    12571258
    1258     if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc))
     1259    if (RT_FAILURE(rc) || RT_FAILURE(parms.hdr.Hdr.rc) /** @todo now rc == parms.hdr.Hdr.rc */)
    12591260    {
    12601261        crWarning("SHCRGL_GUEST_FN_SET_PID failed!");
     
    12751276    int rc;
    12761277    VBOXCRHGSMIPROFILE_FUNC_PROLOGUE();
     1278    RTR3InitDll(RTR3INIT_FLAGS_UNOBTRUSIVE);
    12771279    rc = VbglR3InitUser();
    12781280    if (RT_SUCCESS(rc))
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