Jump to content
Excelsior Forums
deiruch

Line numbers are wrong in full stack traces (GENSTACKTRACE)

Recommended Posts

Hi everyone

I'm collecting crash logs for my game. A typical stacktrace looks like this:

        ...
at net.gewaltig.cultris.manager.rooms.Room.getRecordedRound(Room.java:190)
at net.gewaltig.cultris.gui.menu.GameOnlineChallenge.updateDT(GameOnlineChallenge.java:190)
at net.gewaltig.cultris.gui.OpenGLGUI.updateDT(OpenGLGUI.java:190)
at net.gewaltig.cultris.tools.UpdateManager.update(UpdateManager.java:190)
       ...

As you can see it contains the proper package names, the correct class names and even the method names are correct. But the line numbers are off. This is expected in the default configuration. However, I enabled the GENSTACKTRACE and -Djet.stack.trace compiler/runtime options. The documentation says this about these options:

If this option is set ON, the compiler propagates information about source file names and line numbers into the resulting executable, so that it could appear in the output produced by the printStackTrace() method.

And here's the relevant part of the project file:

%%Excelsior JET v7.6 project file
-compilewithfixedheap-
-genstackalloc+
-genstacktrace+
-global+
...
-jetrt=Desktop
-jetvmprop=-Dorg.lwjgl.util.NoChecks:true -Djet.jit.fast -Djet.jit.disable.resolution -Djet.gc.heaplimit:268435456 -Djet.gc.ratio:10 -Djet.stack.trace
...

Is this expected? Having full stack traces would really help solving some issues...

Cheers,

Simon

Share this post


Link to post
Share on other sites

Hi Simon,

In the full stack trace mode you have mentioned JET attempts to provide line numbers if possible.

In certain cases it may omit them, but you should see something like "Unknown Source" or "foo.class:0".

However, note that Excelsior JET takes line numbers from the class files. You can receive such stack traces if class files omit line numbers or they are incorrect.

What Java compiler did you use to compile your java sources to class files?

Did you enable generation of debugging information when compiling with Java compiler (for example, using javac "-g" switch)?

Did you use some tool to post-process class files, such as obfuscator or pack200, before compiling them with Excelsior JET?

Regards,

--AlexM

Share this post


Link to post
Share on other sites

You were spot on with your guess: I compiled the class files without line numbers. After changing the javac options it works as advertised.

Thanks!

BTW: Maybe you could add a warning to the compiler when the main class file was generated without line numbers and JET was asked to output line numbers in stack traces to avoid this problem in the future?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×