Issue 1:
Electron Version:

4.0.6

Operating System:

windows 10 1803

Expected Behavior

It shd print using PrintToPDF() when requested from the renderer

Actual Behavior

Upon the print request from the renderer using await everything freezes

To Reproduce

//RENDERER

await ipc.sendSync("ExecuteBackendFx", { fxName: "PrintToPDF", fxArgs: null });

//MAIN

global.PrintToPDF = async () => {

let out = await new Promise((resolve, reject) => {

mainWindow.webContents.printToPDF(

{

marginsType: 0,

printBackground: false,

printSelectionOnly: false,

landscape: false

},

function(error1, data1) {

fs.writeFile(rootDir + "/UI/Temp/print.pdf", (data1, error1) => {

resolve("Success");

});

}

);

}

});

return out;

}

Additional Information

CALL STACK

WebContents.printToPDF (c:\BucksWild\node_modules\electron\dist\resources\electron.asar\browser\api\web-contents.js:218)

dataOut (c:\BucksWild\main.js:310)

global.PrintToPDF (c:\BucksWild\main.js:308)

ExecuteBackendFx (c:\BucksWild\IPCEVENTS.js:131)

InitializeEvents.ipc.on (c:\BucksWild\IPCEVENTS.js:157)

emit (events.js:182)

(anonymous function) (c:\BucksWild\node_modules\electron\dist\resources\electron.asar\browser\api\web-contents.js:355)

emit (events.js:182)

Unable to open 'web-contents.js': File not found (file:///c:/BucksWild/node_modules/electron/dist/resources/electron.asar/browser/api/web-contents.js).

It prints normally when the request comes from the backend directly.for eg calling the function directly from the debug on VSCODE

Issue 2:
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: 11.2.3

Operating System: Big Sur 11.2.0

Last Known Working Electron version:

Expected Behavior

Renderer process shouldn't crash when run on an M1 processor

Actual Behavior

Renderer process crashes on some URLs. I'm unsure why. This is M1 only. The same URLs work fine if I run an intel build of electron on the same machine (running under Rosetta 2). Gist below should reproduce the crash.

To Reproduce

https://gist.github.com/davej/98598c79b0b249f78e4d456293a2ab08

Screenshots

Additional Information

I'm not sure if it's much use but this is the best stack trace I could get.

ELECTRON_ENABLE_LOGGING=true ELECTRON_ENABLE_STACK_DUMPING=true ./App

<--- Last few GCs --->

[874:0x7100000000] 324 ms: Scavenge 5.6 (8.6) -> 4.3 (9.1) MB, 0.4 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure
[874:0x7100000000] 506 ms: Scavenge 7.3 (10.1) -> 6.7 (10.8) MB, 0.9 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure
[874:0x7100000000] 535 ms: Scavenge 8.9 (11.7) -> 8.6 (17.5) MB, 1.1 / 0.0 ms (average mu = 1.000, current mu = 1.000) allocation failure

<--- JS stacktrace --->

Received signal 6
[0x000106477430]
[0x0001090ff5f4]
[0x00010912357c]
[0x000183554c44]
[0x00018350cc24]
[0x000183454864]
[0x00010910afd8]
[0x000109e2eb68]
[0x000109e2e648]
[0x0001083096e0]
[0x0001083096a0]
[0x000108591824]
[0x000105bc25e4]
[0x000105bc2e7c]
[0x000105bc2190]
[0x000105bc2d14]
[0x000108592830]
[0x00010859f388]
[0x000108577904]
[0x000108577acc]
[0x00010857c6f4]
[0x00010857c4fc]
[0x00010857c454]
[0x000106446f30]
[0x000106453340]
[0x000106453030]
[0x000106482488]
[0x00010647f0f4]
[0x000106481f1c]
[0x000183607c14]
[0x000183607b60]
[0x00018360784c]
[0x0001836061e4]
[0x000183605740]
[0x00018438ea88]
[0x0001064829b0]
[0x000106481b0c]
[0x000106453830]
[0x0001064349e4]
[0x0001079a3f84]
[0x0001060086b4]
[0x000105852f88]
[0x000105853434]
[0x0001052dc96c]
[0x000104dd2a90]
[0x000183528f34]
[end of stack trace]
Renderer process crashed - see https://www.electronjs.org/docs/tutorial/application-debugging for potential debugging information.
[873:0217/024149.052604:WARNING:spdy_session.cc(3388)] Received HEADERS for invalid stream 3