Skip to content

Commit 51c6d7b

Browse files
committed
Revert "add regression test"
This reverts commit bdbe75f.
1 parent bdbe75f commit 51c6d7b

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

src/debug/elf/file_test.go

-52
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"compress/gzip"
1010
"debug/dwarf"
1111
"encoding/binary"
12-
"fmt"
1312
"io"
1413
"math/rand"
1514
"net"
@@ -18,7 +17,6 @@ import (
1817
"reflect"
1918
"runtime"
2019
"testing"
21-
"time"
2220
)
2321

2422
type fileTest struct {
@@ -956,53 +954,3 @@ func TestIssue10996(t *testing.T) {
956954
t.Fatalf("opening invalid ELF file unexpectedly succeeded")
957955
}
958956
}
959-
960-
// TestInvalidBssSection is a regression test for golang.org/issue/54967.
961-
//
962-
// (*Section).Data should not use safeio to read data from the SHT_NOBITS
963-
// section. Otherwise, when the section size is an incorrect huge value,
964-
// it will result in OOM.
965-
func TestInvalidBssSection(t *testing.T) {
966-
c := make(chan error)
967-
go func() {
968-
defer func() {
969-
switch err := recover().(type) {
970-
case nil:
971-
c <- nil
972-
case error:
973-
c <- err
974-
default:
975-
c <- fmt.Errorf("unexpected panic value: %T(%v)", err, err)
976-
}
977-
}()
978-
979-
size := uint64(3349099659509720927)
980-
s := new(Section)
981-
s.SectionHeader = SectionHeader{
982-
Name: ".bss",
983-
Type: SHT_NOBITS,
984-
Flags: SHF_WRITE + SHF_ALLOC,
985-
Addr: 0x80496d4,
986-
Offset: 0x6d4,
987-
Size: size,
988-
Link: 0x0,
989-
Info: 0x0,
990-
Addralign: 0x4,
991-
Entsize: 0x0,
992-
FileSize: size,
993-
}
994-
_, _ = s.Data()
995-
}()
996-
997-
select {
998-
case err := <-c:
999-
wantErr := "runtime error: makeslice: len out of range"
1000-
if err == nil {
1001-
t.Errorf("got error nil; want error %q", wantErr)
1002-
} else if errMsg := err.Error(); errMsg != wantErr {
1003-
t.Errorf("got error %q; want error %q", errMsg, wantErr)
1004-
}
1005-
case <-time.After(time.Second):
1006-
t.Fatal("test timed out (saferio.ReadData is called?)")
1007-
}
1008-
}

0 commit comments

Comments
 (0)