Skip to content

[Bug]: electron.safeStorage.isEncryptionAvailable() segfaults on Linux when called before creation of the first BrowserWindow #32206

@ganthern

Description

@ganthern

Preflight Checklist

Electron Version

15 and 16

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 20.04

What arch are you using?

x64

Last Known Working Electron version

n/a

Expected Behavior

calling electron.safeStorage.isEncryptionAvailable() returns a boolean

Actual Behavior

calling electron.safeStorage.isEncryptionAvailable() segfaults immediately

Testcase Gist URL

https://github.com/ganthern/safe-storage-segfault

Additional Information

It also happens in a fresh openSUSE Leap 15.1.1 VM.

The API should be available as soon as possible (preferrably before app ready) since it's useful for apps that run on startup without immediately opening BrowserWindows.

For the record, it works as expected on MacOs and returns false on windows, which makes the current documentation of isEncryptionAvailable inaccurate.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions