Skip to content

[Bug]: takeHeapSnapshot is always throwing an error #37424

Closed

Description

@eschaefer

Preflight Checklist

Electron Version

22.0.2

What operating system are you using?

macOS

Operating System Version

macOS 12.5

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

process.takeHeapSnapshot(path) and window.webContents.takeHeapSnapshot(path) should generate a heap snapshot at the given path.

Actual Behavior

Error: takeHeapSnapshot failed is returned.

Testcase Gist URL

https://gist.github.com/0302cbfbd787648265b60efe85b7c3d7

Additional Information

This provides a minimum reproducible gist, same issue as #28758

Activity

  1. changed the title [-][Bug]: [/-] [+][Bug]: takeHeapSnapshot is always throwing an error[/+] on Feb 27, 2023
  2. added
    has-repro-gist
    on Feb 27, 2023
  3. moved this to Unsorted Items in 24-x-yon Feb 27, 2023
  4. codebytere commented on Feb 28, 2023

    @codebytere
    Member

    Looks like this is happening because you're passing an invalid file path. This method will create the file, but the enclosing directory needs to previously have been created.

    I've opened a PR to hopefully make this more clear and easy to debug in the future 😄

  5. eschaefer commented on Feb 28, 2023

    @eschaefer
    Author

    @codebytere oh wow, you are correct. It never occurred to me that the enclosing directory might not get created implicitly. Very much appreciated if the error message can be updated to reflect this 🙏

  6. moved this from Unsorted Items to Fixed for Next Release in 24-x-yon Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    22-x-y24-x-ybug 🪲has-repro-gistplatform/macOS

    Type

    No type

    Projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions