import golang-1.17.5-1.module+el8.6.0+13638+4e1d6997
This commit is contained in:
parent
0dbc79bca1
commit
95c9ceaff1
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/go-go-1.17.2-1-openssl-fips.tar.gz
|
||||
SOURCES/go-go-1.17.5-1-openssl-fips.tar.gz
|
||||
|
@ -1 +1 @@
|
||||
583ddd5dc54fa694c25b6768ad80c9fff04d2bb5 SOURCES/go-go-1.17.2-1-openssl-fips.tar.gz
|
||||
f0b72c96855f50d91288f1226a7660b97c1fdd73 SOURCES/go-go-1.17.5-1-openssl-fips.tar.gz
|
||||
|
151
SOURCES/remove_waitgroup_misuse_tests.patch
Normal file
151
SOURCES/remove_waitgroup_misuse_tests.patch
Normal file
@ -0,0 +1,151 @@
|
||||
diff --git a/src/sync/waitgroup_test.go b/src/sync/waitgroup_test.go
|
||||
index c569e0faa2eb..4ded218d2d8d 100644
|
||||
--- a/src/sync/waitgroup_test.go
|
||||
+++ b/src/sync/waitgroup_test.go
|
||||
@@ -5,8 +5,6 @@
|
||||
package sync_test
|
||||
|
||||
import (
|
||||
- "internal/race"
|
||||
- "runtime"
|
||||
. "sync"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
@@ -48,12 +46,6 @@ func TestWaitGroup(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
-func knownRacy(t *testing.T) {
|
||||
- if race.Enabled {
|
||||
- t.Skip("skipping known-racy test under the race detector")
|
||||
- }
|
||||
-}
|
||||
-
|
||||
func TestWaitGroupMisuse(t *testing.T) {
|
||||
defer func() {
|
||||
err := recover()
|
||||
@@ -68,124 +60,6 @@ func TestWaitGroupMisuse(t *testing.T) {
|
||||
t.Fatal("Should panic")
|
||||
}
|
||||
|
||||
-// pollUntilEqual blocks until v, loaded atomically, is
|
||||
-// equal to the target.
|
||||
-func pollUntilEqual(v *uint32, target uint32) {
|
||||
- for {
|
||||
- for i := 0; i < 1e3; i++ {
|
||||
- if atomic.LoadUint32(v) == target {
|
||||
- return
|
||||
- }
|
||||
- }
|
||||
- // yield to avoid deadlock with the garbage collector
|
||||
- // see issue #20072
|
||||
- runtime.Gosched()
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-func TestWaitGroupMisuse2(t *testing.T) {
|
||||
- knownRacy(t)
|
||||
- if runtime.NumCPU() <= 4 {
|
||||
- t.Skip("NumCPU<=4, skipping: this test requires parallelism")
|
||||
- }
|
||||
- defer func() {
|
||||
- err := recover()
|
||||
- if err != "sync: negative WaitGroup counter" &&
|
||||
- err != "sync: WaitGroup misuse: Add called concurrently with Wait" &&
|
||||
- err != "sync: WaitGroup is reused before previous Wait has returned" {
|
||||
- t.Fatalf("Unexpected panic: %#v", err)
|
||||
- }
|
||||
- }()
|
||||
- defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
|
||||
- done := make(chan interface{}, 2)
|
||||
- // The detection is opportunistic, so we want it to panic
|
||||
- // at least in one run out of a million.
|
||||
- for i := 0; i < 1e6; i++ {
|
||||
- var wg WaitGroup
|
||||
- var here uint32
|
||||
- wg.Add(1)
|
||||
- go func() {
|
||||
- defer func() {
|
||||
- done <- recover()
|
||||
- }()
|
||||
- atomic.AddUint32(&here, 1)
|
||||
- pollUntilEqual(&here, 3)
|
||||
- wg.Wait()
|
||||
- }()
|
||||
- go func() {
|
||||
- defer func() {
|
||||
- done <- recover()
|
||||
- }()
|
||||
- atomic.AddUint32(&here, 1)
|
||||
- pollUntilEqual(&here, 3)
|
||||
- wg.Add(1) // This is the bad guy.
|
||||
- wg.Done()
|
||||
- }()
|
||||
- atomic.AddUint32(&here, 1)
|
||||
- pollUntilEqual(&here, 3)
|
||||
- wg.Done()
|
||||
- for j := 0; j < 2; j++ {
|
||||
- if err := <-done; err != nil {
|
||||
- panic(err)
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- t.Fatal("Should panic")
|
||||
-}
|
||||
-
|
||||
-func TestWaitGroupMisuse3(t *testing.T) {
|
||||
- knownRacy(t)
|
||||
- if runtime.NumCPU() <= 1 {
|
||||
- t.Skip("NumCPU==1, skipping: this test requires parallelism")
|
||||
- }
|
||||
- defer func() {
|
||||
- err := recover()
|
||||
- if err != "sync: negative WaitGroup counter" &&
|
||||
- err != "sync: WaitGroup misuse: Add called concurrently with Wait" &&
|
||||
- err != "sync: WaitGroup is reused before previous Wait has returned" {
|
||||
- t.Fatalf("Unexpected panic: %#v", err)
|
||||
- }
|
||||
- }()
|
||||
- defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(4))
|
||||
- done := make(chan interface{}, 3)
|
||||
- // The detection is opportunistically, so we want it to panic
|
||||
- // at least in one run out of a million.
|
||||
- for i := 0; i < 1e6; i++ {
|
||||
- var wg WaitGroup
|
||||
- wg.Add(1)
|
||||
- go func() {
|
||||
- defer func() {
|
||||
- done <- recover()
|
||||
- }()
|
||||
- wg.Done()
|
||||
- }()
|
||||
- go func() {
|
||||
- defer func() {
|
||||
- done <- recover()
|
||||
- }()
|
||||
- wg.Wait()
|
||||
- // Start reusing the wg before waiting for the Wait below to return.
|
||||
- wg.Add(1)
|
||||
- go func() {
|
||||
- wg.Done()
|
||||
- }()
|
||||
- wg.Wait()
|
||||
- }()
|
||||
- go func() {
|
||||
- defer func() {
|
||||
- done <- recover()
|
||||
- }()
|
||||
- wg.Wait()
|
||||
- }()
|
||||
- for j := 0; j < 3; j++ {
|
||||
- if err := <-done; err != nil {
|
||||
- panic(err)
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- t.Fatal("Should panic")
|
||||
-}
|
||||
-
|
||||
func TestWaitGroupRace(t *testing.T) {
|
||||
// Run this test for about 1ms.
|
||||
for i := 0; i < 1000; i++ {
|
@ -96,12 +96,12 @@
|
||||
%endif
|
||||
|
||||
%global go_api 1.17
|
||||
%global go_version 1.17.2
|
||||
%global go_version 1.17.5
|
||||
%global pkg_release 1
|
||||
|
||||
Name: golang
|
||||
Version: %{go_version}
|
||||
Release: 2%{?dist}
|
||||
Release: 1%{?dist}
|
||||
Summary: The Go Programming Language
|
||||
# source tree includes several copies of Mark.Twain-Tom.Sawyer.txt under Public Domain
|
||||
License: BSD and Public Domain
|
||||
@ -145,6 +145,11 @@ Patch1939923: skip_test_rhbz1939923.patch
|
||||
# Fix FIPS mode memory leaks
|
||||
Patch1951877: fix-crypto-memory-leaks.patch
|
||||
|
||||
# These tests has been removed upstream due to
|
||||
# nondeterministic flakiness
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=2028662
|
||||
Patch2028662: remove_waitgroup_misuse_tests.patch
|
||||
|
||||
# Having documentation separate was broken
|
||||
Obsoletes: %{name}-docs < 1.1-4
|
||||
|
||||
@ -242,6 +247,7 @@ Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%patch1951877 -p1
|
||||
|
||||
%patch2028662 -p1
|
||||
|
||||
cp %{SOURCE1} ./src/runtime/
|
||||
|
||||
@ -516,6 +522,21 @@ cd ..
|
||||
%endif
|
||||
|
||||
%changelog
|
||||
* Fri Dec 10 2021 David Benoit <dbenoit@redhat.com> - 1.17.5-1
|
||||
- Rebase to Go 1.17.5
|
||||
- Remove vdso_s390x_gettime patch
|
||||
- Resolves: rhbz#2031112
|
||||
- Related: rhbz#2028570
|
||||
|
||||
* Fri Dec 03 2021 David Benoit <dbenoit@redhat.com> - 1.17.4-1
|
||||
- Rebase Go to 1.17.4
|
||||
- Add remove_waitgroup_misuse_tests patch
|
||||
- Related: rhbz#2014088
|
||||
- Resolves: rhbz#2028570
|
||||
- Resolves: rhbz#2022828
|
||||
- Resolves: rhbz#2024686
|
||||
- Resolves: rhbz#2028662
|
||||
|
||||
* Wed Oct 27 2021 Alejandro Sáez <asm@redhat.com> - 1.17.2-2
|
||||
- Resolves: rhbz#2014704
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user