reactor / BlockHound

Java agent to detect blocking calls from non-blocking threads.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

jvm crash during maven test run

simpleusr opened this issue · comments

Hi,

First of all thanks for the fantastic work, really appreciated.

I have a weird problem (jvm crash) when using BlockHound.

I am trying to use it on my integration test of an app. Indeed the app is somewhat complicated and I spin up some test containers
(https://www.testcontainers.org/) for kafka, db, elastic and use wiremock (http://wiremock.org/) for http dependency mocking.

When I run from my eclipse ide, the tests are fine. But running them via maven build makes jvm crash (and make tests fail)

I tried to nail down the issue and it seems to be a problem with blockhound coupling with wiremock (akthough not completely sure)

I implemented a minimal / simple reproducer project (https://github.com/simpleusr/ProblemDemoApp)

For all maven builds jvm crashes consistently as below but the place of crash seems to change randomly:

A fatal error has been detected by the Java Runtime Environment:

EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000000004000, pid=49856, tid=19168

JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18)
Java VM: Java HotSpot(TM) 64-Bit Server VM (25.25-b02 mixed mode windows-amd64 compressed oops)
Problematic frame:
C 0x0000000000004000

Failed to write core dump. Minidumps are not enabled by default on client versions of Windows

If you would like to submit a bug report, please visit:
http://bugreport.sun.com/bugreport/crash.jsp

--------------- T H R E A D ---------------

Current thread (0x0000000000f0d800): JavaThread "main" [_thread_in_Java, id=19168, stack(0x00000000028d0000,0x00000000029d0000)]

siginfo: ExceptionCode=0xc0000005, ExceptionInformation=0x0000000000000008 0x0000000000004000

Registers:
RAX=0x00000006c2141be8, RBX=0x000000001bdee2a0, RCX=0x0000000002ad3180, RDX=0x00000006c2141be8
RSP=0x00000000029cc710, RBP=0xe5585fd151001191, RSI=0x00000007c00c1690, RDI=0x0000000020ead828
R8 =0x00000006c1e03ff0, R9 =0x0000000000000000, R10=0x00000006c2141be8, R11=0x0000000002c04a80
R12=0x0000000000000000, R13=0x00000000029cc700, R14=0x00000000029cc7a8, R15=0x0000000000f0d800
RIP=0x0000000000004000, EFLAGS=0x0000000000010246

Top of Stack: (sp=0x00000000029cc710)
0x00000000029cc710: 0000000000000000 0000000000f0e3f0
0x00000000029cc720: 00000000029cc790 00000000029d77b0
0x00000000029cc730: 0000000000000000 00000000029d77b0
0x00000000029cc740: 00000006c2141be8 00000006c1e03fd0
0x00000000029cc750: 00000000029cc750 00000000249011e6
0x00000000029cc760: 00000000029cc7a8 0000000024901268
0x00000000029cc770: 0000000000000000 00000000249011f8
0x00000000029cc780: 00000000029cc740 00000000029cc7b0
0x00000000029cc790: 00000000029cc7b0 0000000002f230c4
0x00000000029cc7a0: 00000006c2141be8 00000006c21346a8
0x00000000029cc7b0: 0000000000000000 0000000000000000
0x00000000029cc7c0: 0000000000000000 0000000002af6a99
0x00000000029cc7d0: 0000000000000000 0000000000000000
0x00000000029cc7e0: 00000000029cc858 00000000029d7958
0x00000000029cc7f0: 0000000000000000 00000000029d7958
0x00000000029cc800: 00000006c21346a8 00000006c1e19050

Instructions: (pc=0x0000000000004000)
0x0000000000003fe0:
[error occurred during error reporting (printing registers, top of stack, instructions near pc), id 0xc0000005]

Register to memory mapping:

RAX=0x00000006c2141be8 is an oop
org.springframework.util.MultiValueMapAdapter$$Lambda$79/105579928

  • klass: 'org/springframework/util/MultiValueMapAdapter$$Lambda$79'
    RBX={method} {0x000000001bdee2a8} 'identity' '(Ljava/lang/Object;)Ljava/lang/Object;' in 'sun/invoke/util/ValueConversions'
    RCX=0x0000000002ad3180 is at begin+12 in a stub
    MethodHandle::interpreter_entry::_linkToStatic [0x0000000002ad3174, 0x0000000002ad3198[ (36 bytes)
    RDX=0x00000006c2141be8 is an oop
    org.springframework.util.MultiValueMapAdapter$$Lambda$79/105579928
  • klass: 'org/springframework/util/MultiValueMapAdapter$$Lambda$79'

I am sure that this is related with blockhound because if I remove it (which I do not want for my test) crash does not happen.

The only diference between eclipse run and maven run seems to be the runner initiating the test run but they all delegate to SpringJUnit4ClassRunner eventually

at com.mycompany.problemdemo.ProblemDemoAppIntegrationTest.<clinit>(ProblemDemoAppIntegrationTest.java:36)
at sun.misc.Unsafe.ensureClassInitialized(Native Method)
at sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:43)
at sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:142)
at java.lang.reflect.Field.acquireFieldAccessor(Field.java:1082)
at java.lang.reflect.Field.getFieldAccessor(Field.java:1063)
at java.lang.reflect.Field.get(Field.java:387)
at org.junit.runners.model.FrameworkField.get(FrameworkField.java:93)
at org.junit.runners.model.TestClass.collectAnnotatedFieldValues(TestClass.java:249)
at org.junit.runners.ParentRunner.classRules(ParentRunner.java:280)
at org.junit.runners.ParentRunner.withClassRules(ParentRunner.java:268)
at org.junit.runners.ParentRunner.classBlock(ParentRunner.java:217)
at org.junit.runners.ParentRunner.run(ParentRunner.java:412)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)

Any help would be appreciated

Regards

I replaced wiremock usage with mockserver test container
(ProblemDemoAppIntegrationTest2 in sample project )
The result is the same. So I changed the topic since this seems not be wiremock specific...

Hi @simpleusr,

I just tried running the project and it passed on my machine.

JRE version: Java(TM) SE Runtime Environment (8.0_25-b18) (build 1.8.0_25-b18)

it looks like you're running some very old build of Java 8 (mine was 1.8.0_275-b01), could you please try a newer one? It can be a bug in the JVM itself.

closing this one as we haven't heard back