HANG drraw2trace 32-bit Windows on Appveyor
When I switched from using istream::seekg to custom buffering for the peek and putback in drraw2trace, the 32-bit tool.histogram.offline test started hanging on Appveyor:
https://ci.appveyor.com/project/DynamoRIO/dynamorio/build/1.0.1399
238/238 Test #210: code_api|tool.histogram.offline ..............................***Timeout 180.01 sec
Running cmd |C:/projects/dynamorio/build/build_debug-internal-32/bin32/drrun.exe;-s;180;-quiet;-debug;-use_dll;C:/projects/dynamorio/build/build_debug-internal-32/lib32/debug/dynamorio.dll;-exit0;-stderr_mask;0xC;-msgbox_mask;0;-dumpcore_mask;0x7d;-staged;-code_api;-t;drcachesim;-offline;-trace_after_instrs;5K;-exit_after_tracing;1M;--;C:/projects/dynamorio/build/build_debug-internal-32/suite/tests/bin/client.winxfer.exe|
Running postcmd |C:/projects/dynamorio/build/build_debug-internal-32/clients/bin32/drcachesim.exe;-indir;C:/projects/dynamorio/build/build_debug-internal-32/suite/tests/drmemtrace.client.winxfer.exe.04932.0837.dir|
I lowered the -exit_after_tracing from 1M to 500K and raised the timeout to 200s and it still timed out.
Yet 32-bit passes and is faster than before (8s instead of 12+s) on my local machine, individually or in the full suite.
I then tweaked my PR #2749 to run ctest -VV and -exit_after_tracing 5K and the test passed (in 0.6s).
I then isolated the test by running only that test on Appveyor in the suite, back to 1M, and it passed in 9s. I re-ran it by itself and it passed again in 9s. https://ci.appveyor.com/project/DynamoRIO/dynamorio/build/1.0.1406
210: Test timeout computed to be: 200
210: Running cmd |C:/projects/dynamorio/build/build_debug-internal-32/bin32/drrun.exe;-s;200;-quiet;-debug;-use_dll;C:/projects/dynamorio/build/build_debug-internal-32/lib32/debug/dynamorio.dll;-exit0;-stderr_mask;0xC;-msgbox_mask;0;-dumpcore_mask;0x7d;-staged;-code_api;-t;drcachesim;-offline;-trace_after_instrs;7K;-exit_after_tracing;1M;--;C:/projects/dynamorio/build/build_debug-internal-32/suite/tests/bin/client.winxfer.exe|
210: Running postcmd |C:/projects/dynamorio/build/build_debug-internal-32/clients/bin32/drcachesim.exe;-indir;C:/projects/dynamorio/build/build_debug-internal-32/suite/tests/drmemtrace.client.winxfer.exe.01456.9280.dir|
210: Running postcmd2 |C:/projects/dynamorio/build/build_debug-internal-32/clients/bin32/drmemtrace_histogram.exe;-test_mode;-trace;C:/projects/dynamorio/build/build_debug-internal-32/suite/tests/drmemtrace.client.winxfer.exe.01456.9280.dir/drmemtrace.trace|
1/1 Test #210: code_api|tool.histogram.offline ... Passed 9.03 sec
100% tests passed, 0 tests failed out of 1
From the output the hang is on the raw2trace step (or possibly in the simulator): could it really be in the caching code?
I am stumped. To make progress, because the istream::seekg is blocking other uses cases, I'm going to either disable the test on Windows or shrink it or run a different app for now. We'll see if there is any problem w/ the caching code anywhere else which may give us a hint as to what's going on here.