@ttsc/darwin-arm64 0.7.2 → 0.8.0-dev.20260505
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/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/x509/constraints.go +33 -33
- package/bin/go/src/crypto/x509/verify.go +28 -13
- 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/state_string.go +5 -3
- package/bin/go/src/html/template/transition.go +41 -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/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/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/http/doc.go +0 -1
- 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 +21 -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/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_mips64x.go +1 -1
- package/bin/go/src/runtime/defs_linux_mipsx.go +1 -1
- package/bin/go/src/runtime/metrics/doc.go +5 -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/ttsc +0 -0
- package/package.json +1 -1
|
@@ -62,6 +62,8 @@ var (
|
|
|
62
62
|
procOpenThreadToken = modadvapi32.NewProc("OpenThreadToken")
|
|
63
63
|
procQueryServiceStatus = modadvapi32.NewProc("QueryServiceStatus")
|
|
64
64
|
procRevertToSelf = modadvapi32.NewProc("RevertToSelf")
|
|
65
|
+
procSetEntriesInAclW = modadvapi32.NewProc("SetEntriesInAclW")
|
|
66
|
+
procSetNamedSecurityInfoW = modadvapi32.NewProc("SetNamedSecurityInfoW")
|
|
65
67
|
procSetTokenInformation = modadvapi32.NewProc("SetTokenInformation")
|
|
66
68
|
procProcessPrng = modbcryptprimitives.NewProc("ProcessPrng")
|
|
67
69
|
procGetAdaptersAddresses = modiphlpapi.NewProc("GetAdaptersAddresses")
|
|
@@ -236,6 +238,31 @@ func RevertToSelf() (err error) {
|
|
|
236
238
|
return
|
|
237
239
|
}
|
|
238
240
|
|
|
241
|
+
func SetEntriesInAcl(countExplicitEntries uint32, explicitEntries *EXPLICIT_ACCESS, oldACL *ACL, newACL **ACL) (ret error) {
|
|
242
|
+
r0, _, _ := syscall.SyscallN(procSetEntriesInAclW.Addr(), uintptr(countExplicitEntries), uintptr(unsafe.Pointer(explicitEntries)), uintptr(unsafe.Pointer(oldACL)), uintptr(unsafe.Pointer(newACL)))
|
|
243
|
+
if r0 != 0 {
|
|
244
|
+
ret = syscall.Errno(r0)
|
|
245
|
+
}
|
|
246
|
+
return
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
func SetNamedSecurityInfo(objectName string, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) {
|
|
250
|
+
var _p0 *uint16
|
|
251
|
+
_p0, ret = syscall.UTF16PtrFromString(objectName)
|
|
252
|
+
if ret != nil {
|
|
253
|
+
return
|
|
254
|
+
}
|
|
255
|
+
return _SetNamedSecurityInfo(_p0, objectType, securityInformation, owner, group, dacl, sacl)
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
func _SetNamedSecurityInfo(objectName *uint16, objectType uint32, securityInformation uint32, owner *syscall.SID, group *syscall.SID, dacl *ACL, sacl *ACL) (ret error) {
|
|
259
|
+
r0, _, _ := syscall.SyscallN(procSetNamedSecurityInfoW.Addr(), uintptr(unsafe.Pointer(objectName)), uintptr(objectType), uintptr(securityInformation), uintptr(unsafe.Pointer(owner)), uintptr(unsafe.Pointer(group)), uintptr(unsafe.Pointer(dacl)), uintptr(unsafe.Pointer(sacl)))
|
|
260
|
+
if r0 != 0 {
|
|
261
|
+
ret = syscall.Errno(r0)
|
|
262
|
+
}
|
|
263
|
+
return
|
|
264
|
+
}
|
|
265
|
+
|
|
239
266
|
func SetTokenInformation(tokenHandle syscall.Token, tokenInformationClass uint32, tokenInformation unsafe.Pointer, tokenInformationLength uint32) (err error) {
|
|
240
267
|
r1, _, e1 := syscall.SyscallN(procSetTokenInformation.Addr(), uintptr(tokenHandle), uintptr(tokenInformationClass), uintptr(tokenInformation), uintptr(tokenInformationLength))
|
|
241
268
|
if r1 == 0 {
|
|
@@ -12,5 +12,8 @@ import "internal/syscall/windows"
|
|
|
12
12
|
// https://learn.microsoft.com/en-us/windows/win32/api/mswsock/nf-mswsock-transmitfile
|
|
13
13
|
// https://golang.org/issue/73746
|
|
14
14
|
func supportsSendfile() bool {
|
|
15
|
+
if testHookSupportsSendfile != nil {
|
|
16
|
+
return testHookSupportsSendfile()
|
|
17
|
+
}
|
|
15
18
|
return windows.SupportUnlimitedTransmitFile()
|
|
16
19
|
}
|
|
@@ -2,14 +2,13 @@
|
|
|
2
2
|
// Use of this source code is governed by a BSD-style
|
|
3
3
|
// license that can be found in the LICENSE file.
|
|
4
4
|
|
|
5
|
+
//go:generate go run gen_encoding_table.go
|
|
6
|
+
|
|
5
7
|
// Package url parses URLs and implements query escaping.
|
|
6
8
|
//
|
|
7
9
|
// See RFC 3986. This package generally follows RFC 3986, except where
|
|
8
10
|
// it deviates for compatibility reasons.
|
|
9
11
|
// RFC 6874 followed for IPv6 zone literals.
|
|
10
|
-
|
|
11
|
-
//go:generate go run gen_encoding_table.go
|
|
12
|
-
|
|
13
12
|
package url
|
|
14
13
|
|
|
15
14
|
// When sending changes, first search old issues for history on decisions.
|
|
@@ -547,7 +546,9 @@ func parseAuthority(scheme, authority string) (user *Userinfo, host string, err
|
|
|
547
546
|
// parseHost parses host as an authority without user
|
|
548
547
|
// information. That is, as host[:port].
|
|
549
548
|
func parseHost(scheme, host string) (string, error) {
|
|
550
|
-
if openBracketIdx := strings.LastIndex(host, "["); openBracketIdx
|
|
549
|
+
if openBracketIdx := strings.LastIndex(host, "["); openBracketIdx > 0 {
|
|
550
|
+
return "", errors.New("invalid IP-literal")
|
|
551
|
+
} else if openBracketIdx == 0 {
|
|
551
552
|
// Parse an IP-Literal in RFC 3986 and RFC 6874.
|
|
552
553
|
// E.g., "[fe80::1]", "[fe80::1%25en0]", "[fe80::1]:80".
|
|
553
554
|
closeBracketIdx := strings.LastIndex(host, "]")
|
|
@@ -605,18 +606,22 @@ func parseHost(scheme, host string) (string, error) {
|
|
|
605
606
|
} else if i := strings.Index(host, ":"); i != -1 {
|
|
606
607
|
lastColon := strings.LastIndex(host, ":")
|
|
607
608
|
if lastColon != i {
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
urlstrictcolons.
|
|
609
|
+
// RFC 3986 does not allow colons to appear in the host subcomponent.
|
|
610
|
+
//
|
|
611
|
+
// However, a number of databases including PostgreSQL and MongoDB
|
|
612
|
+
// permit a comma-separated list of hosts (with optional ports) in the
|
|
613
|
+
// host subcomponent.
|
|
614
|
+
//
|
|
615
|
+
// Since we historically permitted colons to appear in the host,
|
|
616
|
+
// enforce strict colons only for http and https URLs.
|
|
617
|
+
//
|
|
618
|
+
// See https://go.dev/issue/75223 and https://go.dev/issue/78077.
|
|
619
|
+
if scheme == "http" || scheme == "https" {
|
|
620
|
+
if urlstrictcolons.Value() == "0" {
|
|
621
|
+
urlstrictcolons.IncNonDefault()
|
|
622
|
+
i = lastColon
|
|
623
|
+
}
|
|
624
|
+
} else {
|
|
620
625
|
i = lastColon
|
|
621
626
|
}
|
|
622
627
|
}
|
|
@@ -88,7 +88,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
88
88
|
if mode == readdirName {
|
|
89
89
|
names = append(names, string(name))
|
|
90
90
|
} else if mode == readdirDirEntry {
|
|
91
|
-
de, err := newUnixDirent(f
|
|
91
|
+
de, err := newUnixDirent(f, string(name), dtToType(dirent.Type))
|
|
92
92
|
if IsNotExist(err) {
|
|
93
93
|
// File disappeared between readdir and stat.
|
|
94
94
|
// Treat as if it didn't exist.
|
|
@@ -99,7 +99,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
99
99
|
}
|
|
100
100
|
dirents = append(dirents, de)
|
|
101
101
|
} else {
|
|
102
|
-
info, err :=
|
|
102
|
+
info, err := f.lstatat(string(name))
|
|
103
103
|
if IsNotExist(err) {
|
|
104
104
|
// File disappeared between readdir + stat.
|
|
105
105
|
// Treat as if it didn't exist.
|
|
@@ -138,7 +138,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
138
138
|
if mode == readdirName {
|
|
139
139
|
names = append(names, string(name))
|
|
140
140
|
} else if mode == readdirDirEntry {
|
|
141
|
-
de, err := newUnixDirent(f
|
|
141
|
+
de, err := newUnixDirent(f, string(name), direntType(rec))
|
|
142
142
|
if IsNotExist(err) {
|
|
143
143
|
// File disappeared between readdir and stat.
|
|
144
144
|
// Treat as if it didn't exist.
|
|
@@ -149,7 +149,7 @@ func (f *File) readdir(n int, mode readdirMode) (names []string, dirents []DirEn
|
|
|
149
149
|
}
|
|
150
150
|
dirents = append(dirents, de)
|
|
151
151
|
} else {
|
|
152
|
-
info, err :=
|
|
152
|
+
info, err := f.lstatat(string(name))
|
|
153
153
|
if IsNotExist(err) {
|
|
154
154
|
// File disappeared between readdir + stat.
|
|
155
155
|
// Treat as if it didn't exist.
|
package/bin/go/src/os/file.go
CHANGED
|
@@ -428,9 +428,6 @@ func openDir(name string) (*File, error) {
|
|
|
428
428
|
return openDirNolog(name)
|
|
429
429
|
}
|
|
430
430
|
|
|
431
|
-
// lstat is overridden in tests.
|
|
432
|
-
var lstat = Lstat
|
|
433
|
-
|
|
434
431
|
// Rename renames (moves) oldpath to newpath.
|
|
435
432
|
// If newpath already exists and is not a directory, Rename replaces it.
|
|
436
433
|
// If newpath already exists and is a directory, Rename returns an error.
|
|
@@ -63,6 +63,7 @@ type file struct {
|
|
|
63
63
|
nonblock bool // whether we set nonblocking mode
|
|
64
64
|
stdoutOrErr bool // whether this is stdout or stderr
|
|
65
65
|
appendMode bool // whether file is opened for appending
|
|
66
|
+
inRoot bool // whether file is opened in a Root
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
// fd is the Unix implementation of Fd.
|
|
@@ -458,24 +459,27 @@ func (d *unixDirent) Info() (FileInfo, error) {
|
|
|
458
459
|
if d.info != nil {
|
|
459
460
|
return d.info, nil
|
|
460
461
|
}
|
|
461
|
-
return
|
|
462
|
+
return Lstat(d.parent + "/" + d.name)
|
|
462
463
|
}
|
|
463
464
|
|
|
464
465
|
func (d *unixDirent) String() string {
|
|
465
466
|
return fs.FormatDirEntry(d)
|
|
466
467
|
}
|
|
467
468
|
|
|
468
|
-
func newUnixDirent(parent, name string, typ FileMode) (DirEntry, error) {
|
|
469
|
+
func newUnixDirent(parent *File, name string, typ FileMode) (DirEntry, error) {
|
|
469
470
|
ude := &unixDirent{
|
|
470
|
-
parent: parent,
|
|
471
|
+
parent: parent.name,
|
|
471
472
|
name: name,
|
|
472
473
|
typ: typ,
|
|
473
474
|
}
|
|
474
|
-
|
|
475
|
+
// When the parent file was opened in a Root,
|
|
476
|
+
// we cannot use a lazy lstat to load the FileInfo.
|
|
477
|
+
// Use lstatat here.
|
|
478
|
+
if typ != ^FileMode(0) && !parent.inRoot {
|
|
475
479
|
return ude, nil
|
|
476
480
|
}
|
|
477
481
|
|
|
478
|
-
info, err :=
|
|
482
|
+
info, err := parent.lstatat(name)
|
|
479
483
|
if err != nil {
|
|
480
484
|
return nil, err
|
|
481
485
|
}
|
|
@@ -104,6 +104,7 @@ func rootOpenFileNolog(root *Root, name string, flag int, perm FileMode) (*File,
|
|
|
104
104
|
return nil, &PathError{Op: "openat", Path: name, Err: err}
|
|
105
105
|
}
|
|
106
106
|
f := newFile(fd, joinPath(root.Name(), name), kindOpenFile, unix.HasNonblockFlag(flag))
|
|
107
|
+
f.inRoot = true
|
|
107
108
|
return f, nil
|
|
108
109
|
}
|
|
109
110
|
|
package/bin/go/src/os/stat.go
CHANGED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// Copyright 2026 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build !windows
|
|
6
|
+
|
|
7
|
+
package os
|
|
8
|
+
|
|
9
|
+
import (
|
|
10
|
+
"internal/testlog"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func (f *File) lstatat(name string) (FileInfo, error) {
|
|
14
|
+
if stathook != nil {
|
|
15
|
+
fi, err := stathook(f, name)
|
|
16
|
+
if fi != nil || err != nil {
|
|
17
|
+
return fi, err
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if log := testlog.Logger(); log != nil {
|
|
21
|
+
log.Stat(joinPath(f.Name(), name))
|
|
22
|
+
}
|
|
23
|
+
return f.lstatatNolog(name)
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// Copyright 2026 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build (js && wasm) || plan9
|
|
6
|
+
|
|
7
|
+
package os
|
|
8
|
+
|
|
9
|
+
func (f *File) lstatatNolog(name string) (FileInfo, error) {
|
|
10
|
+
// These platforms don't have fstatat, so use stat instead.
|
|
11
|
+
return Lstat(f.name + "/" + name)
|
|
12
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// Copyright 2026 The Go Authors. All rights reserved.
|
|
2
|
+
// Use of this source code is governed by a BSD-style
|
|
3
|
+
// license that can be found in the LICENSE file.
|
|
4
|
+
|
|
5
|
+
//go:build aix || darwin || dragonfly || freebsd || wasip1 || linux || netbsd || openbsd || solaris
|
|
6
|
+
|
|
7
|
+
package os
|
|
8
|
+
|
|
9
|
+
import (
|
|
10
|
+
"internal/syscall/unix"
|
|
11
|
+
)
|
|
12
|
+
|
|
13
|
+
func (f *File) lstatatNolog(name string) (FileInfo, error) {
|
|
14
|
+
var fs fileStat
|
|
15
|
+
if err := f.pfd.Fstatat(name, &fs.sys, unix.AT_SYMLINK_NOFOLLOW); err != nil {
|
|
16
|
+
return nil, f.wrapErr("fstatat", err)
|
|
17
|
+
}
|
|
18
|
+
fillFileStatFromSys(&fs, name)
|
|
19
|
+
return &fs, nil
|
|
20
|
+
}
|
|
@@ -1288,9 +1288,10 @@ func (v Value) Field(i int) Value {
|
|
|
1288
1288
|
// bunch of zero-sized fields. We must return the zero-sized
|
|
1289
1289
|
// fields indirectly, as only ptr-shaped things can be direct.
|
|
1290
1290
|
// See issue 74935.
|
|
1291
|
-
// We use
|
|
1291
|
+
// We use &zeroVal[0] instead of v.ptr as it doesn't matter and
|
|
1292
1292
|
// we can avoid pinning a possibly now-unused object.
|
|
1293
|
-
|
|
1293
|
+
// Don't use nil, see issue 77779.
|
|
1294
|
+
return Value{typ, unsafe.Pointer(&zeroVal[0]), fl | flagIndir}
|
|
1294
1295
|
}
|
|
1295
1296
|
|
|
1296
1297
|
// Either flagIndir is set and v.ptr points at struct,
|
|
@@ -306,6 +306,11 @@ Below is the full list of supported metrics, ordered lexicographically.
|
|
|
306
306
|
The number of non-default behaviors executed by the go/types
|
|
307
307
|
package due to a non-default GODEBUG=gotypesalias=... setting.
|
|
308
308
|
|
|
309
|
+
/godebug/non-default-behavior/htmlmetacontenturlescape:events
|
|
310
|
+
The number of non-default behaviors executed by
|
|
311
|
+
the html/template package due to a non-default
|
|
312
|
+
GODEBUG=htmlmetacontenturlescape=... setting.
|
|
313
|
+
|
|
309
314
|
/godebug/non-default-behavior/http2client:events
|
|
310
315
|
The number of non-default behaviors executed by the net/http
|
|
311
316
|
package due to a non-default GODEBUG=http2client=... setting.
|
|
@@ -122,23 +122,35 @@ func printbool(v bool) {
|
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
|
|
125
|
+
// float64 requires 1+17+1+1+1+3 = 24 bytes max (sign+digits+decimal point+e+sign+exponent digits).
|
|
126
|
+
const float64Bytes = 24
|
|
127
|
+
|
|
125
128
|
func printfloat64(v float64) {
|
|
126
|
-
var buf [
|
|
129
|
+
var buf [float64Bytes]byte
|
|
127
130
|
gwrite(strconv.AppendFloat(buf[:0], v, 'g', -1, 64))
|
|
128
131
|
}
|
|
129
132
|
|
|
133
|
+
// float32 requires 1+9+1+1+1+2 = 15 bytes max (sign+digits+decimal point+e+sign+exponent digits).
|
|
134
|
+
const float32Bytes = 15
|
|
135
|
+
|
|
130
136
|
func printfloat32(v float32) {
|
|
131
|
-
var buf [
|
|
137
|
+
var buf [float32Bytes]byte
|
|
132
138
|
gwrite(strconv.AppendFloat(buf[:0], float64(v), 'g', -1, 32))
|
|
133
139
|
}
|
|
134
140
|
|
|
141
|
+
// complex128 requires 24+24+1+1+1 = 51 bytes max (paren+float64+float64+i+paren).
|
|
142
|
+
const complex128Bytes = 2*float64Bytes + 3
|
|
143
|
+
|
|
135
144
|
func printcomplex128(c complex128) {
|
|
136
|
-
var buf [
|
|
145
|
+
var buf [complex128Bytes]byte
|
|
137
146
|
gwrite(strconv.AppendComplex(buf[:0], c, 'g', -1, 128))
|
|
138
147
|
}
|
|
139
148
|
|
|
149
|
+
// complex64 requires 15+15+1+1+1 = 33 bytes max (paren+float32+float32+i+paren).
|
|
150
|
+
const complex64Bytes = 2*float32Bytes + 3
|
|
151
|
+
|
|
140
152
|
func printcomplex64(c complex64) {
|
|
141
|
-
var buf [
|
|
153
|
+
var buf [complex64Bytes]byte
|
|
142
154
|
gwrite(strconv.AppendComplex(buf[:0], complex128(c), 'g', -1, 64))
|
|
143
155
|
}
|
|
144
156
|
|
|
@@ -4,16 +4,16 @@ the LLVM project (https://github.com/llvm/llvm-project/tree/main/compiler-rt).
|
|
|
4
4
|
|
|
5
5
|
To update the .syso files use golang.org/x/build/cmd/racebuild.
|
|
6
6
|
|
|
7
|
-
internal/amd64v1/race_darwin.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
8
|
-
internal/amd64v1/race_freebsd.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
9
|
-
internal/amd64v1/race_linux.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
7
|
+
internal/amd64v1/race_darwin.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch internal/amd64v1/race_darwin.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
8
|
+
internal/amd64v1/race_freebsd.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch internal/amd64v1/race_freebsd.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
9
|
+
internal/amd64v1/race_linux.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch internal/amd64v1/race_linux.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
10
10
|
internal/amd64v1/race_netbsd.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
|
|
11
11
|
internal/amd64v1/race_openbsd.syso built with LLVM fcf6ae2f070eba73074b6ec8d8281e54d29dbeeb and Go 8f2db14cd35bbd674cb2988a508306de6655e425.
|
|
12
|
-
internal/amd64v1/race_windows.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
13
|
-
internal/amd64v3/race_linux.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
14
|
-
race_darwin_arm64.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
15
|
-
race_linux_arm64.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
16
|
-
race_linux_loong64.syso built with LLVM 83fe85115da9dc25fa270d2ea8140113c8d49670 and Go
|
|
12
|
+
internal/amd64v1/race_windows.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch internal/amd64v1/race_windows.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
13
|
+
internal/amd64v3/race_linux.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch internal/amd64v3/race_linux.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
14
|
+
race_darwin_arm64.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch race_darwin_arm64.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
15
|
+
race_linux_arm64.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch race_linux_arm64.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
16
|
+
race_linux_loong64.syso built with LLVM 83fe85115da9dc25fa270d2ea8140113c8d49670 with patch race_linux_loong64.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
17
17
|
race_linux_ppc64le.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go e7d582b55dda36e76ce4d0ce770139ca0915b7c5.
|
|
18
18
|
race_linux_riscv64.syso built with LLVM c3c24be13f7928460ca1e2fe613a1146c868854e and Go a21249436b6e1fd47356361d53dc053bbc074f90.
|
|
19
|
-
race_linux_s390x.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 and Go
|
|
19
|
+
race_linux_s390x.syso built with LLVM 51bfeff0e4b0757ff773da6882f4d538996c9b04 with patch race_linux_s390x.patch and Go a61fd428974822a8c57a2b2840fc237e6711b24d.
|
|
@@ -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
|