From 48434d3767c6b15e8d86b1f3d06d9498337d2301 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 30 May 2026 10:38:23 +0300 Subject: 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 --- internal/generate/retclassify_test.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'internal') 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 { -- cgit v1.2.3