Skip to content

Conversation

mikefarah
Copy link
Owner

No description provided.

@n471d
Copy link
Contributor

n471d commented Sep 16, 2025

Hi @mikefarah is there any update on this PR? It appears that yaml.v3 is causing some panics:

goroutine 26994 [running]:
runtime/debug.Stack()
	/usr/local/go/src/runtime/panic.go:783 +0x132
go.yaml.in/yaml/v3.handleErr(0xc000bdc488)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/yaml.go:301 +0x68
panic({0x10430a0?, 0xc001931e30?})
	/usr/local/go/src/runtime/panic.go:783 +0x132
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:166 +0x174
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).mapping(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:288 +0x22f
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:155 +0xe9
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).mapping(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:288 +0x22f
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:155 +0xe9
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).mapping(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:288 +0x22f
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:155 +0xe9
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).sequence(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:262 +0x138
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:157 +0xd5
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).mapping(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:288 +0x22f
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:155 +0xe9
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).mapping(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:288 +0x22f
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:155 +0xe9
go.yaml.in/yaml/v3.(*parser).parseChild(...)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:197
go.yaml.in/yaml/v3.(*parser).document(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:206 +0x79
go.yaml.in/yaml/v3.(*parser).parse(0xc0003aac08)
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/decode.go:159 +0xa5
go.yaml.in/yaml/v3.(*Decoder).Decode(0xc0002d1570, {0x11c5860, 0xc000bc0e60})
	/go/pkg/mod/go.yaml.in/yaml/v3@v3.0.4/yaml.go:121 +0x10c
github.com/mikefarah/yq/v4/pkg/yqlib.(*yamlDecoder).Decode(0xc0002d1570)
	/go/pkg/mod/github.com/mikefarah/yq/v4@v4.47.3-0.20250910084752-4532346e136f/pkg/yqlib/decoder_yaml.go:115 +0x46
github.com/mikefarah/yq/v4/pkg/yqlib.(*streamEvaluator).Evaluate(0xc000bdc688, {0x0, 0x0}, {0x14598a0?, 0xc000529500?}, 0xc001008c80, {0x1465b70, 0xc000823420}, {0x1461390, 0xc0002d1570})
	/go/pkg/mod/github.com/mikefarah/yq/v4@v4.47.3-0.20250910084752-4532346e136f/pkg/yqlib/stream_evaluator.go:86 +0xb3
github.com/mikefarah/yq/v4/pkg/yqlib.(*stringEvaluator).Evaluate(0x12e6c43?, {0xc0004705c0, 0x3a}, {0xc001906000, 0x123fe}, {0x1465ba8, 0xc00023fe30}, {0x1461390, 0xc0002d1570})
	/go/pkg/mod/github.com/mikefarah/yq/v4@v4.47.3-0.20250910084752-4532346e136f/pkg/yqlib/string_evaluator.go:62 +0x451

@ccoVeille
Copy link

@n471d I'm one of the yaml/go-yaml maintainers.

I'm unsure it's the right place to report it.

I mean using go.yaml.in/yaml/v4 may help, but for now the number of changes is very low in v4. There are only a few changes with v4.

I would appreciate if you could open an issue in yq with the minimum way to reproduce the issue. The fact go.yaml.in/yaml/v3 panic is something we have to look in go.yaml.in/yaml/v3 and go.yaml.in/v4

Maybe it's a bug in the way yq call go.yaml.in/v3 (like something like a comfiguration setting) or the yaml that you provide to yq and the yq filter you are applying, or it's something in the go.yaml.in/yaml/v3

So please provide some information so we could try to reproduce the issue, and identify what it could be.

@n471d
Copy link
Contributor

n471d commented Sep 18, 2025

Hi @ccoVeille , I’ve just received the panic log. Since this is used in a production service handling dynamic input, I don’t currently have an example to reproduce the issue.

@ccoVeille
Copy link

Hi @ccoVeille , I’ve just received the panic log. Since this is used in a production service handling dynamic input, I don’t currently have an example to reproduce the issue.

OK

I have opened #2481

Let's move and continue the discussion about the panic there.

So we can step aside the panic thing from this PR about using v4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants