Jump to content
Excelsior Forums
crazyjavahacking

Better error handling when SO is using another SO (Segmentation fault)

Recommended Posts

Hi,

I was playing with multi-component functionality and I found out one place where adding additional error description will be very helpful:

  • when I am creating SO library from a JAR file  (e.g. impl.jar) that is using bytecode from another JAR file (e.g. api.jar) that is also compiled into SO library,
  • and when the impl.prj file does not contain !uses api.prj, the application will crash at loadtime with segmentation fault,
  • this is different from the situation when a JAR file compiled into executable will miss the !uses api.prj and which will fail with nice NoClassDefFoundError with stacktrace

Would it be possible to add some better error handling, or diagnostics in described situation? Otherwise in huge multi-module project it will be difficult to figure out what is done wrong.

I can provide sample Gradle + shell projects where the described situation can be reproduced.

Thanks, Martin

Edited by crazyjavahacking
...

Share this post


Link to post
Share on other sites
On 26.01.2018 at 9:19 PM, crazyjavahacking said:

Would it be possible to add some better error handling, or diagnostics in described situation? Otherwise in huge multi-module project it will be difficult to figure out what is done wrong.

Hello,

Thank you for reporting the problem and providing code sample.

We have successfully reproduced the segmentation fault with missed "!uses" directive on your sample application. It is likely to be a bug in our loading and linking engine.

We will investigate the cause of the problem and tell you as we get any results.

 

Best regards,

Excelsior Support Team

Share this post


Link to post
Share on other sites
19 hours ago, crazyjavahacking said:

Awesome!

Just let me know if I can help with anything. I was using JET 14 on 32bit platform.

Thanks, Martin

We have a little survey about using multi-component model by Excelsior JET users: could you please clarify are you using multi-component model in your real product, and why if so, or are you just exploring Excelsior JET functionality?

Thanks

Share this post


Link to post
Share on other sites

We do use JET, but not the multi-component model yet. Currently we use JET to compile one huge fatjar into a final executable without any shared libraries.

I am investigating the multi-component model, preparing a prototype and trying to figure out all the problematic cases our build might go into.

Thanks, Martin

Share this post


Link to post
Share on other sites
23 hours ago, crazyjavahacking said:

I am investigating the multi-component model, preparing a prototype and trying to figure out all the problematic cases our build might go into.

Could you please tell us why you have started to investigate the multi-component functionality? What benefit do you try to achieve for your application by using it?

Share this post


Link to post
Share on other sites

Our fatjar contains about 14000 class files and JETting takes about 30-45 minutes. That is quite a lot of time.

By separating all external libraries into shared libraries and compiling them only once + caching binaries and PDB files we can significantly reduce the build time. Number of our company's class files is about 2500.

That is the primary reason for my investigation.

Thanks, Martin

Share this post


Link to post
Share on other sites
17 hours ago, crazyjavahacking said:

Our fatjar contains about 14000 class files and JETting takes about 30-45 minutes. That is quite a lot of time.

By separating all external libraries into shared libraries and compiling them only once + caching binaries and PDB files we can significantly reduce the build time. Number of our company's class files is about 2500.

Thank you very much for your explanation!

In this case, we have an announcement for you about upcoming improvement of compilation time by introducing Smart compilation mode, which will recompile only changed files and their dependencies that could be optimized better after changes.

It should significantly reduce compilation time when there are many stable parts in your application, such as third-party libraries.

This feature will be included in the next release of Excelsior JET in 2Q'18.

However, it will make a multi-component model less useful, so we are planning to deprecate it in 2019. Please take this into account.

 

Best regards,

Excelsior Support Team

Share this post


Link to post
Share on other sites

Interesting, it looks like this will replace the functionality I wanted to achieve.

It looks like JET will maintain some kind of pre-compiled code cache? Will that be valid for one machine, or could that be shared across various machines, e.g. multiple build agents?

I will be definitely interested in helping the testing the smart caching is that is possible. I saw you provide BETA release of JET to chosen customers.

Thanks, Martin

Share this post


Link to post
Share on other sites
On 01.02.2018 at 6:45 PM, crazyjavahacking said:

It looks like JET will maintain some kind of pre-compiled code cache? Will that be valid for one machine, or could that be shared across various machines, e.g. multiple build agents?

Yes, there will be such precompiled code cache. At the start point, it will be valid for each concrete project and its parts could not be shared for other projects (e.g. with the same libs).

Usually, we publish Beta builds of Excelsior JET on our site, so everyone could try it. You can subscribe to Excelsior JET releases (including Beta) mailing list on the main page: https://www.excelsiorjet.com/

Best regards,

Excelsior Support Team

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

×