firefox-devtools / firefox-devtools/profiler

Bad symbolication responses can introduce NaNs into thread.nativeSymbols.address

Open
#4,433 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.5k
Forks
491
Avg merge
3d 46m
Merged PRs (30d)
27

Description

The symbol server [currently](https://github.com/mozilla/dump_syms/issues/535) sometimes returns negative `function_offset` values, such as in this case:

```
curl 'https://symbolication.services.mozilla.com/symbolicate/v5' -X POST --data-raw '{"jobs":[{"memoryMap":[["XUL","6117E38C063A30B0BC7B5A0A21F82B0F0"]],"stacks":[[[0,7668831]]]}]}' | jq .
```

```json
{
"results": [
{
"stacks": [
[
{
"frame": 0,
"module": "XUL",
"module_offset": "0x75045f",
"function": "mozilla::storage::NullVariant::GetDataType()",
"function_offset": "-0x5",
"file": "hg:hg.mozilla.org/mozilla-central:mfbt/Span.h:60b4965aa0ca5a7a60c71229600092a65df8bc1d",
"line": 800
}
]
],
"found_modules": {
"XUL/6117E38C063A30B0BC7B5A0A21F82B0F0": true
}
}
]
}
```

This `"function_offset": "-0x5"` causes the profiler to compute a NaN symbol address.

Profile: https://share.firefox.dev/3XEhvrv

```js
filteredThread.nativeSymbols.address.findIndex(isNaN)
783
```

We should reject such bad symbols.

┆Issue is synchronized with this [Jira Task](https://mozilla-hub.atlassian.net/browse/FP-603)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.