JIT Issue on IBM Websphere Application Server

Hi Rachel,

Thanks for the logs. Probably I catch the place. It is very interesting: nothing similar to a usual thread issue. No IO, no streams at all, no global properties, variables, etc., just an arithmetic.
Please, run the new test I sent to your email. And please use the first TestResult code that saves document to String filename rather than that saves the doc to OutputStream.
Sorry for inconvenience,

Hi Konstantin
Please find the latest Test results and the logs attached.
Thanks
Rachel

Hi Rachel,
Tanks for the info and sorry for inconvenience, - i have sent you yet another test jar, please check your email.
It seems that IBM fails to perform properly just one simple arithmetic operation. May be IBM JIT “optimizes” that code after 4th time, may be this optimization conflicts with our obfuscation… Please, launch your test yet another time and send me the results.
And another question. Your Websphere environment depends on jdk 1.4? Can you launch the same under 1.5 or 1.6 (i can send you jar for this)?
Best Regards,

Hi Konstantin

I ran the test code again with the latest jar that you had shared. All of the documents got generated successfully. The test results and logs are attached(MailMergeWordTemplate2.zip).

We had performed the tests by running our standalone java test class and not by runing on the server. In this case will IBM JIT optimization come into picture?. Also, not at all times we got the first 4 docs generated properly and rest corrupted. We also had test results in which all of them got corrupted(as shared earlier). For your further analysis i ran the test code with the old jar again (in which documents got corrupted), to capture logs for two different templates(one in which some got corrupted and other in which all of them got corrupted). I have attached the logs “4Generated_RestCorrupted.txt”, “AllCorrupted.txt” captured with the old jar for your reference.

Our websphere environment depends on jdk 1.4 alone.

Thanks
Rachel

Hi Rachel,
Thanks for the info. The “old corrupted logs” demonstrate almost the same quirk in the same place but with new nuances.
Please specify, did the last jar solve the issue? Or you run it on some kind of sandbox: IBM hardware + AIX OS + IBM JVM, but without websphere? Did the “old” tests also launched in that sandbox?
If it works well in sandbox, can you run the last jar on full production environment?
Regards,

Hi Konstantin

I ran our test class with the latest jar on AIX using IBM Websphere JDK1.4. It worked fine. I will run using the same jar on IBM Websphere portal server which is the actual environment and will update you.

Thanks
Rachel

Hi Konstantin,
I executed the merge functionality in the IBM Websphere portal server with the latest jar, i got the below error after eight documents got created. I have attached the sysout logs for your reference.

Error:/ by zero
java.lang.ArithmeticException: / by zero
at asposewobfuscated.tl.a(Unknown Source)
at asposewobfuscated.tl.b(Unknown Source)
at asposewobfuscated.tl.c(Unknown Source)
at asposewobfuscated.ow.a(Unknown Source)
at asposewobfuscated.ow.a(Unknown Source)
at asposewobfuscated.ow.a(Unknown Source)
at asposewobfuscated.ow.b(Unknown Source)
at com.aspose.words.cf.a(Unknown Source)
at com.aspose.words.Document.a(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)
at com.aspose.words.Document.save(Unknown Source)

Regards
Rachel

Hi Rachel,
Thanks for the info (and for interesting questions too:). The last jar doesn’t intended to fix the issue since it contains only logging additions.
I have mailed to you a new jar that contains some preliminary workaround (not only logging as previous jars). Please, try it.
And I have additional questions:

  1. What exact versions of your AIX, IBM JVM and Websphere for both computers where you launch the tests?
  2. Are you launching several Aspose.Words applications in the one portal or only one?
    About the issue I can say following. All errors are originated from the one small static utility method. The method just calculates the size of the FAT stream in sectors – simple arithmetic: two divisions, one choice and one ++ operand. In the first logs it adds extra 1, in the second – it doesn’t add needed 1. As a result in both cases we get broken FAT table and broken entire doc as well.
    All symptoms are very similar to famous “double locking is broken” pre-1.5 jvm’s issue. You can see for instance http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html or just google the phrase.
    In both cases we have memory model violation – different threads asynchronously modifying/accessing the same field. And using of static methods and long variables as aggravant in both cases.
    But please note Aspose.Words doesn’t intend that its utility methods or something else can be used multithread. The developer should provide a firm sandbox for Aspose.Words when deploying its application into multithread environment.
    So I still have two versions for your issue:
  3. You are launching several copies of Aspose.Words concurrently (by an accident).
  4. Your JVM’s JIT contains a certain bug that causes memory violation problem in a particular case.
    Can you disable or tweak your JIT so we can exclude one version? You can disable JIT at all or only some functionality: https://www.ibm.com/support/pages/java-sdk/

Regards,

Hi Konstantin,
Thanks for your response. I have tested with the latest jar that you had shared. The merged documents are getting created successfully. Can we go ahead using the same jar in our production environment. If so, please share us the jar file removing the sysout logs.
Please find the informations that you had asked for:
AIX version - 5.3
IBM Websphere version - 6.0.2.3.1
Thanks
Rachel

Hi Rachel,
I have removed all logging staff from the jar. Please, check it (I have sent it as usual, by email). If it works for you I will include it into the next maintenance release.
Thanks for the info. Can you also provide the version of your jdk/jre?
BTW, Happy New Yar:)
Regards,

Hi Konstantin
Wish you too a very happy new year :slight_smile:
Thanks a lot for your support. The new jar is working and the documents are getting merged successfully. We are using the jre 1.4 version.
Regards
Rachel

We have published new version of Aspose.Words for java. This version contains fix of issue #7360 you have reported earlier.
You can download new version from here:
https://releases.aspose.com/words/net

Hi
We have the licensed version of Aspose Total.(Aspose.Cells for Java V2.0.0 New Release and Aspose.Words for Java 2.6.0). We are using the Aspose cells smart markers for excel merge. For xlsx file format, the merged file is corrupted. Does this version of Aspose cells support xlsx format for smart markers.
Regards
Rachel

Hi
Thanks for your request. You should ask this question in Aspose.Cells forum.
https://forum.aspose.com/c/cells/9
Our colleagues will answer you shortly.
Best regards.