Skip to content

child_process spawn locks up renderer for 300 - 3000ms on signed app on macOS Big Sur #26143

@marcello3d

Description

@marcello3d

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    • 10.1.3
    • 10.1.4
    • 11.0.0-beta.13
    • 11.0.0-beta.17
    • 11.0.0-beta.19
  • Operating System:
    • macOS 11.0 Beta (20A5395g)
    • macOS 11.0.1 Release (20B28)
  • Last Known Working Electron version:
    • works on macOS 10.15 Catalina

Expected Behavior

If I call require('child_process').spawn('ls', ['.']), it should return quickly (<10ms).

Measurable with:

const { spawn } = require('child_process');
const start = Date.now();
spawn('ls', ['.']);
console.log(`spawn sync time: ${Date.now() - start}`);

Actual Behavior

If run in a renderer process with nodeIntegration: true, it takes 300+ ms. When used with ffmpeg (our real-world case), we're seeing it go as long as 2-3 seconds, which leads me to think it's related to the binary size/code signing?

To Reproduce

To reproduce the bug, you'll need:

  • macOS 11 Beta
  • an Apple Developer code-signing certificate

Or you can download the version I code-signed: https://github.com/descriptinc/electron-spawn-perf-bug/releases/tag/1.0.0

Repo: https://github.com/descriptinc/electron-spawn-perf-bug
If you want to build/run it locally:

$ git clone https://github.com/descriptinc/electron-spawn-perf-bug.git
$ yarn install
$ yarn build
$ dist/mac/electron-spawn-bug.app/Contents/MacOS/electron-spawn-bug

Screenshots

image

Additional Information

I'm not sure if this is an Electron, Electron Builder, or Big Sur bug.

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