-
Notifications
You must be signed in to change notification settings - Fork 248
Open
Description
Minimal Reproducible Example
input.jsonnet
std.manifestYamlDoc({
a: ['%' % 0],
b: 0,
})Command Used
jsonnet input.jsonnetOutput
INTERNAL ERROR: (CRASH) Saving empty traceElement on stack
goroutine 1 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:26 +0x5e
github.com/google/go-jsonnet.(*VM).Evaluate.func1()
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/vm.
go:187 +0x3d
panic({0x5dd460?, 0x6828f0?})
/usr/local/go/src/runtime/panic.go:792 +0x132
github.com/google/go-jsonnet.(*callStack).newCall(...)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:166
github.com/google/go-jsonnet.(*interpreter).newCall(0xc000034780, {0xc0001969
30?, {0xc0000f6930?, 0x9ceb00?}}, 0x0)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:306 +0x20b
github.com/google/go-jsonnet.(*interpreter).EvalInCleanEnv(0xc000034780, 0xff
ffffffffffffff?, {0x6850b0, 0xc000034680}, 0x1?)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:1013 +0x34
github.com/google/go-jsonnet.(*codeUnboundField).evaluate(0x5eeee0?, 0xc00019
6930?, {0xc0000f6930?, 0x1?}, 0x1?, {0xc0001baef8?, 0xc0001baf40?})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/thu
nks.go:98 +0x38
github.com/google/go-jsonnet.objectIndex(0xc000034780, {0xc0000f6930?, 0xc000
0f6960?}, {0xc000010f80, 0x1})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/val
ue.go:724 +0x652
github.com/google/go-jsonnet.(*valueObject).index(...)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/val
ue.go:496
github.com/google/go-jsonnet.builtinManifestYamlDoc.func1({0x683f40?, 0xc0000
f6930}, 0xc0000f6960, {0x0, 0x0})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/bui
ltins.go:2230 +0x774
github.com/google/go-jsonnet.builtinManifestYamlDoc(0xc000034780, {0xc0000f68
40, 0x3, 0xc0000f6810?})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/bui
ltins.go:2274 +0x252
github.com/google/go-jsonnet.(*generalBuiltin).evalCall(0xc00009fb00, {{0xc00
00680e8, 0x1, 0x1}, {0x9ed680, 0x0, 0x0}, 0x0}, 0xc000034780)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/bui
ltins.go:2745 +0x385
github.com/google/go-jsonnet.(*valueFunction).call(0xc000029370, 0xc000034780
, {{0xc0000680e8, 0x1, 0x1}, {0x9ed680, 0x0, 0x0}, 0x0})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/val
ue.go:349 +0x122
github.com/google/go-jsonnet.(*interpreter).evaluateTailCall(0x685608?, 0xc00
0184000?, {{0xc0000680e8, 0x1, 0x1}, {0x9ed680, 0x0, 0x0}, 0x0}, 0x1)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:1037 +0x9d
github.com/google/go-jsonnet.(*interpreter).rawevaluate(0xc000034780, {0x6856
08, 0xc000184000}, 0x1)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:621 +0x3be5
github.com/google/go-jsonnet.(*interpreter).evaluate(0xc000034780, {0x685608,
0xc000184000}, 0x1)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:312 +0x4e
github.com/google/go-jsonnet.(*interpreter).EvalInCleanEnv(0xc000034780, 0x19
?, {0x685608, 0xc000184000}, 0x90?)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:1019 +0x5f
github.com/google/go-jsonnet.evaluateAux(0xc000034780, {0x685608, 0xc00018400
0}, 0xc00009fdd0)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:1327 +0x147
github.com/google/go-jsonnet.evaluate({0x685608, 0xc000184000}, 0xc0001bbd68?
, 0xc00009fdd0, 0x5ea920?, 0xc00009ff20?, 0x7ffdc8c4ee4d?, {0x6838a0?, 0xc000
068040?}, 0x0, ...)
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/int
erpreter.go:1362 +0x91
github.com/google/go-jsonnet.(*VM).Evaluate(0xc0000f6000?, {0x685608?, 0xc000
184000?})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/vm.
go:190 +0xba
github.com/google/go-jsonnet.(*VM).EvaluateFile(0xc0000ee230, {0x7ffdc8c4ee4d
?, 0xc00009fcb0?})
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/vm.
go:419 +0xb4
main.main()
/home/david-sutor/go/pkg/mod/github.com/google/[email protected]/cmd
/jsonnet/cmd.go:457 +0x6c5
Please report a bug here: https://github.com/google/go-jsonnet/issues
Expected Output
RUNTIME ERROR: Truncated format code.
Environment
- Jsonnet Version:
v0.21.0 - Operating System: Ubuntu 24.04
Additional Context
An expression
std.manifestYamlDoc({
a: ['%' % 0],
})will outputs "\"a\":\n" instead of and error.
The similar behavior is also found for this expression:
std.manifestYamlDoc({
b: ['%' % 0],
a: 0,
})thejoeejoee
Metadata
Metadata
Assignees
Labels
No labels