You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
12-x-ybug 🪲has-repro-gistIssue can be reproduced with code at https://gist.github.com/platform/macOS
Basically it crashes the window with exit code 11, then my app opens gain the window after it crashed, and it crashes again immediately with exit code 5.
After calling await shell.trashItem(file) in the preload.js file, the file gets moved to the trash folder and then Electron crashes. The call is being done in the renderer process by preloading a js file instead of using the less secure nodeIntegration
For now I need to use the deprecated shell.moveItemToTrash(file) until this issue is fixed.
Perhaps you could collect the crash report using crashReporter @fabiospampinato ? You can add this to your app, before the ready event:
I can't actually because after upgrading to v12 now the crash reporter doesn't work anymore for me, the following is true for me: require('electron').crashReporter.start === undefined.
@nornagon Right, thanks. The changelog didn't mention that change and the docs still report the whole module as supported in the renderer process, like it was in v11 (or at least the app didn't crash when calling #start).
Attached are the crash dump I've got after me trying to delete a file with the new API.
It looks like BrowserTaskExecutor::Get() is returning null. I think this can only happen early during startup. Are you calling trashItem before app.whenReady()?
There are a few apparently unrelated crashes in that zip, but this one has TrashItem in its stack:
The app is configured to restart itself if it crashes, I guess it just keeps on crashing after that. I experience that kind of behavior many times actually when the app crashes for whatever reason.
Are you calling trashItem before app.whenReady()?
No. I'm calling it from the renderer process if it matters.
Oh! Of course, yes this would definitely matter. It looks like that code as written will only function in the main process. That's definitely a bug. Thanks for the clarification.
12-x-ybug 🪲has-repro-gistIssue can be reproduced with code at https://gist.github.com/platform/macOS
Activity
ckerr commentedon Mar 8, 2021
I think #28045 is an unrelated issue; but for triage purposes, its gist at
https://gist.github.com/7fd1ca22aa15b089fc6573a0dd67841d does exercise
shell.trashItem()This might be an macOS-specific issue. I'm not able to reproduce it when testing with Ubuntu 20.10 and Electron 12.0.0
nornagon commentedon Mar 12, 2021
I can't reproduce this with @ckerr's fiddle on macOS 10.15.7.
trashItemcompletes successfully.Perhaps you could collect the crash report using
crashReporter@fabiospampinato ? You can add this to your app, before the ready event:You should see the crash dump appear in the crash dumps directory. Zip it up and attach it here :)
cata-code commentedon Mar 13, 2021
I'm on Ubuntu 20.10, Electron 12.0.1
After calling
await shell.trashItem(file)in thepreload.jsfile, the file gets moved to the trash folder and then Electron crashes. The call is being done in the renderer process by preloading a js file instead of using the less securenodeIntegrationFor now I need to use the deprecated
shell.moveItemToTrash(file)until this issue is fixed.I'm attaching the crash dump
chromium-renderer-minidump-8d83213d6dfc95d6.zip
nornagon commentedon Mar 15, 2021
stack trace:
cata-code commentedon Mar 30, 2021
fabiospampinato commentedon Apr 7, 2021
I can't actually because after upgrading to v12 now the crash reporter doesn't work anymore for me, the following is
truefor me:require('electron').crashReporter.start === undefined.nornagon commentedon Apr 7, 2021
@fabiospampinato you'll need to put that code in the main process, not the renderer.
fabiospampinato commentedon Apr 10, 2021
@nornagon Right, thanks. The changelog didn't mention that change and the docs still report the whole module as supported in the renderer process, like it was in v11 (or at least the app didn't crash when calling
#start).Attached are the crash dump I've got after me trying to delete a file with the new API.
crash_dumps.zip
nornagon commentedon Apr 20, 2021
There are a few apparently unrelated crashes in that zip, but this one has
TrashItemin its stack:It looks like BrowserTaskExecutor::Get() is returning null. I think this can only happen early during startup. Are you calling
trashItembeforeapp.whenReady()?fabiospampinato commentedon Apr 20, 2021
The app is configured to restart itself if it crashes, I guess it just keeps on crashing after that. I experience that kind of behavior many times actually when the app crashes for whatever reason.
No. I'm calling it from the renderer process if it matters.
Literally replacing this line of code:
With this one:
Makes the app crash every single time that line of code is executed. No crashes with the sync version.
nornagon commentedon Apr 20, 2021
Oh! Of course, yes this would definitely matter. It looks like that code as written will only function in the main process. That's definitely a bug. Thanks for the clarification.