[prev in list] [next in list] [prev in thread] [next in thread] 

List:       activemq-dev
Subject:    [GitHub] orpiske edited a comment on issue #2530: Native library fixes
From:       GitBox <git () apache ! org>
Date:       2019-01-30 12:45:53
Message-ID: 154885235308.3067.1875110875484268852.gitbox () gitbox ! apache ! org
[Download RAW message or body]

orpiske edited a comment on issue #2530: Native library fixes
URL: https://github.com/apache/activemq-artemis/pull/2530#issuecomment-458929152
 
 
   Also, when testing the change on the events structure, I think it unveils another \
issue. Since libaioContext is allocated on the stack and initialized by \
[io_queue_init](https://manpages.debian.org/jessie/libaio-dev/io_queue_init.2.en.html), \
calling free on it does not seem to be the correct way to perform the cleanup. I \
believe we should be calling \
[io_queue_release](https://manpages.debian.org/jessie/libaio-dev/io_queue_release.2.en.html) \
instead.   
   When using free to perform the cleanup on libaioContext, it causes this: 
   
   ```
   #
   # A fatal error has been detected by the Java Runtime Environment:
   #
   SUREFIRE-859: #  SIGSEGV (0xb) at pc=0x00007f4c60ab00f1, pid=16828, \
tid=0x00007f4c5f926700  #
   # JRE version: OpenJDK Runtime Environment (8.0_191-b13) (build 1.8.0_191-b13)
   # Java VM: OpenJDK 64-Bit Server VM (25.191-b13 mixed mode linux-amd64 compressed \
oops)  # Problematic frame:
   # C  [libc.so.6+0x870f1]  cfree+0x21
   #
   # Core dump written. Default location: \
/home/opiske/code/java/activemq-artemis/artemis-native/core or core.16828  #
   # An error report file with more information is saved as:
   # /home/opiske/code/java/activemq-artemis/artemis-native/hs_err_pid16828.log
   #
   SUREFIRE-859: # If you would like to submit a bug report, please visit:
   #   http://bugreport.java.com/bugreport/crash.jsp
   # The crash happened outside the Java Virtual Machine in native code.
   # See problematic frame for where to report the bug.
   #
   ```
   Replacing it with io_queue_release causes the test to fail with the correct \
behavior under failure:  
   ```
   -------------------------------------------------------
    T E S T S
   -------------------------------------------------------
   Running org.apache.activemq.artemis.jlibaio.test.CallbackCachelTest
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec - in \
org.apache.activemq.artemis.jlibaio.test.CallbackCachelTest  Running \
org.apache.activemq.artemis.jlibaio.test.LibaioTest  java.lang.RuntimeException: \
Can't initialize mutext (not enough memory for the events member): Success  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.newContext(Native Method)  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.<init>(LibaioContext.java:163)  at \
org.apache.activemq.artemis.jlibaio.test.LibaioTest.testAIO(LibaioTest.java:57)  at \
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  at \
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)  at \
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) \
at java.lang.reflect.Method.invoke(Method.java:498)  at \
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)  \
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
  at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
   	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
   	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:283)
  at org.apache.maven.surefire.junit4.JUnit4Provider.executeWithRerun(JUnit4Provider.java:173)
  at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
  at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:128)
   	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:203)
  at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:155)
  at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
   Tests run: 1, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 0.02 sec - in \
org.apache.activemq.artemis.jlibaio.test.LibaioTest  Running \
org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest  #test 0
   #test 0
   Tests run: 3, Failures: 0, Errors: 3, Skipped: 0, Time elapsed: 0.085 sec <<< \
FAILURE! - in org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest  \
testCloseAndStart(org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest)  \
Time elapsed: 0.035 sec  <<< ERROR!  java.lang.RuntimeException: Can't initialize \
mutext (not enough memory for the events member): Success  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.newContext(Native Method)  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.<init>(LibaioContext.java:163)  at \
org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest.testCloseAndStart(OpenCloseContextTest.java:167)
  
   testRepeatOpenCloseContext(org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest) \
Time elapsed: 0.03 sec  <<< ERROR!  java.lang.RuntimeException: Can't initialize \
mutext (not enough memory for the events member): Success  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.newContext(Native Method)  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.<init>(LibaioContext.java:163)  at \
org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest.testRepeatOpenCloseContext(OpenCloseContextTest.java:56)
  
   testRepeatOpenCloseContext2(org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest) \
Time elapsed: 0.02 sec  <<< ERROR!  java.lang.RuntimeException: Can't initialize \
mutext (not enough memory for the events member): Success  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.newContext(Native Method)  at \
org.apache.activemq.artemis.jlibaio.LibaioContext.<init>(LibaioContext.java:163)  at \
org.apache.activemq.artemis.jlibaio.test.OpenCloseContextTest.testRepeatOpenCloseContext2(OpenCloseContextTest.java:114)
  
   
   Results :
   
   Tests in error: 
     OpenCloseContextTest.testCloseAndStart:167  » Runtime Can't initialize mutext \
                (...
     OpenCloseContextTest.testRepeatOpenCloseContext:56  » Runtime Can't initialize \
                ...
     OpenCloseContextTest.testRepeatOpenCloseContext2:114  » Runtime Can't \
initializ...  ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic