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

Line records before symbol address in some cases #535

Open
mstange opened this issue Jan 19, 2023 · 1 comment
Open

Line records before symbol address in some cases #535

mstange opened this issue Jan 19, 2023 · 1 comment

Comments

@mstange
Copy link
Collaborator

mstange commented Jan 19, 2023

It looks like bad debug info can make dump_syms create line records in a function which start before the function address. There is an example in this XUL.sym:

FUNC m 7503d0 94 0 mozilla::storage::Variant_base::Release()
[...]
750458 4 93 459
75045c 8 800 461
FUNC m 750464 8 0 mozilla::storage::NullVariant::GetDataType()
75045c c 800 461
750468 4 0 461
FUNC m 75046c c 0 mozilla::storage::Variant_base::GetAsJSVal(JS::MutableHandle<JS::Value>)
[...]

Here, the line record 75045c c 800 461 shows up twice. And it shows up in GetDataType() even though GetDataType() only starts at 0x750464, which is 8 bytes after 0x75045c.

This causes the symbolication API to return the wrong symbol and negative function offsets.

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

"function_offset": "-0x5" is not good.

@mstange
Copy link
Collaborator Author

mstange commented Jan 19, 2023

This happens when the input information is garbage, which it currently is for Firefox macOS builds.

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