TravaOpenJDK / trava-jdk-11-dcevm

dcevm-11 built on Travis
Apache License 2.0
403 stars 57 forks source link

Application Crash on hotswap attempt #42

Open OOP-778 opened 3 years ago

OOP-778 commented 3 years ago
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007fa0fa2109d4, pid=5821, tid=5836
#
# JRE version: OpenJDK Runtime Environment AdoptOpenJDK (11.0.9+2) (build 11.0.9+2-202011221359)
# Java VM: Dynamic Code Evolution 64-Bit Server VM AdoptOpenJDK (11.0.9+2-202011221359, mixed mode, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x99a9d4][thread 6122 also had an error]
  VM_EnhancedRedefineClasses::do_topological_class_sorting(Thread*)+0x224
#
# No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /root/server/dev/hs_err_pid5821.log
#
# If you would like to submit a bug report, please visit:
#   https://github.com/AdoptOpenJDK/openjdk-support/issues
#

My startup: java -DIReallyKnowWhatIAmDoingISwear -Xms3G -Xmx3G -XX:HotswapAgent=fatjar -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 -XX:-OmitStackTraceInFastThrow ->

skybber commented 3 years ago

Are you able to reproduce the problem ?

OOP-778 commented 3 years ago

I'm not sure how to reproduce as it doesn't matter what I change or do and try to hot-swap it just crashes my application. Not sure if it has something to do with, but it's a remote application.

skybber commented 3 years ago

Could you create minimalistic example?

jebeaudet commented 2 years ago

I don't have a core dump but I have a more complete pid hs_err log, would that help?

skybber commented 2 years ago

do you still have this problem?

jebeaudet commented 2 years ago

I've moved to JBR dcevm because of this since it was unstable for me sorry.

jebeaudet commented 2 years ago

Though I saw you released a new version, I can give that a try!

dejavumaster commented 2 years ago

Hi, I'm experimenting the same problem. Could you give me any hint? Thanks in advance,

Though I saw you released a new version, I can give that a try!

skybber commented 2 years ago

Is the problem reproducible or is it completely random?

DejmalDavid commented 11 months ago

I get this error message too. I use hotswap inside docker container and problem was in user permission. On recompiled class was changed user permission (access only for root). On reload that class disappear for dcevm because of permission and whole application crash.

Aliaksei-Tatarynchyk commented 6 months ago

I got the same issue in SpringBoot tests which used Mockito. And there was something else that was contributing to this issue because this Mockito stuff worked perfectly until the point when we added support of mongo gridfs, after which it started causing SIGSEGV crash. When I replaced Mockito mock with the regular class, it started working again.

What I had:

  @Bean
  @Primary
  public UuidProvider fakeUuidProvider() {
    final UuidProvider uuidProvider = mock(UuidProvider.class);
    given(uuidProvider.uuid()).willReturn(UUID.fromString(FAKE_UUID));
    return uuidProvider;
  }

My workaround to fix this SIGSEGV:

  @Bean
  @Primary
  public UuidProvider fakeUuidProvider() {
    return new FakeUuidProvider();
  }

  public static class FakeUuidProvider extends UuidProvider {
    public UUID uuid() {
      return UUID.fromString(FAKE_UUID);
    }
  }

I also attached the crash log - hs_err_pid37359.log

skybber commented 6 months ago

I recommend to use jbr17, if it is possible, since there are a lot of problems fixed, especially with Mockito and redefinition of java.lang.Object.