Skip to content

Commit 1c6144d

Browse files
committed
encoding/gob: work around TestFuzzOneByte panic
The index 248 results in the decoder calling reflect.MakeMapWithSize with a size of 14754407682 - just under 15GB - which ends up in a runtime out of memory panic after some recent runtime changes on machines with 8GB of memory. Until that is fixed in either runtime or gob, skip the troublesome index. Updates #24308. Change-Id: Ia450217271c983e7386ba2f3f88c9ba50aa346f4 Reviewed-on: https://go-review.googlesource.com/99655 Run-TryBot: Daniel Martí <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 031f71e commit 1c6144d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/encoding/gob/codec_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,10 @@ func TestFuzzOneByte(t *testing.T) {
14781478
switch i {
14791479
case 14, 167, 231, 265: // a slice length, corruptions are not handled yet.
14801480
continue
1481+
case 248:
1482+
// Large map size, which currently causes an out of memory panic.
1483+
// See golang.org/issue/24308 and golang.org/issue/20221.
1484+
continue
14811485
}
14821486
indices = append(indices, i)
14831487
}

0 commit comments

Comments
 (0)