Skip to content

encoding/gob: stack overflow #10415

Closed
Closed
@dvyukov

Description

@dvyukov

Run the following program on the following input:

package main

import (
    "encoding/gob"
    "os"
)

func main() {
    f, _ := os.Open(os.Args[1])
    d := gob.NewDecoder(f)
    d.Decode(nil)
}

https://drive.google.com/file/d/0B20Uwp8Hs1oCWEs2azE5WlNEQXc/view?usp=sharing

It crashes with:

runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

runtime stack:
runtime.throw(0x558610, 0xe)
    src/runtime/panic.go:543 +0x96
runtime.newstack()
    src/runtime/stack1.go:754 +0xacd
runtime.morestack()
    src/runtime/asm_amd64.s:330 +0x82

goroutine 1 [stack growth]:
runtime.mapaccess2_fast32(0x4ef600, 0xc208014480, 0x6a, 0x0, 0x0)
    src/runtime/hashmap_fast.go:53 fp=0xc22807e208 sp=0xc22807e200
encoding/gob.(*Decoder).decIgnoreOpFor(0xc20807c000, 0xc20000006a, 0x6a)
    src/encoding/gob/decode.go:864 +0x49 fp=0xc22807e2f0 sp=0xc22807e208
encoding/gob.(*Decoder).decIgnoreOpFor(0xc20807c000, 0xc20000006a, 0x6a)
    src/encoding/gob/decode.go:897 +0x55f fp=0xc22807e3d8 sp=0xc22807e2f0
...
...additional frames elided...

I am on commit 7c37249

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions