@ttsc/darwin-arm64 0.14.0-dev.20260529.1 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/go/VERSION +2 -2
- package/bin/go/bin/go +0 -0
- package/bin/go/bin/gofmt +0 -0
- package/bin/go/pkg/tool/darwin_arm64/asm +0 -0
- package/bin/go/pkg/tool/darwin_arm64/cgo +0 -0
- package/bin/go/pkg/tool/darwin_arm64/compile +0 -0
- package/bin/go/pkg/tool/darwin_arm64/cover +0 -0
- package/bin/go/pkg/tool/darwin_arm64/fix +0 -0
- package/bin/go/pkg/tool/darwin_arm64/link +0 -0
- package/bin/go/pkg/tool/darwin_arm64/preprofile +0 -0
- package/bin/go/pkg/tool/darwin_arm64/vet +0 -0
- package/bin/go/src/archive/tar/format.go +6 -0
- package/bin/go/src/archive/tar/reader.go +24 -4
- package/bin/go/src/builtin/builtin.go +13 -4
- package/bin/go/src/crypto/fips140/fips140.go +6 -0
- package/bin/go/src/crypto/internal/fips140/drbg/entropy_fips140.go +97 -0
- package/bin/go/src/crypto/internal/fips140/drbg/entropy_wasm.go +11 -0
- package/bin/go/src/crypto/internal/fips140/drbg/rand.go +1 -75
- package/bin/go/src/crypto/tls/conn.go +7 -3
- package/bin/go/src/crypto/tls/handshake_client_tls13.go +2 -2
- package/bin/go/src/crypto/tls/handshake_server_tls13.go +2 -2
- package/bin/go/src/crypto/tls/key_schedule.go +24 -3
- package/bin/go/src/crypto/x509/constraints.go +33 -33
- package/bin/go/src/crypto/x509/verify.go +28 -13
- package/bin/go/src/go/types/builtins.go +2 -2
- package/bin/go/src/go/types/signature.go +3 -0
- package/bin/go/src/go/types/under.go +3 -3
- package/bin/go/src/go.mod +1 -1
- package/bin/go/src/go.sum +2 -2
- package/bin/go/src/html/template/attr_string.go +3 -2
- package/bin/go/src/html/template/context.go +21 -1
- package/bin/go/src/html/template/element_string.go +3 -2
- package/bin/go/src/html/template/escape.go +16 -2
- package/bin/go/src/html/template/js.go +1 -0
- package/bin/go/src/html/template/state_string.go +5 -3
- package/bin/go/src/html/template/transition.go +43 -6
- package/bin/go/src/internal/buildcfg/zbootstrap.go +1 -1
- package/bin/go/src/internal/godebugs/table.go +1 -0
- package/bin/go/src/internal/poll/fd_windows.go +64 -38
- package/bin/go/src/internal/poll/fstatat_unix.go +22 -0
- package/bin/go/src/internal/poll/sendfile_windows.go +3 -1
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_386.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_amd64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_arm.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_arm64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_loong64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_mips64x.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_mipsx.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_ppc64x.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_riscv64.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/defs_linux_s390x.go +1 -0
- package/bin/go/src/internal/runtime/syscall/linux/syscall_linux.go +14 -0
- package/bin/go/src/internal/syscall/unix/at.go +0 -17
- package/bin/go/src/internal/syscall/unix/at_sysnum_linux.go +2 -1
- package/bin/go/src/internal/syscall/unix/fchmodat_linux.go +51 -0
- package/bin/go/src/internal/syscall/unix/fchmodat_other.go +29 -0
- package/bin/go/src/internal/syscall/windows/at_windows.go +20 -3
- package/bin/go/src/internal/syscall/windows/registry/key.go +10 -2
- package/bin/go/src/internal/syscall/windows/registry/value.go +5 -1
- package/bin/go/src/internal/syscall/windows/syscall_windows.go +4 -0
- package/bin/go/src/internal/syscall/windows/types_windows.go +82 -0
- package/bin/go/src/internal/syscall/windows/zsyscall_windows.go +27 -0
- package/bin/go/src/net/cgo_unix.go +4 -1
- package/bin/go/src/net/http/doc.go +0 -1
- package/bin/go/src/net/http/h2_bundle.go +3 -3
- package/bin/go/src/net/http/httputil/reverseproxy.go +14 -0
- package/bin/go/src/net/lookup_windows.go +16 -3
- package/bin/go/src/net/mail/message.go +20 -9
- package/bin/go/src/net/sendfile.go +2 -0
- package/bin/go/src/net/sendfile_stub.go +2 -0
- package/bin/go/src/net/sendfile_windows.go +3 -0
- package/bin/go/src/net/url/url.go +22 -16
- package/bin/go/src/os/dir_darwin.go +2 -2
- package/bin/go/src/os/dir_unix.go +2 -2
- package/bin/go/src/os/file.go +0 -3
- package/bin/go/src/os/file_unix.go +9 -5
- package/bin/go/src/os/removeall_at.go +6 -2
- package/bin/go/src/os/removeall_unix.go +0 -8
- package/bin/go/src/os/removeall_windows.go +0 -4
- package/bin/go/src/os/root_unix.go +1 -0
- package/bin/go/src/os/stat.go +3 -0
- package/bin/go/src/os/statat.go +24 -0
- package/bin/go/src/os/statat_other.go +12 -0
- package/bin/go/src/os/statat_unix.go +20 -0
- package/bin/go/src/reflect/value.go +3 -2
- package/bin/go/src/runtime/defs_linux_386.go +4 -3
- package/bin/go/src/runtime/defs_linux_arm.go +4 -3
- package/bin/go/src/runtime/defs_linux_mips64x.go +1 -1
- package/bin/go/src/runtime/defs_linux_mipsx.go +5 -4
- package/bin/go/src/runtime/malloc.go +1 -53
- package/bin/go/src/runtime/mem.go +104 -9
- package/bin/go/src/runtime/metrics/doc.go +5 -0
- package/bin/go/src/runtime/os_linux.go +62 -0
- package/bin/go/src/runtime/os_linux32.go +14 -24
- package/bin/go/src/runtime/os_linux64.go +2 -0
- package/bin/go/src/runtime/print.go +16 -4
- package/bin/go/src/runtime/race/README +9 -9
- package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_darwin.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_freebsd.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_linux.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_linux.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_windows.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v1/race_windows.syso +0 -0
- package/bin/go/src/runtime/race/internal/amd64v3/race_linux.patch +63 -0
- package/bin/go/src/runtime/race/internal/amd64v3/race_linux.syso +0 -0
- package/bin/go/src/runtime/race/race_darwin_arm64.patch +63 -0
- package/bin/go/src/runtime/race/race_darwin_arm64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_arm64.patch +63 -0
- package/bin/go/src/runtime/race/race_linux_arm64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_loong64.patch +63 -0
- package/bin/go/src/runtime/race/race_linux_loong64.syso +0 -0
- package/bin/go/src/runtime/race/race_linux_s390x.patch +63 -0
- package/bin/go/src/runtime/race/race_linux_s390x.syso +0 -0
- package/bin/go/src/syscall/syscall_windows.go +5 -1
- package/bin/go/src/vendor/modules.txt +1 -1
- package/bin/ttsc +0 -0
- package/bin/ttscserver +0 -0
- package/package.json +1 -1
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
From cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Michael Pratt <michael@prattmic.com>
|
|
3
|
+
Date: Fri, 12 Dec 2025 16:31:44 +1100
|
|
4
|
+
Subject: [PATCH] [TSan] Zero-initialize Trace.local_head
|
|
5
|
+
|
|
6
|
+
Trace.local_head is currently uninitialized when Trace is created. It is
|
|
7
|
+
first initialized when the first event is added to the trace, via the
|
|
8
|
+
first call to TraceSwitchPartImpl.
|
|
9
|
+
|
|
10
|
+
However, ThreadContext::OnFinished uses local_head, assuming that it is
|
|
11
|
+
initialized. If it has not been initialized, we have undefined behavior,
|
|
12
|
+
likely crashing if the contents are garbage. The allocator (Alloc)
|
|
13
|
+
reuses previously allocations, so the contents of the uninitialized
|
|
14
|
+
memory are arbitrary.
|
|
15
|
+
|
|
16
|
+
In a C/C++ TSAN binary it is likely very difficult for a thread to start
|
|
17
|
+
and exit without a single event inbetween. For Go programs, code running
|
|
18
|
+
in the Go runtime itself is not TSan-instrumented, so goroutines that
|
|
19
|
+
exclusively run runtime code (such as GC workers) can quite reasonably
|
|
20
|
+
have no TSan events.
|
|
21
|
+
|
|
22
|
+
The addition of such a goroutine to the Go test.c is sufficient to
|
|
23
|
+
trigger this case, though for reliable failure (segfault) I've found it
|
|
24
|
+
necessary to poison the ThreadContext allocation like so:
|
|
25
|
+
|
|
26
|
+
(Example patch redacted because patch tries to apply this as a real
|
|
27
|
+
patch. See full commit at
|
|
28
|
+
https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca).
|
|
29
|
+
|
|
30
|
+
The fix is trivial: local_head should be zero-initialized.
|
|
31
|
+
---
|
|
32
|
+
compiler-rt/lib/tsan/go/test.c | 4 ++++
|
|
33
|
+
compiler-rt/lib/tsan/rtl/tsan_trace.h | 2 +-
|
|
34
|
+
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
35
|
+
|
|
36
|
+
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
|
|
37
|
+
index d328ab1b331d7..fcd396227a4ab 100644
|
|
38
|
+
--- a/compiler-rt/lib/tsan/go/test.c
|
|
39
|
+
+++ b/compiler-rt/lib/tsan/go/test.c
|
|
40
|
+
@@ -91,6 +91,10 @@ int main(void) {
|
|
41
|
+
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
|
|
42
|
+
void *thr2 = 0;
|
|
43
|
+
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
|
|
44
|
+
+ // Goroutine that exits without a single event.
|
|
45
|
+
+ void *thr3 = 0;
|
|
46
|
+
+ __tsan_go_start(thr0, &thr3, (char*)&barfoo + 1);
|
|
47
|
+
+ __tsan_go_end(thr3);
|
|
48
|
+
__tsan_func_exit(thr0);
|
|
49
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
50
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
51
|
+
diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
52
|
+
index 01bb7b34f43a2..1e791ff765fec 100644
|
|
53
|
+
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
54
|
+
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
55
|
+
@@ -190,7 +190,7 @@ struct Trace {
|
|
56
|
+
Mutex mtx;
|
|
57
|
+
IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
|
|
58
|
+
// First node non-queued into ctx->trace_part_recycle.
|
|
59
|
+
- TracePart* local_head;
|
|
60
|
+
+ TracePart* local_head = nullptr;
|
|
61
|
+
// Final position in the last part for finished threads.
|
|
62
|
+
Event* final_pos = nullptr;
|
|
63
|
+
// Number of trace parts allocated on behalf of this trace specifically.
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
From cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Michael Pratt <michael@prattmic.com>
|
|
3
|
+
Date: Fri, 12 Dec 2025 16:31:44 +1100
|
|
4
|
+
Subject: [PATCH] [TSan] Zero-initialize Trace.local_head
|
|
5
|
+
|
|
6
|
+
Trace.local_head is currently uninitialized when Trace is created. It is
|
|
7
|
+
first initialized when the first event is added to the trace, via the
|
|
8
|
+
first call to TraceSwitchPartImpl.
|
|
9
|
+
|
|
10
|
+
However, ThreadContext::OnFinished uses local_head, assuming that it is
|
|
11
|
+
initialized. If it has not been initialized, we have undefined behavior,
|
|
12
|
+
likely crashing if the contents are garbage. The allocator (Alloc)
|
|
13
|
+
reuses previously allocations, so the contents of the uninitialized
|
|
14
|
+
memory are arbitrary.
|
|
15
|
+
|
|
16
|
+
In a C/C++ TSAN binary it is likely very difficult for a thread to start
|
|
17
|
+
and exit without a single event inbetween. For Go programs, code running
|
|
18
|
+
in the Go runtime itself is not TSan-instrumented, so goroutines that
|
|
19
|
+
exclusively run runtime code (such as GC workers) can quite reasonably
|
|
20
|
+
have no TSan events.
|
|
21
|
+
|
|
22
|
+
The addition of such a goroutine to the Go test.c is sufficient to
|
|
23
|
+
trigger this case, though for reliable failure (segfault) I've found it
|
|
24
|
+
necessary to poison the ThreadContext allocation like so:
|
|
25
|
+
|
|
26
|
+
(Example patch redacted because patch tries to apply this as a real
|
|
27
|
+
patch. See full commit at
|
|
28
|
+
https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca).
|
|
29
|
+
|
|
30
|
+
The fix is trivial: local_head should be zero-initialized.
|
|
31
|
+
---
|
|
32
|
+
compiler-rt/lib/tsan/go/test.c | 4 ++++
|
|
33
|
+
compiler-rt/lib/tsan/rtl/tsan_trace.h | 2 +-
|
|
34
|
+
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
35
|
+
|
|
36
|
+
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
|
|
37
|
+
index d328ab1b331d7..fcd396227a4ab 100644
|
|
38
|
+
--- a/compiler-rt/lib/tsan/go/test.c
|
|
39
|
+
+++ b/compiler-rt/lib/tsan/go/test.c
|
|
40
|
+
@@ -91,6 +91,10 @@ int main(void) {
|
|
41
|
+
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
|
|
42
|
+
void *thr2 = 0;
|
|
43
|
+
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
|
|
44
|
+
+ // Goroutine that exits without a single event.
|
|
45
|
+
+ void *thr3 = 0;
|
|
46
|
+
+ __tsan_go_start(thr0, &thr3, (char*)&barfoo + 1);
|
|
47
|
+
+ __tsan_go_end(thr3);
|
|
48
|
+
__tsan_func_exit(thr0);
|
|
49
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
50
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
51
|
+
diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
52
|
+
index 01bb7b34f43a2..1e791ff765fec 100644
|
|
53
|
+
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
54
|
+
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
55
|
+
@@ -190,7 +190,7 @@ struct Trace {
|
|
56
|
+
Mutex mtx;
|
|
57
|
+
IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
|
|
58
|
+
// First node non-queued into ctx->trace_part_recycle.
|
|
59
|
+
- TracePart* local_head;
|
|
60
|
+
+ TracePart* local_head = nullptr;
|
|
61
|
+
// Final position in the last part for finished threads.
|
|
62
|
+
Event* final_pos = nullptr;
|
|
63
|
+
// Number of trace parts allocated on behalf of this trace specifically.
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
From cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Michael Pratt <michael@prattmic.com>
|
|
3
|
+
Date: Fri, 12 Dec 2025 16:31:44 +1100
|
|
4
|
+
Subject: [PATCH] [TSan] Zero-initialize Trace.local_head
|
|
5
|
+
|
|
6
|
+
Trace.local_head is currently uninitialized when Trace is created. It is
|
|
7
|
+
first initialized when the first event is added to the trace, via the
|
|
8
|
+
first call to TraceSwitchPartImpl.
|
|
9
|
+
|
|
10
|
+
However, ThreadContext::OnFinished uses local_head, assuming that it is
|
|
11
|
+
initialized. If it has not been initialized, we have undefined behavior,
|
|
12
|
+
likely crashing if the contents are garbage. The allocator (Alloc)
|
|
13
|
+
reuses previously allocations, so the contents of the uninitialized
|
|
14
|
+
memory are arbitrary.
|
|
15
|
+
|
|
16
|
+
In a C/C++ TSAN binary it is likely very difficult for a thread to start
|
|
17
|
+
and exit without a single event inbetween. For Go programs, code running
|
|
18
|
+
in the Go runtime itself is not TSan-instrumented, so goroutines that
|
|
19
|
+
exclusively run runtime code (such as GC workers) can quite reasonably
|
|
20
|
+
have no TSan events.
|
|
21
|
+
|
|
22
|
+
The addition of such a goroutine to the Go test.c is sufficient to
|
|
23
|
+
trigger this case, though for reliable failure (segfault) I've found it
|
|
24
|
+
necessary to poison the ThreadContext allocation like so:
|
|
25
|
+
|
|
26
|
+
(Example patch redacted because patch tries to apply this as a real
|
|
27
|
+
patch. See full commit at
|
|
28
|
+
https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca).
|
|
29
|
+
|
|
30
|
+
The fix is trivial: local_head should be zero-initialized.
|
|
31
|
+
---
|
|
32
|
+
compiler-rt/lib/tsan/go/test.c | 4 ++++
|
|
33
|
+
compiler-rt/lib/tsan/rtl/tsan_trace.h | 2 +-
|
|
34
|
+
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
35
|
+
|
|
36
|
+
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
|
|
37
|
+
index d328ab1b331d7..fcd396227a4ab 100644
|
|
38
|
+
--- a/compiler-rt/lib/tsan/go/test.c
|
|
39
|
+
+++ b/compiler-rt/lib/tsan/go/test.c
|
|
40
|
+
@@ -91,6 +91,10 @@ int main(void) {
|
|
41
|
+
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
|
|
42
|
+
void *thr2 = 0;
|
|
43
|
+
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
|
|
44
|
+
+ // Goroutine that exits without a single event.
|
|
45
|
+
+ void *thr3 = 0;
|
|
46
|
+
+ __tsan_go_start(thr0, &thr3, (char*)&barfoo + 1);
|
|
47
|
+
+ __tsan_go_end(thr3);
|
|
48
|
+
__tsan_func_exit(thr0);
|
|
49
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
50
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
51
|
+
diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
52
|
+
index 01bb7b34f43a2..1e791ff765fec 100644
|
|
53
|
+
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
54
|
+
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
55
|
+
@@ -190,7 +190,7 @@ struct Trace {
|
|
56
|
+
Mutex mtx;
|
|
57
|
+
IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
|
|
58
|
+
// First node non-queued into ctx->trace_part_recycle.
|
|
59
|
+
- TracePart* local_head;
|
|
60
|
+
+ TracePart* local_head = nullptr;
|
|
61
|
+
// Final position in the last part for finished threads.
|
|
62
|
+
Event* final_pos = nullptr;
|
|
63
|
+
// Number of trace parts allocated on behalf of this trace specifically.
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
From cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Michael Pratt <michael@prattmic.com>
|
|
3
|
+
Date: Fri, 12 Dec 2025 16:31:44 +1100
|
|
4
|
+
Subject: [PATCH] [TSan] Zero-initialize Trace.local_head
|
|
5
|
+
|
|
6
|
+
Trace.local_head is currently uninitialized when Trace is created. It is
|
|
7
|
+
first initialized when the first event is added to the trace, via the
|
|
8
|
+
first call to TraceSwitchPartImpl.
|
|
9
|
+
|
|
10
|
+
However, ThreadContext::OnFinished uses local_head, assuming that it is
|
|
11
|
+
initialized. If it has not been initialized, we have undefined behavior,
|
|
12
|
+
likely crashing if the contents are garbage. The allocator (Alloc)
|
|
13
|
+
reuses previously allocations, so the contents of the uninitialized
|
|
14
|
+
memory are arbitrary.
|
|
15
|
+
|
|
16
|
+
In a C/C++ TSAN binary it is likely very difficult for a thread to start
|
|
17
|
+
and exit without a single event inbetween. For Go programs, code running
|
|
18
|
+
in the Go runtime itself is not TSan-instrumented, so goroutines that
|
|
19
|
+
exclusively run runtime code (such as GC workers) can quite reasonably
|
|
20
|
+
have no TSan events.
|
|
21
|
+
|
|
22
|
+
The addition of such a goroutine to the Go test.c is sufficient to
|
|
23
|
+
trigger this case, though for reliable failure (segfault) I've found it
|
|
24
|
+
necessary to poison the ThreadContext allocation like so:
|
|
25
|
+
|
|
26
|
+
(Example patch redacted because patch tries to apply this as a real
|
|
27
|
+
patch. See full commit at
|
|
28
|
+
https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca).
|
|
29
|
+
|
|
30
|
+
The fix is trivial: local_head should be zero-initialized.
|
|
31
|
+
---
|
|
32
|
+
compiler-rt/lib/tsan/go/test.c | 4 ++++
|
|
33
|
+
compiler-rt/lib/tsan/rtl/tsan_trace.h | 2 +-
|
|
34
|
+
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
35
|
+
|
|
36
|
+
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
|
|
37
|
+
index d328ab1b331d7..fcd396227a4ab 100644
|
|
38
|
+
--- a/compiler-rt/lib/tsan/go/test.c
|
|
39
|
+
+++ b/compiler-rt/lib/tsan/go/test.c
|
|
40
|
+
@@ -91,6 +91,10 @@ int main(void) {
|
|
41
|
+
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
|
|
42
|
+
void *thr2 = 0;
|
|
43
|
+
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
|
|
44
|
+
+ // Goroutine that exits without a single event.
|
|
45
|
+
+ void *thr3 = 0;
|
|
46
|
+
+ __tsan_go_start(thr0, &thr3, (char*)&barfoo + 1);
|
|
47
|
+
+ __tsan_go_end(thr3);
|
|
48
|
+
__tsan_func_exit(thr0);
|
|
49
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
50
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
51
|
+
diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
52
|
+
index 01bb7b34f43a2..1e791ff765fec 100644
|
|
53
|
+
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
54
|
+
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
55
|
+
@@ -190,7 +190,7 @@ struct Trace {
|
|
56
|
+
Mutex mtx;
|
|
57
|
+
IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
|
|
58
|
+
// First node non-queued into ctx->trace_part_recycle.
|
|
59
|
+
- TracePart* local_head;
|
|
60
|
+
+ TracePart* local_head = nullptr;
|
|
61
|
+
// Final position in the last part for finished threads.
|
|
62
|
+
Event* final_pos = nullptr;
|
|
63
|
+
// Number of trace parts allocated on behalf of this trace specifically.
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
From cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Michael Pratt <michael@prattmic.com>
|
|
3
|
+
Date: Fri, 12 Dec 2025 16:31:44 +1100
|
|
4
|
+
Subject: [PATCH] [TSan] Zero-initialize Trace.local_head
|
|
5
|
+
|
|
6
|
+
Trace.local_head is currently uninitialized when Trace is created. It is
|
|
7
|
+
first initialized when the first event is added to the trace, via the
|
|
8
|
+
first call to TraceSwitchPartImpl.
|
|
9
|
+
|
|
10
|
+
However, ThreadContext::OnFinished uses local_head, assuming that it is
|
|
11
|
+
initialized. If it has not been initialized, we have undefined behavior,
|
|
12
|
+
likely crashing if the contents are garbage. The allocator (Alloc)
|
|
13
|
+
reuses previously allocations, so the contents of the uninitialized
|
|
14
|
+
memory are arbitrary.
|
|
15
|
+
|
|
16
|
+
In a C/C++ TSAN binary it is likely very difficult for a thread to start
|
|
17
|
+
and exit without a single event inbetween. For Go programs, code running
|
|
18
|
+
in the Go runtime itself is not TSan-instrumented, so goroutines that
|
|
19
|
+
exclusively run runtime code (such as GC workers) can quite reasonably
|
|
20
|
+
have no TSan events.
|
|
21
|
+
|
|
22
|
+
The addition of such a goroutine to the Go test.c is sufficient to
|
|
23
|
+
trigger this case, though for reliable failure (segfault) I've found it
|
|
24
|
+
necessary to poison the ThreadContext allocation like so:
|
|
25
|
+
|
|
26
|
+
(Example patch redacted because patch tries to apply this as a real
|
|
27
|
+
patch. See full commit at
|
|
28
|
+
https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca).
|
|
29
|
+
|
|
30
|
+
The fix is trivial: local_head should be zero-initialized.
|
|
31
|
+
---
|
|
32
|
+
compiler-rt/lib/tsan/go/test.c | 4 ++++
|
|
33
|
+
compiler-rt/lib/tsan/rtl/tsan_trace.h | 2 +-
|
|
34
|
+
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
35
|
+
|
|
36
|
+
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
|
|
37
|
+
index d328ab1b331d7..fcd396227a4ab 100644
|
|
38
|
+
--- a/compiler-rt/lib/tsan/go/test.c
|
|
39
|
+
+++ b/compiler-rt/lib/tsan/go/test.c
|
|
40
|
+
@@ -91,6 +91,10 @@ int main(void) {
|
|
41
|
+
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
|
|
42
|
+
void *thr2 = 0;
|
|
43
|
+
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
|
|
44
|
+
+ // Goroutine that exits without a single event.
|
|
45
|
+
+ void *thr3 = 0;
|
|
46
|
+
+ __tsan_go_start(thr0, &thr3, (char*)&barfoo + 1);
|
|
47
|
+
+ __tsan_go_end(thr3);
|
|
48
|
+
__tsan_func_exit(thr0);
|
|
49
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
50
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
51
|
+
diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
52
|
+
index 01bb7b34f43a2..1e791ff765fec 100644
|
|
53
|
+
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
54
|
+
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
55
|
+
@@ -190,7 +190,7 @@ struct Trace {
|
|
56
|
+
Mutex mtx;
|
|
57
|
+
IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
|
|
58
|
+
// First node non-queued into ctx->trace_part_recycle.
|
|
59
|
+
- TracePart* local_head;
|
|
60
|
+
+ TracePart* local_head = nullptr;
|
|
61
|
+
// Final position in the last part for finished threads.
|
|
62
|
+
Event* final_pos = nullptr;
|
|
63
|
+
// Number of trace parts allocated on behalf of this trace specifically.
|
|
Binary file
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
From cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca Mon Sep 17 00:00:00 2001
|
|
2
|
+
From: Michael Pratt <michael@prattmic.com>
|
|
3
|
+
Date: Fri, 12 Dec 2025 16:31:44 +1100
|
|
4
|
+
Subject: [PATCH] [TSan] Zero-initialize Trace.local_head
|
|
5
|
+
|
|
6
|
+
Trace.local_head is currently uninitialized when Trace is created. It is
|
|
7
|
+
first initialized when the first event is added to the trace, via the
|
|
8
|
+
first call to TraceSwitchPartImpl.
|
|
9
|
+
|
|
10
|
+
However, ThreadContext::OnFinished uses local_head, assuming that it is
|
|
11
|
+
initialized. If it has not been initialized, we have undefined behavior,
|
|
12
|
+
likely crashing if the contents are garbage. The allocator (Alloc)
|
|
13
|
+
reuses previously allocations, so the contents of the uninitialized
|
|
14
|
+
memory are arbitrary.
|
|
15
|
+
|
|
16
|
+
In a C/C++ TSAN binary it is likely very difficult for a thread to start
|
|
17
|
+
and exit without a single event inbetween. For Go programs, code running
|
|
18
|
+
in the Go runtime itself is not TSan-instrumented, so goroutines that
|
|
19
|
+
exclusively run runtime code (such as GC workers) can quite reasonably
|
|
20
|
+
have no TSan events.
|
|
21
|
+
|
|
22
|
+
The addition of such a goroutine to the Go test.c is sufficient to
|
|
23
|
+
trigger this case, though for reliable failure (segfault) I've found it
|
|
24
|
+
necessary to poison the ThreadContext allocation like so:
|
|
25
|
+
|
|
26
|
+
(Example patch redacted because patch tries to apply this as a real
|
|
27
|
+
patch. See full commit at
|
|
28
|
+
https://github.com/llvm/llvm-project/commit/cdfdb06c9155080ec97d6e4f4dd90b6e7cefb0ca).
|
|
29
|
+
|
|
30
|
+
The fix is trivial: local_head should be zero-initialized.
|
|
31
|
+
---
|
|
32
|
+
compiler-rt/lib/tsan/go/test.c | 4 ++++
|
|
33
|
+
compiler-rt/lib/tsan/rtl/tsan_trace.h | 2 +-
|
|
34
|
+
2 files changed, 5 insertions(+), 1 deletion(-)
|
|
35
|
+
|
|
36
|
+
diff --git a/compiler-rt/lib/tsan/go/test.c b/compiler-rt/lib/tsan/go/test.c
|
|
37
|
+
index d328ab1b331d7..fcd396227a4ab 100644
|
|
38
|
+
--- a/compiler-rt/lib/tsan/go/test.c
|
|
39
|
+
+++ b/compiler-rt/lib/tsan/go/test.c
|
|
40
|
+
@@ -91,6 +91,10 @@ int main(void) {
|
|
41
|
+
__tsan_go_start(thr0, &thr1, (char*)&barfoo + 1);
|
|
42
|
+
void *thr2 = 0;
|
|
43
|
+
__tsan_go_start(thr0, &thr2, (char*)&barfoo + 1);
|
|
44
|
+
+ // Goroutine that exits without a single event.
|
|
45
|
+
+ void *thr3 = 0;
|
|
46
|
+
+ __tsan_go_start(thr0, &thr3, (char*)&barfoo + 1);
|
|
47
|
+
+ __tsan_go_end(thr3);
|
|
48
|
+
__tsan_func_exit(thr0);
|
|
49
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
50
|
+
__tsan_func_enter(thr1, (char*)&foobar + 1);
|
|
51
|
+
diff --git a/compiler-rt/lib/tsan/rtl/tsan_trace.h b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
52
|
+
index 01bb7b34f43a2..1e791ff765fec 100644
|
|
53
|
+
--- a/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
54
|
+
+++ b/compiler-rt/lib/tsan/rtl/tsan_trace.h
|
|
55
|
+
@@ -190,7 +190,7 @@ struct Trace {
|
|
56
|
+
Mutex mtx;
|
|
57
|
+
IList<TraceHeader, &TraceHeader::trace_parts, TracePart> parts;
|
|
58
|
+
// First node non-queued into ctx->trace_part_recycle.
|
|
59
|
+
- TracePart* local_head;
|
|
60
|
+
+ TracePart* local_head = nullptr;
|
|
61
|
+
// Final position in the last part for finished threads.
|
|
62
|
+
Event* final_pos = nullptr;
|
|
63
|
+
// Number of trace parts allocated on behalf of this trace specifically.
|
|
Binary file
|
|
@@ -1375,7 +1375,11 @@ func LoadCreateSymbolicLink() error {
|
|
|
1375
1375
|
|
|
1376
1376
|
// Readlink returns the destination of the named symbolic link.
|
|
1377
1377
|
func Readlink(path string, buf []byte) (n int, err error) {
|
|
1378
|
-
|
|
1378
|
+
pathp, err := UTF16PtrFromString(path)
|
|
1379
|
+
if err != nil {
|
|
1380
|
+
return -1, err
|
|
1381
|
+
}
|
|
1382
|
+
fd, err := CreateFile(pathp, GENERIC_READ, 0, nil, OPEN_EXISTING,
|
|
1379
1383
|
FILE_FLAG_OPEN_REPARSE_POINT|FILE_FLAG_BACKUP_SEMANTICS, 0)
|
|
1380
1384
|
if err != nil {
|
|
1381
1385
|
return -1, err
|
|
@@ -6,7 +6,7 @@ golang.org/x/crypto/cryptobyte
|
|
|
6
6
|
golang.org/x/crypto/cryptobyte/asn1
|
|
7
7
|
golang.org/x/crypto/internal/alias
|
|
8
8
|
golang.org/x/crypto/internal/poly1305
|
|
9
|
-
# golang.org/x/net v0.47.1-0.
|
|
9
|
+
# golang.org/x/net v0.47.1-0.20260417193450-705de46f8788
|
|
10
10
|
## explicit; go 1.24.0
|
|
11
11
|
golang.org/x/net/dns/dnsmessage
|
|
12
12
|
golang.org/x/net/http/httpguts
|
package/bin/ttsc
CHANGED
|
Binary file
|
package/bin/ttscserver
CHANGED
|
Binary file
|