[PATCH 01/17] tapsets: mark cloned functions under the clone table lock
Aaron Merey
amerey@redhat.com
Mon Nov 23 04:14:15 GMT 2026
Workers cloning the same helper can write its cloned_p flag
concurrently. Set it under the existing clone table lock.
WARNING: ThreadSanitizer: data race
Write of size 1 at 0xffff7b202ceb by thread T18:
#0 var_expanding_visitor::visit_functioncall ... tapsets.cxx:4037
Previous write of size 1 at 0xffff7b202ceb by thread T20:
#0 var_expanding_visitor::visit_functioncall ... tapsets.cxx:4037
Assisted-by: Codex <noreply@openai.com>
---
tapsets.cxx | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/tapsets.cxx b/tapsets.cxx
index bda728c2b..ec88f2ae9 100644
--- a/tapsets.cxx
+++ b/tapsets.cxx
@@ -4034,8 +4034,6 @@ var_expanding_visitor::visit_functioncall (functioncall* e)
r->body->visit(& cop);
if (cop.context_op_p) // need to clone
{
- r->cloned_p = true; // so don't warn about elision later
-
if (sess.verbose > 2)
clog << _("need a clone of context-op function ") << *r->tok << endl;
@@ -4049,6 +4047,7 @@ var_expanding_visitor::visit_functioncall (functioncall* e)
stap_dwarf_timing.sess_wait_ns,
stap_dwarf_timing.sess_hold_ns,
stap_dwarf_timing.sess_n);
+ r->cloned_p = true; // so don't warn about elision later
auto johnny = sess.functions.find(clone_function_name);
if (johnny != sess.functions.end())
{
--
2.56.1
More information about the Systemtap
mailing list