VirtualBox

儲存庫 vbox 的更動 41686


忽略:
時間撮記:
2012-6-13 下午04:27:49 (12 年 以前)
作者:
vboxsync
訊息:

Runtime/r3/solaris: coredumper cleanup.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/r3/solaris/coredumper-solaris.cpp

    r40504 r41686  
    706706                         * Allocate for each prmap_t object, a corresponding RTSOLCOREMAPINFO object.
    707707                         */
    708                         pSolProc->pMapInfoHead = (PRTSOLCOREMAPINFO)GetMemoryChunk(pSolCore, pSolProc->cMappings * sizeof(RTSOLCOREMAPINFO));
     708                        pSolProc->pMapInfoHead = (PRTSOLCOREMAPINFO)GetMemoryChunk(pSolCore,
     709                                                                                pSolProc->cMappings * sizeof(RTSOLCOREMAPINFO));
    709710                        if (pSolProc->pMapInfoHead)
    710711                        {
     
    774775                }
    775776                else
    776                     CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: FileReadNoIntr failed. rc=%Rrc cbMapFile=%u\n", rc, cbMapFile));
     777                {
     778                    CORELOGRELSYS((CORELOG_NAME "ProcReadMappings: FileReadNoIntr failed. rc=%Rrc cbMapFile=%u\n", rc,
     779                                   cbMapFile));
     780                }
    777781            }
    778782            else
     
    904908                                    pStatus->pr_ustack = (uintptr_t)&pSolProc->pCurThreadCtx->uc_stack;
    905909
    906                                     CORELOG((CORELOG_NAME "ProcReadThreads: patched dumper thread context with pre-dump time context.\n"));
     910                                    CORELOG((CORELOG_NAME "ProcReadThreads: patched dumper thread with pre-dump time context.\n"));
    907911                                }
    908912
     
    939943            else
    940944            {
    941                 CORELOGRELSYS((CORELOG_NAME "ProcReadThreads: huh!? cbStatusHdrAndData=%u prheader_t=%u entsize=%u\n", cbStatusHdrAndData,
    942                             sizeof(prheader_t), pStatusHdr->pr_entsize));
     945                CORELOGRELSYS((CORELOG_NAME "ProcReadThreads: huh!? cbStatusHdrAndData=%u prheader_t=%u entsize=%u\n",
     946                               cbStatusHdrAndData, sizeof(prheader_t), pStatusHdr->pr_entsize));
    943947                CORELOGRELSYS((CORELOG_NAME "ProcReadThreads: huh!? cbInfoHdrAndData=%u entsize=%u\n", cbInfoHdrAndData,
    944948                               pStatusHdr->pr_entsize));
     
    13241328     * The assumption here is that threads can only increase not decrease across iterations.
    13251329     */
    1326 #if 1
    13271330    uint16_t cTries = 0;
    13281331    uint64_t aThreads[4];
     
    13441347    }
    13451348    return rc;
    1346 #else
    1347     PRTSOLCOREPROCESS pSolProc = &pSolCore->SolProc;
    1348 
    1349     char szCurThread[128];
    1350     char szPath[PATH_MAX];
    1351     PRTDIR pDir = NULL;
    1352 
    1353     RTStrPrintf(szPath, sizeof(szPath), "/proc/%d/lwp", (int)pSolProc->Process);
    1354     RTStrPrintf(szCurThread, sizeof(szCurThread), "%d", (int)pSolProc->hCurThread);
    1355 
    1356     int rc = -1;
    1357     uint32_t cThreads = 0;
    1358     uint16_t cTries = 0;
    1359     for (cTries = 0; cTries < 10; cTries++)
    1360     {
    1361         uint32_t cRunningThreads = 0;
    1362         rc = RTDirOpen(&pDir, szPath);
    1363         if (RT_SUCCESS(rc))
    1364         {
    1365             /*
    1366              * Loop through all our threads & suspend them, multiple calls to _lwp_suspend() are okay.
    1367              */
    1368             RTDIRENTRY DirEntry;
    1369             while (RT_SUCCESS(RTDirRead(pDir, &DirEntry, NULL)))
    1370             {
    1371                 if (   !strcmp(DirEntry.szName, ".")
    1372                     || !strcmp(DirEntry.szName, ".."))
    1373                     continue;
    1374 
    1375                 if ( !strcmp(DirEntry.szName, szCurThread))
    1376                     continue;
    1377 
    1378                 int32_t ThreadId = RTStrToInt32(DirEntry.szName);
    1379                 _lwp_suspend((lwpid_t)ThreadId);
    1380                 ++cRunningThreads;
    1381             }
    1382 
    1383             if (cTries > 5 && cThreads == cRunningThreads)
    1384             {
    1385                 rc = VINF_SUCCESS;
    1386                 break;
    1387             }
    1388             cThreads = cRunningThreads;
    1389             RTDirClose(pDir);
    1390         }
    1391         else
    1392         {
    1393             CORELOGRELSYS((CORELOG_NAME "SuspendThreads: Failed to open %s cTries=%d\n", szPath, cTries));
    1394             rc = VERR_READ_ERROR;
    1395             break;
    1396         }
    1397     }
    1398 
    1399     if (RT_SUCCESS(rc))
    1400         CORELOG((CORELOG_NAME "SuspendThreads: Stopped %u threads successfully with %u tries\n", cThreads, cTries));
    1401 
    1402     return rc;
    1403 #endif
    14041349}
    14051350
     
    14461391
    14471392    /*
    1448      * This is a known violation of the 64-bit ELF spec., see xTracker #5211 comment#3
     1393     * This is a known violation of the 64-bit ELF spec., see xTracker @bugref{5211}
    14491394     * for the historic reasons as to the padding and namesz anomalies.
    14501395     */
     
    15991544                if (RT_FAILURE(rc))
    16001545                {
    1601                     CORELOGRELSYS((CORELOG_NAME "ElfWriteNoteSection: ElfWriteNoteHeader failed for %s. rc=%Rrc\n", aElfNotes[i].pszType, rc));
     1546                    CORELOGRELSYS((CORELOG_NAME "ElfWriteNoteSection: ElfWriteNoteHeader failed for %s. rc=%Rrc\n",
     1547                                   aElfNotes[i].pszType, rc));
    16021548                    break;
    16031549                }
     
    16561602                if (RT_FAILURE(rc))
    16571603                {
    1658                     CORELOGRELSYS((CORELOG_NAME "ElfWriteNoteSection: ElfWriteNoteHeader failed for %s. rc=%Rrc\n", aElfNotes[i].pszType, rc));
     1604                    CORELOGRELSYS((CORELOG_NAME "ElfWriteNoteSection: ElfWriteNoteHeader failed for %s. rc=%Rrc\n",
     1605                                   aElfNotes[i].pszType, rc));
    16591606                    break;
    16601607                }
     
    16801627                    if (RT_FAILURE(rc))
    16811628                    {
    1682                         CORELOGRELSYS((CORELOG_NAME "ElfWriteNoteSection: ElfWriteNoteHeader for NT_LWPSTATUS failed. rc=%Rrc\n", rc));
     1629                        CORELOGRELSYS((CORELOG_NAME "ElfWriteNoteSection: ElfWriteNoteHeader for NT_LWPSTATUS failed. rc=%Rrc\n",
     1630                                       rc));
    16831631                        break;
    16841632                    }
     
    18111759}
    18121760
    1813 /** 
    1814  * Inner worker for rtCoreDumperWriteCore, which purpose is to 
    1815  * squash cleanup gotos. 
    1816  */
    1817 static int rtCoreDumperWriteCoreDoIt(PRTSOLCORE pSolCore, PFNRTCOREWRITER pfnWriter, 
     1761/**
     1762 * Inner worker for rtCoreDumperWriteCore, which purpose is to
     1763 * squash cleanup gotos.
     1764 */
     1765static int rtCoreDumperWriteCoreDoIt(PRTSOLCORE pSolCore, PFNRTCOREWRITER pfnWriter,
    18181766                                     PRTSOLCOREPROCESS pSolProc)
    18191767{
     
    20782026            {
    20792027                /*
    2080                  * Read process status, information such as number of active LWPs will be invalid since we just quiesced the process.
     2028                 * Read process status, information such as number of active LWPs will be
     2029                 * invalid since we just quiesced the process.
    20812030                 */
    20822031                rc = ProcReadStatus(pSolCore);
     
    22612210             * to let our core dumper finish, on timeout trigger system dump.
    22622211             */
    2263             CORELOGRELSYS((CORELOG_NAME "SignalHandler: Core dump already in progress! Waiting a while for completion Sig=%d.\n", Sig));
     2212            CORELOGRELSYS((CORELOG_NAME "SignalHandler: Core dump already in progress! Waiting a while for completion Sig=%d.\n",
     2213                           Sig));
    22642214            int64_t iTimeout = 16000;  /* timeout (ms) */
    22652215            for (;;)
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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