Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9634

CacheLIRS: test failure with ARM processor (Apple M1)

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.42.0, 1.22.11
    • None

    Description

      In a ARM machine (MacBook with M1 chip) I get a "somewhat" reproducible failure as follows:

      [ERROR] Tests run: 3, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 2.304 s <<< FAILURE! - in org.apache.jackrabbit.oak.cache.ConcurrentTest
      [ERROR] testRandomOperations(org.apache.jackrabbit.oak.cache.ConcurrentTest)  Time elapsed: 1.068 s  <<< ERROR!
      java.lang.NullPointerException
      	at org.apache.jackrabbit.oak.cache.CacheLIRS$Segment.find(CacheLIRS.java:1323)
      	at org.apache.jackrabbit.oak.cache.CacheLIRS.peek(CacheLIRS.java:263)
      	at org.apache.jackrabbit.oak.cache.CacheLIRS.entrySet(CacheLIRS.java:545)
      	at org.apache.jackrabbit.oak.cache.CacheLIRS$1.entrySet(CacheLIRS.java:1731)
      	at org.apache.jackrabbit.oak.cache.ConcurrentTest$3.run(ConcurrentTest.java:210)
      

      If I slightly change the code (e.g. add try-catch in the find method), then it no longer fails. I think the problem is the different memory model of ARM chips, and so e.key is assigned a bit after the entry is added to the array.

      Making the key final resolved the issue for me.

      Attachments

        Issue Links

          Activity

            People

              thomasm Thomas Mueller
              thomasm Thomas Mueller
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: