Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Dump files cannot be generated on mac #41942

Open
3 tasks done
cuijindong opened this issue Apr 23, 2024 · 4 comments
Open
3 tasks done

[Bug]: Dump files cannot be generated on mac #41942

cuijindong opened this issue Apr 23, 2024 · 4 comments

Comments

@cuijindong
Copy link

Preflight Checklist

Electron Version

28.1.0

What operating system are you using?

macOS

Operating System Version

12.0.1

What arch are you using?

arm64 (including Apple Silicon)

Last Known Working Electron version

No response

Expected Behavior

code

crashReporter.start({
  companyName: "demo",
  uploadToServer: false,
  compress: true,
});
setTimeout(() => {
  process.crash()
}, 3000);

Dump files can be generated in the local development environment
image

It should also be possible to generate a dump file after the application is built.

Actual Behavior

But after building unable to generate dump file 😭.
image

Testcase Gist URL

No response

Additional Information

After the application was packaged, I tested it on multiple Macs and found that the dump can be generated normally under the 10.13.6 system version; but not on 12.0.1 or higher versions. Why is this?

@VerteDinde VerteDinde added the blocked/need-repro Needs a test case to reproduce the bug label Apr 26, 2024
@VerteDinde
Copy link
Member

🤔 Could you try adding the following snippet to your main process code, before app.whenReady? It's similar to the code you linked above, but pair down the variables to submitURL and uploadToServer, and log the crashDumps path. Make sure this code goes before app.whenReady:

const { app, crashReporter } = require('electron')

console.log(app.getPath('crashDumps'))
crashReporter.start({ submitURL: '', uploadToServer: false })

Then reproduce the crash. Let me know if that is still not working.

@electron-issue-triage
Copy link

Hello @cuijindong. Thanks for reporting this and helping to make Electron better!

Would it be possible for you to make a standalone testcase with only the code necessary to reproduce the issue? For example, Electron Fiddle is a great tool for making small test cases and makes it easy to publish your test case to a gist that Electron maintainers can use.

Stand-alone test cases make fixing issues go more smoothly: it ensure everyone's looking at the same issue, it removes all unnecessary variables from the equation, and it can also provide the basis for automated regression tests.

Now adding the blocked/need-repro Needs a test case to reproduce the bug label for this reason. After you make a test case, please link to it in a followup comment. This issue will be closed in 10 days if the above is not addressed.

@cuijindong
Copy link
Author

🤔 Could you try adding the following snippet to your main process code, before app.whenReady? It's similar to the code you linked above, but pair down the variables to submitURL and uploadToServer, and log the crashDumps path. Make sure this code goes before app.whenReady:

const { app, crashReporter } = require('electron')

console.log(app.getPath('crashDumps'))
crashReporter.start({ submitURL: '', uploadToServer: false })

Then reproduce the crash. Let me know if that is still not working.

I always call crashReporter before app.whenReady. The problem is that on mac m1, the dump file cannot be generated after the application is packaged, but it can be generated in the development environment.

@electron-issue-triage electron-issue-triage bot removed the blocked/need-repro Needs a test case to reproduce the bug label Apr 28, 2024
@cuijindong
Copy link
Author

🤔 Could you try adding the following snippet to your main process code, before app.whenReady? It's similar to the code you linked above, but pair down the variables to submitURL and uploadToServer, and log the crashDumps path. Make sure this code goes before app.whenReady:

const { app, crashReporter } = require('electron')

console.log(app.getPath('crashDumps'))
crashReporter.start({ submitURL: '', uploadToServer: false })

Then reproduce the crash. Let me know if that is still not working.

You can package the following code and test it on mac m1, and you will be able to reproduce the problem I mentioned: the dump file cannot be generated.

const { app, crashReporter } = require('electron')

console.log(app.getPath('crashDumps'))
crashReporter.start({ submitURL: '', uploadToServer: false })

setTimeout(() => {
  process.crash()
}, 3000);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants