Changeset 104549 in vbox for trunk/src/VBox/Runtime/common/fuzz/fuzz-observer.cpp
- Timestamp:
- May 8, 2024 12:27:24 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/fuzz/fuzz-observer.cpp
r99739 r104549 597 597 uint32_t cbStateWr = (uint32_t)cbState; 598 598 rc = RTPipeWriteBlocking(pExecCtx->hPipeStdinW, &cbStateWr, sizeof(cbStateWr), NULL); 599 rc = RTPipeWriteBlocking(pExecCtx->hPipeStdinW, pvState, cbState, NULL); 599 if (RT_SUCCESS(rc)) 600 rc = RTPipeWriteBlocking(pExecCtx->hPipeStdinW, pvState, cbState, NULL); 600 601 if (RT_SUCCESS(rc)) 601 602 { … … 636 637 else if (achBuf[i] == 'A') 637 638 { 638 /** @todo Advance our fuzzer to get the added input. */ 639 while (cFuzzedInputs--) 640 { 641 RTFUZZINPUT hFuzzInput; 642 rc = RTFuzzCtxInputGenerate(pThis->hFuzzCtx, &hFuzzInput); 643 if (RT_SUCCESS(rc)) 644 RTFuzzInputRelease(hFuzzInput); 645 } 646 647 /* We should be at the input generated by the client now. */ 648 RTFUZZINPUT hFuzzInput; 649 rc = RTFuzzCtxInputGenerate(pThis->hFuzzCtx, &hFuzzInput); 650 if (RT_SUCCESS(rc)) 651 rc = RTFuzzInputAddToCtxCorpus(hFuzzInput); 639 652 } 640 653 } … … 832 845 AssertFailed(); 833 846 834 /*835 * Check whether we reached an unknown target state and add the input to the836 * corpus in that case.837 */838 rc = RTFuzzTgtStateAddToRecorder(pExecCtx->hTgtState);839 847 if (RT_SUCCESS(rc)) 840 848 { 841 /* Add to corpus and create a new target state for the next run. */ 842 RTFuzzInputAddToCtxCorpus(hFuzzInput); 843 RTFuzzTgtStateRelease(pExecCtx->hTgtState); 844 pExecCtx->hTgtState = NIL_RTFUZZTGTSTATE; 845 rc = RTFuzzTgtRecorderCreateNewState(pThis->hTgtRec, &pExecCtx->hTgtState); 846 AssertRC(rc); 847 } 848 else 849 { 850 Assert(rc == VERR_ALREADY_EXISTS); 851 /* Reset the state for the next run. */ 852 rc = RTFuzzTgtStateReset(pExecCtx->hTgtState); 853 AssertRC(rc); 849 /* 850 * Check whether we reached an unknown target state and add the input to the 851 * corpus in that case. 852 */ 853 rc = RTFuzzTgtStateAddToRecorder(pExecCtx->hTgtState); 854 if (RT_SUCCESS(rc)) 855 { 856 /* Add to corpus and create a new target state for the next run. */ 857 RTFuzzInputAddToCtxCorpus(hFuzzInput); 858 RTFuzzTgtStateRelease(pExecCtx->hTgtState); 859 pExecCtx->hTgtState = NIL_RTFUZZTGTSTATE; 860 rc = RTFuzzTgtRecorderCreateNewState(pThis->hTgtRec, &pExecCtx->hTgtState); 861 AssertRC(rc); 862 } 863 else 864 { 865 Assert(rc == VERR_ALREADY_EXISTS); 866 /* Reset the state for the next run. */ 867 rc = RTFuzzTgtStateReset(pExecCtx->hTgtState); 868 AssertRC(rc); 869 } 854 870 } 855 871 RTFuzzInputRelease(hFuzzInput); … … 1068 1084 else 1069 1085 rc = VERR_BUFFER_OVERFLOW; 1070 fSep = true;1086 /*fSep = true; Not used below currently. */ 1071 1087 } 1072 1088 … … 1348 1364 int rc = VINF_SUCCESS; 1349 1365 if (!cProcs) 1350 cProcs = RT_MIN(RTMpGetPresentCoreCount(), sizeof(uint64_t) * 8); 1366 { 1367 cProcs = RTMpGetPresentCoreCount(); 1368 cProcs = RT_MIN(cProcs, sizeof(uint64_t) * 8); 1369 } 1351 1370 1352 1371 rc = rtFuzzObsSetupSanitizerCfg(pThis);
Note:
See TracChangeset
for help on using the changeset viewer.