Skip to content

[pull] master from golang:master#44

Merged
pull[bot] merged 8 commits into
trailofbits:masterfrom
golang:master
May 20, 2026
Merged

[pull] master from golang:master#44
pull[bot] merged 8 commits into
trailofbits:masterfrom
golang:master

Conversation

@pull
Copy link
Copy Markdown

@pull pull Bot commented May 20, 2026

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

abner-chenc and others added 8 commits May 19, 2026 17:43
Go asm syntax:
        FRINTF	FJ, FD
        FRINTD	FJ, FD

Equivalent platform assembler syntax:
	frint.s	fd, fd
	frint.d	fd, fd

Change-Id: If26c1c26764ac1be6fc7e706a65e1dbbda094805
Reviewed-on: https://go-review.googlesource.com/c/go/+/771020
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
This change follows from CL 765581 and CL 768780.
As expected, the program panics when an unpinned pointed is passed from Go to C.
The stack trace showing an autogenerated frame by the linker.

    # cat -n main.c
         1  #include <stdio.h>
         2  #include "parse.h"
         3
         4  int main(void) {
         5          GoMap m = GoFoo();
         6          (void)m;
         7          return 0;
         8  }

    # cat -n callbackErr.go
         1  package main
         2
         3  import (
         4          "C"
         5  )
         6
         7  //export GoFoo
         8  func GoFoo() map[int]int {
         9          return map[int]int{0: 1,}
        10  }
        11
        12  func main() {
        13  }

    # go build -buildmode=c-shared -o callbackErr.so callbackErr.go
    # gcc -o main main.c callbackErr.so -Wl,-rpath,'$ORIGIN'
    # ./main
    [...]
    goroutine 17 [running, locked to thread]:
    panic({0x7ffff3811460?, 0x3bbf919e000?})
    	/usr/lib/go-1.26/src/runtime/panic.go:879 +0x160
    runtime.cgoCheckArg(0x7ffff38126e0, 0x3bbf9192000, 0x0?, 0x0, 0x1)
    	/usr/lib/go-1.26/src/runtime/cgocall.go:659 +0x4c4
    runtime.cgoCheckResult({0x7ffff38126e0, 0x3bbf9192000})
    	/usr/lib/go-1.26/src/runtime/cgocall.go:829 +0x50
    _cgoexp_f011903c6073_GoFoo(0x7ffffb8059e8)
    	/home/chenguoqi/temp/callbackErr.go:8 +0x80
    runtime.cgocallbackg1(0x7ffff376e570, 0x7ffffb8059e8, 0x0)
    	/usr/lib/go-1.26/src/runtime/cgocall.go:466 +0x29c
    runtime.cgocallbackg(0x7ffff376e570, 0x7ffffb8059e8, 0x0)
    	/usr/lib/go-1.26/src/runtime/cgocall.go:362 +0x108
    runtime.cgocallbackg(0x7ffff376e570, 0x7ffffb8059e8, 0x0)
    	<autogenerated>:1 +0x1c
    runtime.cgocallback(0x0, 0x0, 0x0)
    	/usr/lib/go-1.26/src/runtime/asm_loong64.s:662 +0x9c
    runtime.goexit({})
    	/usr/lib/go-1.26/src/runtime/asm_loong64.s:752 +0x4
    Aborted                    ./main

Load the cgocallbackg arguments into the registers expected by ABIInternal.
    [...]
    goroutine 17 [running, locked to thread]:
    panic({0x7ffff0356d78?, 0x5eae29a9e000?})
    	/home/chenguoqi/golang/go-upstream/src/runtime/panic.go:878 +0x160
    runtime.cgoCheckArg(0x7ffff0351598, 0x5eae29a92000, 0x0?, 0x0, 0x1)
    	/home/chenguoqi/golang/go-upstream/src/runtime/cgocall.go:667 +0x4a4
    runtime.cgoCheckResult({0x7ffff0351598, 0x5eae29a92000})
    	/home/chenguoqi/golang/go-upstream/src/runtime/cgocall.go:837 +0x50
    _cgoexp_f011903c6073_GoFoo(0x7ffffb817928)
    	/home/chenguoqi/temp/callbackErr.go:8 +0x80
    runtime.cgocallbackg1(0x7ffff02ae500, 0x7ffffb817928, 0x0)
    	/home/chenguoqi/golang/go-upstream/src/runtime/cgocall.go:474 +0x2b0
    runtime.cgocallbackg(0x7ffff02ae500, 0x7ffffb817928, 0x0)
    	/home/chenguoqi/golang/go-upstream/src/runtime/cgocall.go:362 +0x104
    runtime.cgocallback(0x0, 0x0, 0x0)
    	/home/chenguoqi/golang/go-upstream/src/runtime/asm_loong64.s:667 +0x94
    runtime.goexit({})
    	/home/chenguoqi/golang/go-upstream/src/runtime/asm_loong64.s:747 +0x4
    Aborted                    ./main

Change-Id: I8d5693fa582f8692b8f9cb022b82917943eaf30e
Reviewed-on: https://go-review.googlesource.com/c/go/+/779740
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Meidan Li <limeidan@loongson.cn>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Change-Id: I44a74a75d89abbf8f59fe6bfc21471e56a6a6964
Reviewed-on: https://go-review.googlesource.com/c/go/+/780000
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: David Chase <drchase@google.com>
Note: types2 either deosn't have these tests or is already using
      a short form.

Change-Id: I729282e9ff574010490604814134756df5824f4b
Reviewed-on: https://go-review.googlesource.com/c/go/+/780100
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: David Chase <drchase@google.com>
… test

Change-Id: I4d3377e704d718a1914135a444b9df59f84af179
Reviewed-on: https://go-review.googlesource.com/c/go/+/780120
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Fixes #77639

Change-Id: I90e5d6f68c02749ac6e407f1c3565312efafb033
Reviewed-on: https://go-review.googlesource.com/c/go/+/779860
Reviewed-by: David Chase <drchase@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Damien Neil <dneil@google.com>
Reviewed-by: Florian Lehner <lehner.florian86@gmail.com>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Change-Id: Ia5be3eea95583ed2b32f568f7689d414205c5d21
Reviewed-on: https://go-review.googlesource.com/c/go/+/780101
Reviewed-by: Robert Griesemer <gri@google.com>
Auto-Submit: Robert Griesemer <gri@google.com>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
…ction

Go asm syntax:
	LLACQW	(RJ), RD
	LLACQV	(RJ), RD
	SCRELW	RD, (RJ)
	SCRELV	RD, (RJ)
	SCQ	RD, RK, (RJ)

Equivalent platform assembler syntax:
	ll.acq.w	rd, rj
	ll.acq.d	rd, rj
	sc.rel.w	rd, rj
	sc.rel.d	rd, rj
	sc.q		rd, rk, rj

To ensure semantic consistency of instruction suffixes, equivalent
instructions LLW and SCW for LL and SC have been added.

Change-Id: I01a13e76c5b00c14e8774de51bf0680ab76a46e3
Reviewed-on: https://go-review.googlesource.com/c/go/+/768900
Reviewed-by: Meidan Li <limeidan@loongson.cn>
LUCI-TryBot-Result: golang-scoped@luci-project-accounts.iam.gserviceaccount.com <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Keith Randall <khr@google.com>
@pull pull Bot locked and limited conversation to collaborators May 20, 2026
@pull pull Bot added the ⤵️ pull label May 20, 2026
@pull pull Bot merged commit 4df1ac7 into trailofbits:master May 20, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants