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

[Proposal] Print JVM stack trace when the error is being thrown inside a cpp file. #186

Open
Humberd opened this issue Apr 24, 2021 · 7 comments

Comments

@Humberd
Copy link

Humberd commented Apr 24, 2021

It would be cool to have it, so that we would know what went wrong

@Humberd Humberd changed the title [Proposal] Print jvm stack trace when the error is being from in cpp files. [Proposal] Print JVM stack trace when the error is being from in cpp files. Apr 24, 2021
@Humberd Humberd changed the title [Proposal] Print JVM stack trace when the error is being from in cpp files. [Proposal] Print JVM stack trace when the error is being thrown inside a cpp file. Apr 24, 2021
@piiertho
Copy link
Member

piiertho commented Aug 25, 2021

Exception should appear in classic console or terminal.
We can't do much about this, the stream to where JVM prints is handled by JVM implementation.
When calling void ExceptionDescribe() JVM will output it to sdterr. There is no easy way for us to retreive the message.

@chippmann if you're ok, I think we can close this one.

@chippmann
Copy link
Contributor

@piiertho I don't think this is what the issue describes. As I understand it; the problem is when a crash happens inside cpp land and not the jvm. Then no java stacktrace is printed. Only a dump from cpp land is printed.
What this issue requests (as far as i understand it) is that when a cpp crash happens, the jvm stacktrace should be printed as well, if a call was coming from jvm land.
This would enable easier debugging.

@Humberd
Copy link
Author

Humberd commented Aug 25, 2021

What @chippmann said was exactly my problem. I wrote a bunch of code, executed it and then the cpp part crashed and I didn't know which JVM call caused that, which resulted in me putting logs in every line.

@CedNaru
Copy link
Member

CedNaru commented May 15, 2024

To close after #627 is merged

@chippmann
Copy link
Contributor

@piiertho I don't think this is what the issue describes. As I understand it; the problem is when a crash happens inside cpp land and not the jvm. Then no java stacktrace is printed. Only a dump from cpp land is printed.
What this issue requests (as far as i understand it) is that when a cpp crash happens, the jvm stacktrace should be printed as well, if a call was coming from jvm land.
This would enable easier debugging.

@CedNaru i don't think that my PR solves this issue. It still only handles a jvm exception but not a print of the jvm stacktrace if no error has happened in jvm but one in cpp (like cannot find node by path as node is not in scene tree)

@CedNaru
Copy link
Member

CedNaru commented May 15, 2024

I see. Then 4.3 will solve the issue, there is a new API call that makes a language print its current stacktrace, we will just have to implement it by calling a dummy Jvm method that will only throw an exception.

godotengine/godot#91006

@chippmann
Copy link
Contributor

Nice!

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

4 participants