VirtualBox

Changeset 98608 in vbox for trunk/src/VBox/Main/src-client


Ignore:
Timestamp:
Feb 16, 2023 4:28:22 PM (2 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
155900
Message:

Main/GuestProcessImpl.cpp: try fix VERR_IPE_UNINITIALIZED_STATUS errors. bugref:9783

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-client/GuestProcessImpl.cpp

    r98526 r98608  
    16761676                             fWaitFlags, newStatus, waitResult));
    16771677#endif
    1678             if (ProcessWaitResult_None != waitResult) /* We got a waiting result. */
     1678            if (waitResult != ProcessWaitResult_None) /* We got a waiting result. */
    16791679                break;
    16801680        }
     
    16871687    unregisterWaitEvent(pEvent);
    16881688
    1689     LogFlowThisFunc(("Returned waitResult=%RU32, newStatus=%RU32, vrc=%Rrc\n", waitResult, newStatus, vrc));
     1689    LogFlowThisFunc(("returns %Rrc - waitResult=%RU32 newStatus=%RU32 *pvrcGuest=%Rrc\n",
     1690                     vrc, waitResult, newStatus, pvrcGuest ? *pvrcGuest : -VERR_IPE_UNINITIALIZED_STATUS));
    16901691    return vrc;
    16911692}
     
    18831884    Assert(vrc != VERR_GSTCTL_GUEST_ERROR || !pvrcGuest || *pvrcGuest != (int)0xcccccccc);
    18841885
    1885     LogFlowFuncLeaveRC(vrc);
     1886    LogFlowFunc(("LEAVE: %Rrc *pvrcGuest=%Rrc *pProcessStatus=%d\n",
     1887                 vrc, pvrcGuest ? *pvrcGuest : -VERR_IPE_UNINITIALIZED_STATUS, pProcessStatus ? *pProcessStatus : -1));
    18861888    return vrc;
    18871889}
     
    24112413bool GuestProcessToolbox::isTerminatedOk(void)
    24122414{
    2413     return getTerminationStatus() == VINF_SUCCESS ? true : false;
     2415    return getTerminationStatus() == VINF_SUCCESS;
    24142416}
    24152417
     
    24282430 */
    24292431/* static */
    2430 int GuestProcessToolbox::run(      GuestSession              *pGuestSession,
    2431                              const GuestProcessStartupInfo   &startupInfo,
    2432                                    int                       *pvrcGuest /* = NULL */)
    2433 {
    2434     int vrcGuest = VERR_IPE_UNINITIALIZED_STATUS;
    2435 
     2432int GuestProcessToolbox::run(GuestSession                  *pGuestSession,
     2433                             GuestProcessStartupInfo const &startupInfo,
     2434                             int                           *pvrcGuest /* = NULL */)
     2435{
    24362436    GuestProcessToolErrorInfo errorInfo = { VERR_IPE_UNINITIALIZED_STATUS, INT32_MAX };
    24372437    int vrc = runErrorInfo(pGuestSession, startupInfo, errorInfo);
    24382438    if (RT_SUCCESS(vrc))
    24392439    {
     2440/** @todo r=bird: Seems like this is duplicated in the runErrInfo or
     2441 *        something, because it returns with VERR_GSTCTL_GUEST_ERROR.
     2442 *        Temporary fix is to always set pvrcGuest before returning. */
    24402443        /* Make sure to check the error information we got from the guest tool. */
    24412444        if (GuestProcess::i_isGuestError(errorInfo.vrcGuest))
    24422445        {
    24432446            if (errorInfo.vrcGuest == VERR_GSTCTL_PROCESS_EXIT_CODE) /* Translate exit code to a meaningful error code. */
    2444                 vrcGuest = GuestProcessToolbox::exitCodeToRc(startupInfo, errorInfo.iExitCode);
    2445             else /* At least return something. */
    2446                 vrcGuest = errorInfo.vrcGuest;
    2447 
    2448             if (pvrcGuest)
    2449                 *pvrcGuest = vrcGuest;
    2450 
     2447                errorInfo.vrcGuest = GuestProcessToolbox::exitCodeToRc(startupInfo, errorInfo.iExitCode);
    24512448            vrc = VERR_GSTCTL_GUEST_ERROR;
    24522449        }
    24532450    }
    24542451
    2455     LogFlowFunc(("Returned vrc=%Rrc, vrcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode));
     2452    /* See above. */
     2453    if (pvrcGuest)
     2454        *pvrcGuest = errorInfo.vrcGuest;
     2455
     2456    LogFlowFunc(("returns %Rrc - vrcGuest=%Rrc iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode));
    24562457    return vrc;
    24572458}
     
    25132514    }
    25142515
    2515     LogFlowFunc(("Returned vrc=%Rrc, vrcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode));
     2516    LogFlowFunc(("returns %Rrc - vrcGuest=%Rrc iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode));
    25162517    return vrc;
    25172518}
     
    25532554            {
    25542555                GuestToolboxStreamBlock strmBlk;
    2555                 vrc = procTool.waitEx(  paStrmOutObjects
    2556                                         ? GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK
    2557                                         : GUESTPROCESSTOOL_WAIT_FLAG_NONE, &strmBlk, &errorInfo.vrcGuest);
     2556                vrc = procTool.waitEx(paStrmOutObjects
     2557                                      ? GUESTPROCESSTOOL_WAIT_FLAG_STDOUT_BLOCK
     2558                                      : GUESTPROCESSTOOL_WAIT_FLAG_NONE,
     2559                                      &strmBlk, &errorInfo.vrcGuest);
    25582560                if (paStrmOutObjects)
    25592561                    paStrmOutObjects->push_back(strmBlk);
     
    25772579    }
    25782580
    2579     LogFlowFunc(("Returned vrc=%Rrc, vrcGuest=%Rrc, iExitCode=%d\n", vrc, errorInfo.vrcGuest, errorInfo.iExitCode));
     2581    LogFlowFunc(("returns %Rrc - vrcGuest=%Rrc iExitCode=%d (%#x)\n",
     2582                 vrc, errorInfo.vrcGuest, errorInfo.iExitCode, errorInfo.iExitCode));
    25802583    return vrc;
    25812584}
Note: See TracChangeset for help on using the changeset viewer.

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