Skip to content
New issue

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

sync: using a nil Pool causes a fatal error #61651

Closed
dominikh opened this issue Jul 29, 2023 · 1 comment
Closed

sync: using a nil Pool causes a fatal error #61651

dominikh opened this issue Jul 29, 2023 · 1 comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@dominikh
Copy link
Member

What version of Go are you using (go version)?

$ go version
go version devel go1.22-457721cd52 Sat Jul 29 03:21:50 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

Reproduces with 1.20.6

What operating system and processor architecture are you using (go env)?

linux/amd64

What did you do?

Run

package main

import "sync"

func main() {
	var p *sync.Pool
	p.Get()
}

What did you expect to see?

A panic for a nil pointer dereference.

What did you see instead?

A fatal error because of an unexpected signal during runtime execution.

I'm not sure how important fixing this is. While fatal errors can't be recovered from, this really only struck a nerve with me because of the unexpected error and the full stack trace, which made me look for wrong unsafe code, not a nil sync.Pool.

@gopherbot gopherbot added the compiler/runtime Issues related to the Go compiler and/or runtime. label Jul 29, 2023
@gopherbot
Copy link

Change https://go.dev/cl/514037 mentions this issue: sync: panic rather than throw on nil *Pool

@panjf2000 panjf2000 added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 30, 2023
@bcmills bcmills added this to the Go1.22 milestone Aug 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler/runtime Issues related to the Go compiler and/or runtime. NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants