Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerneltoast/de561bda7d61843384168a61de0d3136 to your computer and use it in GitHub Desktop.
Save kerneltoast/de561bda7d61843384168a61de0d3136 to your computer and use it in GitHub Desktop.
From fbdb4fa80c2675b409c114c6d0402dfcdcba17fe Mon Sep 17 00:00:00 2001
From: Sultan Alsawaf <sultan@openresty.com>
Date: Wed, 16 Dec 2020 13:03:47 -0800
Subject: [PATCH] session.cxx: fix print error dupe-elimination for chained
errors
Commit 582e9c4448cc attempted to fix an issue introduced in
0e1d5b7eb397, but the breakage from 0e1d5b7eb397 was too intense to be
tamed with a single subsequent fix commit. As we know from 582e9c4448cc,
the author of 0e1d5b7eb397 was "some guy" who should "never again be
allowed near computers", so it doesn't come as a surprise that the same
guy would be responsible for more than one bug. As it turns out, that
guy was responsible for an issue where the first error in a chained
message would be duplicated because the wrong seen_errors is checked
inside the loop, after that first message would be printed outside the
loop. This fixes the issue by using the same error counter throughout.
---
session.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/session.cxx b/session.cxx
index 36a405373..96719e5db 100644
--- a/session.cxx
+++ b/session.cxx
@@ -2391,9 +2391,9 @@ systemtap_session::print_error (const semantic_error& se)
seen_errors[se.errsrc_chain()]++;
cerr << build_error_msg(se);
for (const semantic_error *e = &se; e != NULL; e = e->get_chain())
- if (verbose > 1 || seen_errors[e->errsrc] < 1) // dupe-eliminate chained errors too
+ if (verbose > 1 || seen_errors[e->errsrc_chain()] < 1) // dupe-eliminate chained errors too
{
- seen_errors[e->errsrc]++;
+ seen_errors[e->errsrc_chain()]++;
cerr << build_error_msg(*e);
}
}
--
2.29.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment