[pull] master from golang:master#44
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 : )