We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following snippet:
var src *os.File dst, _ := os.Create("/tmp/file") fmt.Println(io.Copy(dst, src))
On go1.14, this prints:
0 invalid argument
On go1.15, this panics with:
panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x490cc1] goroutine 1 [running]: os.(*File).readFrom(0xc000102018, 0x4dddc0, 0x0, 0x54da28, 0x1000000000000, 0x7f1f86dbcfe8, 0xc0000a0e70) os/readfrom_linux.go:36 +0x81 os.(*File).ReadFrom(0xc000102018, 0x4dddc0, 0x0, 0x7f1f86dbcfe8, 0xc000102018, 0x490301) os/file.go:151 +0x5c io.copyBuffer(0x4ddde0, 0xc000102018, 0x4dddc0, 0x0, 0x0, 0x0, 0x0, 0xc000034778, 0xc0000a0f78, 0x405585) io/io.go:395 +0x2ff io.Copy(...) io/io.go:368 main.main() main.go:15 +0x8c
The text was updated successfully, but these errors were encountered:
\cc @ianlancetaylor @neild
Sorry, something went wrong.
Change https://golang.org/cl/241417 mentions this issue: os: fix regression with handling of nil *File
os: fix regression with handling of nil *File
0844ff8
No branches or pull requests
Consider the following snippet:
On go1.14, this prints:
On go1.15, this panics with:
The text was updated successfully, but these errors were encountered: