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

Parca crashes if the agent sends a stackframes write with empty filenames. #5246

Open
umanwizard opened this issue Oct 29, 2024 · 0 comments

Comments

@umanwizard
Copy link
Contributor

To repro: apply this diff to latest main of parca-agent:

diff --git a/reporter/parca_reporter.go b/reporter/parca_reporter.go
index 52d1cd2c..d2535e74 100644
--- a/reporter/parca_reporter.go
+++ b/reporter/parca_reporter.go
@@ -804,7 +804,8 @@ func (r *ParcaReporter) buildStacktraceRecord(ctx context.Context, stacktraceIDs
 				w.LineNumber.Append(int64(0))
 				w.FunctionName.AppendString(symbol)
 				w.FunctionSystemName.AppendString("")
-				w.FunctionFilename.AppendString("vmlinux")
+				// w.FunctionFilename.AppendString("vmlinux")
+				w.FunctionFilename.AppendString("")
 				w.FunctionStartLine.Append(int64(0))
 			case libpf.AbortFrame:
 				// Next step: Figure out how the OTLP protocol

Then run it against local Parca. Parca crashes with this message:

panic: arrow/array: index out of range

goroutine 11552 [running]:
github.com/apache/arrow/go/v16/arrow/array.(*Binary).Value(0x400a24b5c0, 0x0)
        /home/brennan/go/pkg/mod/github.com/apache/arrow/go/[email protected]/arrow/array/binary.go:56 +0x174
github.com/parca-dev/parca/pkg/profile.serializedArrowLocationSize(0x3b30f3, 0x1, 0x0, 0x0, 0x0, {0x400022b577, 0x11, 0x49}, {0x0, 0x0, ...}, ...)
        /home/brennan/code/parca/pkg/profile/encode.go:397 +0x2b8
github.com/parca-dev/parca/pkg/profile.EncodeArrowLocation(0x3b30f3, 0x1, 0x0, 0x0, 0x0, {0x400022b577, 0x11, 0x49}, {0x0, 0x0, ...}, ...)
        /home/brennan/code/parca/pkg/profile/encode.go:296 +0xec
github.com/parca-dev/parca/pkg/normalizer.(*arrowToInternalConverter).AddLocationsRecordV1(0x400a275830, {0x6fd5148, 0x400a23a700}, {0x6ffbe70, 0x400a2963f0})
        /home/brennan/code/parca/pkg/normalizer/arrow.go:587 +0x19fc
github.com/parca-dev/parca/pkg/normalizer.(*arrowToInternalConverter).AddLocationsRecord(0x400a275830, {0x6fd5148, 0x400a23a700}, {0x6ffbe70, 0x400a2963f0})
        /home/brennan/code/parca/pkg/normalizer/arrow.go:130 +0x168
github.com/parca-dev/parca/pkg/profilestore.(*ProfileColumnStore).write(0x4001a1fda0, {0x6fd5148, 0x400a23a700}, {0x6fed460, 0x400a1db790})
        /home/brennan/code/parca/pkg/profilestore/profilecolumnstore.go:270 +0xfe4
github.com/parca-dev/parca/pkg/profilestore.(*ProfileColumnStore).Write.func1()
        /home/brennan/code/parca/pkg/profilestore/profilecolumnstore.go:180 +0x5c
created by github.com/parca-dev/parca/pkg/profilestore.(*ProfileColumnStore).Write in goroutine 11551
        /home/brennan/code/parca/pkg/profilestore/profilecolumnstore.go:179 +0x1e8
@umanwizard umanwizard changed the title Parca crashes if the agents sends a stackframes write with empty filenames. Parca crashes if the agent sends a stackframes write with empty filenames. Oct 29, 2024
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

No branches or pull requests

1 participant