Merge pull request #6477 from sfc-gh-ajbeamon/trace-overflow-debug-line

Add some extra print debugging if we overflow the trace buffer
This commit is contained in:
A.J. Beamon 2022-03-01 10:12:09 -08:00 committed by GitHub
commit 1ab963eb5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -399,6 +399,8 @@ public:
// Without this we would never see any trace events from that loop, and it would be more difficult to identify
// where the process is actually stuck.
if (g_network && g_network->isSimulated() && bufferLength > 1e8) {
fprintf(stderr, "Trace log buffer overflow\n");
fprintf(stderr, "Last event: %s\n", fields.toString().c_str());
// Setting this to 0 avoids a recurse from the assertion trace event and also prevents a situation where
// we roll the trace log only to log the single assertion event when using --crash.
bufferLength = 0;