<ul dir="auto">
<li><strong>Electron Version:</strong>
<ul dir="auto">
<li>4.0.6</li>
</ul>
</li>
<li><strong>Operating System:</strong><br>
windows 10 1803</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">It shd print using PrintToPDF() when requested from the renderer</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">Upon the print request from the renderer using await everything freezes</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto">//RENDERER<br>
await ipc.sendSync("ExecuteBackendFx", { fxName: "PrintToPDF", fxArgs: null });<br>
//MAIN<br>
global.PrintToPDF = async () =&gt; {<br>
let out = await new Promise((resolve, reject) =&gt; {<br>
mainWindow.webContents.printToPDF(<br>
{<br>
marginsType: 0,<br>
printBackground: false,<br>
printSelectionOnly: false,<br>
landscape: false<br>
},<br>
function(error1, data1) {<br>
fs.writeFile(rootDir + "/UI/Temp/print.pdf", (data1, error1) =&gt; {<br>
resolve("Success");<br>
});<br>
}<br>
);<br>
}<br>
});</p>
<p dir="auto">return out;<br>
}</p>
<h3 dir="auto">Additional Information</h3>
<h1 dir="auto">CALL STACK</h1>
<p dir="auto">WebContents.printToPDF (c:\BucksWild\node_modules\electron\dist\resources\electron.asar\browser\api\web-contents.js:218)<br>
dataOut (c:\BucksWild\main.js:310)<br>
global.PrintToPDF (c:\BucksWild\main.js:308)<br>
ExecuteBackendFx (c:\BucksWild\IPCEVENTS.js:131)<br>
InitializeEvents.ipc.on (c:\BucksWild\IPCEVENTS.js:157)<br>
emit (events.js:182)<br>
(anonymous function) (c:\BucksWild\node_modules\electron\dist\resources\electron.asar\browser\api\web-contents.js:355)<br>
emit (events.js:182)</p>
<p dir="auto">Unable to open 'web-contents.js': File not found (file:///c:/BucksWild/node_modules/electron/dist/resources/electron.asar/browser/api/web-contents.js).</p>
<p dir="auto">It prints normally when the request comes from the backend directly.for eg calling the function directly from the debug on VSCODE</p>
<h3 dir="auto">Preflight Checklist</h3>

<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have read the <a href="https://github.com/electron/electron/blob/master/CONTRIBUTING.md">Contributing Guidelines</a> for this project.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I agree to follow the <a href="https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md">Code of Conduct</a> that this project adheres to.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the issue tracker for an issue that matches the one I want to file, without success.</li>
</ul>
<h3 dir="auto">Issue Details</h3>
<ul dir="auto">
<li><strong>Electron Version:</strong> 11.2.3
<ul dir="auto">
<li>

</li>
</ul>
</li>
<li><strong>Operating System:</strong> Big Sur 11.2.0
<ul dir="auto">
<li>

</li>
</ul>
</li>
<li><strong>Last Known Working Electron version:</strong>
<ul dir="auto">
<li>

</li>
</ul>
</li>
</ul>
<h3 dir="auto">Expected Behavior</h3>
<p dir="auto">Renderer process shouldn't crash when run on an M1 processor</p>
<h3 dir="auto">Actual Behavior</h3>
<p dir="auto">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.</p>
<h3 dir="auto">To Reproduce</h3>
<p dir="auto"><a href="https://gist.github.com/davej/98598c79b0b249f78e4d456293a2ab08">https://gist.github.com/davej/98598c79b0b249f78e4d456293a2ab08</a></p>




<h3 dir="auto">Screenshots</h3>

<h3 dir="auto">Additional Information</h3>

<p dir="auto">I'm not sure if it's much use but this is the best stack trace I could get.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ELECTRON_ENABLE_LOGGING=true ELECTRON_ENABLE_STACK_DUMPING=true ./App

&lt;--- Last few GCs ---&gt;

[874:0x7100000000]      324 ms: Scavenge 5.6 (8.6) -&gt; 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) -&gt; 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) -&gt; 8.6 (17.5) MB, 1.1 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure 


&lt;--- JS stacktrace ---&gt;

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"><pre class="notranslate"><code class="notranslate">ELECTRON_ENABLE_LOGGING=true ELECTRON_ENABLE_STACK_DUMPING=true ./App

&lt;--- Last few GCs ---&gt;

[874:0x7100000000]      324 ms: Scavenge 5.6 (8.6) -&gt; 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) -&gt; 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) -&gt; 8.6 (17.5) MB, 1.1 / 0.0 ms  (average mu = 1.000, current mu = 1.000) allocation failure 


&lt;--- JS stacktrace ---&gt;

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
</code></pre></div>