Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8304326

App crashed while trying to read Spring session attributes with Problematic frame: # V [jvm.dll+0x760eca]

XMLWordPrintable

    • generic
    • generic

      ADDITIONAL SYSTEM INFORMATION :
      Windows 11 Pro Edition 22H2 OS build 22621.1344 Experience Windows Feature Experience Pack 1000.22639.1000.0

      java version "18.0.2.1" 2022-08-18 Java(TM) SE Runtime Environment (build 18.0.2.1+1-1) Java HotSpot(TM) 64-Bit Server VM (build 18.0.2.1+1-1, mixed mode, sharing)

      A DESCRIPTION OF THE PROBLEM :
      While trying to read Spring session attribute names the application crashed.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Create Spring Boot app.
      Create a component class that implements ApplicationListener<SessionCreationEvent>.
      Then you should override a method onApplicationEvent().
      Put this into method body:

      if (event.getSource() instanceof StandardSessionFacade standardSessionFacadeSource) {
          final Enumeration<String> attributeNames = standardSessionFacadeSource.getAttributeNames();
          while (attributeNames.hasMoreElements()) {
              final String s = attributeNames.nextElement();
              System.out.println(s);
          }
      }

      ACTUAL -
      Actual result is application crash:

      #
      # A fatal error has been detected by the Java Runtime Environment:
      #
      # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffea94c0eca, pid=16328, tid=9908
      #
      # JRE version: Java(TM) SE Runtime Environment (18.0.2.1+1) (build 18.0.2.1+1-1)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (18.0.2.1+1-1, mixed mode, emulated-client, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, windows-amd64)
      # Problematic frame:
      # V [jvm.dll+0x760eca]
      #
      # No core dump will be written. Minidumps are not enabled by default on client versions of Windows
      #
      # An error report file with more information is saved as:
      # E:\projects\TheVegCat\hs_err_pid16328.log
      #
      # If you would like to submit a bug report, please visit:
      # https://bugreport.java.com/bugreport/crash.jsp
      #


      ---------- BEGIN SOURCE ----------
      /*
       * TheVegCat - The Vegan Catalog.
       * Copyright (C) H.Lo
       * mailto:horvoje@gmail.com
       */
      package com.thevegcat.app.config;

      import java.util.Enumeration;

      import org.apache.catalina.session.StandardSessionFacade;
      import org.springframework.context.ApplicationListener;
      import org.springframework.security.core.session.SessionCreationEvent;
      import org.springframework.stereotype.Component;

      import lombok.extern.slf4j.Slf4j;

      /**
       * @author H.Lo
       */
      @Component @Slf4j
      public class SessionCreationEventApplicationListener implements ApplicationListener<SessionCreationEvent> {

      public SessionCreationEventApplicationListener() {
      log.trace("[BEANS] Successfully created bean {}", this.getClass().getSimpleName());
      }

      @Override
      public void onApplicationEvent(final SessionCreationEvent event) {
      log.info("Session created");
      if (event.getSource() instanceof StandardSessionFacade standardSessionFacadeSource) {
      final Enumeration<String> attributeNames = standardSessionFacadeSource.getAttributeNames();
      while (attributeNames.hasMoreElements()) {
      final String s = attributeNames.nextElement();
      System.out.println(s);
      }
      }
      }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Didn't find a workaround except removing component class.

            sswsharm swati sharma (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: