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

[BUG] Fuzz tests failure in profiling with labels #958

Open
morrisonlevi opened this issue Mar 20, 2025 · 1 comment
Open

[BUG] Fuzz tests failure in profiling with labels #958

morrisonlevi opened this issue Mar 20, 2025 · 1 comment
Assignees
Labels
profiling Relates to the profiling* modules.

Comments

@morrisonlevi
Copy link
Contributor

Describe the bug
This has triggered in CI and also for me locally:

Error: 
panicked at profiling/src/internal/profile/fuzz_tests.rs:365:13:
assertion `left == right` failed
  left: [Label { key: "\0ܔ", str: None, num: 0, num_unit: None }, Label { key: "\0\0", str: None, num: 0, num_unit: None }]
 right: [Label { key: "\0\0", str: Some(""), num: 1125900712148992, num_unit: Some("") }, Label { key: "\0ܔ", str: Some(""), num: 0, num_unit: Some("") }]
Error: 
panicked at profiling/src/internal/profile/fuzz_tests.rs:359:13:
assertion `left == right` failed
  left: [Label { key: "", str: None, num: 0, num_unit: None }, Label { key: "\0I", str: None, num: 0, num_unit: None }]
 right: [Label { key: "\0I", str: None, num: 0, num_unit: Some("") }, Label { key: "", str: Some(""), num: 0, num_unit: Some("") }]

To Reproduce
Steps to reproduce the behavior:

  1. Check out a recent version of the repo.
  2. Run cargo +nightly bolero test -p datadog-profiling internal::profile::fuzz_tests::test_fuzz_add_sample
  3. Wait forever, it'll probably find it too

Expected behavior
Don't expect a fuzz test failure here.

Errors or warnings received
None, just a fuzz failure.

@morrisonlevi morrisonlevi added the profiling Relates to the profiling* modules. label Mar 20, 2025
@morrisonlevi morrisonlevi self-assigned this Mar 20, 2025
@morrisonlevi
Copy link
Contributor Author

There are two issues here:

  1. Some("") and None need to be treated as equivalent.
  2. The order of the labels is not stable. The labels coming from the deserialized pprof may not be in insertion order because they are ordered by LabelId. These are strongly correlated to insertion order, but it's not the same.

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

No branches or pull requests

1 participant