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

Call stacks containing <anonymous> source fail to symbolicate #1580

Open
samuelmaddock opened this issue Jan 8, 2025 · 2 comments · May be fixed by #1581
Open

Call stacks containing <anonymous> source fail to symbolicate #1580

samuelmaddock opened this issue Jan 8, 2025 · 2 comments · May be fixed by #1581

Comments

@samuelmaddock
Copy link

samuelmaddock commented Jan 8, 2025

Environment

macOS 15.2 ARM64

Steps to Reproduce

  1. Format a call stack received from the Crash Reporting API
Error: Example unresponsive call stack
    at Object.hasOwnProperty (<anonymous>)
  1. Submit it to the /symbolicate-js endpoint
{
  "platform": "node",
  "source": {
    "id": "<id>",
    "url": "https://sentry.io/api/0/projects/sentry-org/sentry-project/artifact-lookup/",
    "token": "secret"
  },
  "stacktraces": [
    {
      "frames": [
        {
          "function": "Object.hasOwnProperty",
          "in_app": false
        }
      ]
    }
  ],
  "dist": "production",
  "release": "1.33.1",
  "scraping": {
    "enabled": true,
    "allowed_origins": [
      "*"
    ],
    "headers": {}
  }
}

Expected Result

The call stack is returned with a partially symbolicated call stack.

Actual Result

Failed to deserialize the JSON body into the target type: stacktraces[0].frames[0]: missing field `abs_path` at line 1 column 220

Additional Background

I'm investigating collecting unresponsive renderer call stacks in Sentry using the new Crash Reporting API. This relates to the work @timfish initiated in getsentry/sentry-javascript#14044

The first line of the call stacks contain the <anonymous> source. Whether this is expected or not, it'd be great if the symbolicator service could handle this case so the call stacks can be symbolicated.


I found the code within V8 which handles formatting JS call stacks.
https://source.chromium.org/chromium/chromium/src/+/main:v8/src/objects/call-site-info.cc;l=688-718;drc=763100e0bf9a25ba6f203612af5a4331fbd2d048

According to the implementation of AppendFileLocation, it can output <anonymous> by itself if there's no line number associated with the frame.

@loewenheim
Copy link
Contributor

Hi, Symbolicator is currently set up in such a way that you can't send it frames which it will definitely not be able to process. JS frames without an abs_path and line number are one such case. Would it be an option for you to filter these frames out beforehand?

@loewenheim loewenheim self-assigned this Jan 9, 2025
@samuelmaddock
Copy link
Author

@loewenheim It's technically possible to pre-process the stack traces in my case (using Electron). In other cases though, browser crash reports (getsentry/sentry#38940) are sent directly from the browser without a chance to process them before reaching sentry/relay servers.

I pulled down symbolicator locally and made the necessary changes for this as well #1581

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Waiting for: Product Owner
Development

Successfully merging a pull request may close this issue.

3 participants