grafana / grafana/pyroscope-jfr-parser
Implement JFR string encoding type 2 (UTF-16)
- Dominant language
- Go
- Stars
- 49
- Forks
- 24
- PR merge metrics
- No merged PRs in 30d
Description
While investigating a corrupt JFR file, we found that string encoding type 2 is not implemented in the parser. The current code in `parser/parser.go` has a `//todo implement 2` comment for this case.
When a `jdk.FileWrite` event contains a string with encoding type 2, parsing fails with `unknown string type 2`. This encoding type appears to be UTF-16 (used by the JVM for some string values).
Relevant code: `parser/parser.go` in the `string()` method.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
co-reviewed by opus
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in parser/parser.go, specifically the string() method and its `//todo implement 2` case. Reproduce parsing of a jdk.FileWrite event containing a type 2 string, then trace the existing string decoding paths. Done means type 2 UTF-16 strings parse successfully without the `unknown string type 2` error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100