summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-05-30 10:38:23 +0300
committerPaul Buetow <paul@buetow.org>2026-05-30 10:38:23 +0300
commit48434d3767c6b15e8d86b1f3d06d9498337d2301 (patch)
treed32d88ce18756119474da4a6774817499463957d
parentedf4f5d586a65ce6258503e453c98b07429d82d1 (diff)
test(generate): lock in set_tid_address ret as UNCLASSIFIED
set_tid_address(2) always returns the caller's thread ID and never fails (no -1, no byte count). Assert its exit stays UNCLASSIFIED in TestClassifyRetUnclassified alongside its pid/tid-returning Process siblings setsid/getsid/getpid/getppid, so a stray byte-count reclassification trips the test. Audit of yz confirmed the existing classification is correct: KindNull (single userspace tidptr, no fd/path) and FamilyProcess. The KindNull case is already covered by TestClassify97NameOnlyKinds; this adds the previously-missing return-value assertion. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
-rw-r--r--internal/generate/retclassify_test.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/internal/generate/retclassify_test.go b/internal/generate/retclassify_test.go
index 2f53437..29e2b0f 100644
--- a/internal/generate/retclassify_test.go
+++ b/internal/generate/retclassify_test.go
@@ -92,6 +92,13 @@ func TestClassifyRetUnclassified(t *testing.T) {
"setpgid",
"getpid",
"getppid",
+ // set_tid_address(2) sets the calling thread's clear_child_tid pointer
+ // and ALWAYS returns the caller's thread ID — it never fails and never
+ // returns -1 (set_tid_address(2): "always succeeds"). That return is a
+ // thread identifier (a pid_t/tid), NOT a transferred byte count, so its
+ // exit must stay UNCLASSIFIED (plain ret_event), exactly like its
+ // pid/tid-returning Process siblings setsid/getsid/getpid/getppid above.
+ "set_tid_address",
}
for _, name := range unclassified {
if got := ClassifyRet("sys_exit_" + name); got != Unclassified {