Skip to content

fix(panic): Fix Java config panic#256

Merged
daffinito merged 1 commit into
mainfrom
daffi/panic-fix
Oct 17, 2025
Merged

fix(panic): Fix Java config panic#256
daffinito merged 1 commit into
mainfrom
daffi/panic-fix

Conversation

@daffinito

Copy link
Copy Markdown
Contributor

Issue

panic: runtime error: index out of range [3] with length 2

goroutine 20 [running]:
http://github.com/newrelic/newrelic-diagnostics-cli/tasks.ValidateBlob.insertChildKey ({{0x8231b4, 0x1}, {0xc00013e780, 0x35}, {0x0, 0x0}, {0xc0001eb770, 0x1, 0x1}}, {0xc000496af8, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/taskHelpers.go:474 +0x75f
http://github.com/newrelic/newrelic-diagnostics-cli/tasks.ValidateBlob.insertChildKey ({{0xc000267e00, 0x16}, {0xc0000c1460, 0x1e}, {0x0, 0x0}, {0xc0001eb7c0, 0x1, 0x1}}, {0xc000496af8, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/taskHelpers.go:464 +0xb51
http://github.com/newrelic/newrelic-diagnostics-cli/tasks.ValidateBlob.insertChildKey ({{0xc000267dd0, 0x12}, {0xc000312490, 0xb}, {0x0, 0x0}, {0xc0003b66c0, 0x3, 0x4}}, {0xc000496af8, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/taskHelpers.go:464 +0xb51
http://github.com/newrelic/newrelic-diagnostics-cli/tasks.ValidateBlob.insertChildKey ({{0xc000312350, 0xa}, {0x0, 0x0}, {0x0, 0x0}, {0xc0003b1b00, 0x18, 0x20}}, {0xc000496af8, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/taskHelpers.go:464 +0xb51
http://github.com/newrelic/newrelic-diagnostics-cli/tasks.ValidateBlob.InsertKey ({{0xc000312350, 0xa}, {0x0, 0x0}, {0x0, 0x0}, {0xc0003b1b00, 0x18, 0x20}}, {0xc000496af8, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/taskHelpers.go:432 +0x51d
http://github.com/newrelic/newrelic-diagnostics-cli/tasks.ValidateBlob.UpdateOrInsertKey ({{0xc000312350, 0xa}, {0x0, 0x0}, {0x0, 0x0}, {0xc0003b1b00, 0x18, 0x20}}, {0xc000496af8, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/taskHelpers.go:510 +0xae8
http://github.com/newrelic/newrelic-diagnostics-cli/tasks/java/config.updateSysValues ({{0x4a36, {0xc0000b1a2b, 0x4}, {0x0, 0x0}, 0x0, {{0x0, 0x0}, 0x0, 0x0, ...}, ...}, ...}, ...)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/java/config/validate.go:277 +0x765
http://github.com/newrelic/newrelic-diagnostics-cli/tasks/java/config.JavaConfigValidate.Execute ({}, {0x414025?}, 0xc000046800?)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/tasks/java/config/validate.go:112 +0xbe5
main.processTasks({0xc00014ecf0?}, {0x0, 0x0, 0x0?}, 0xc0000b12b0?)
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/processTasks.go:121 +0xa14
created by main.main
/home/runner/work/newrelic-diagnostics-cli/newrelic-diagnostics-cli/core.go:128 +0xa0a

Goals

Resolve panic

Implementation Details

Added a test to test for the panic, added safety clauses to prevent panics

How to Test

./scripts/test.sh

@bradleyisbon bradleyisbon left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@daffinito daffinito merged commit b31b4a6 into main Oct 17, 2025
18 checks passed
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.

2 participants