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

crash with # Problematic frame: # C [libc.so.6+0x95cec] __pthread_rwlock_rdlock+0xc

    XMLWordPrintable

Details

    Description

      ADDITIONAL SYSTEM INFORMATION :
      Ubuntu 22.10

      JRE version: Java(TM) SE Runtime Environment (17.0.5+9) (build 17.0.5+9-LTS-191)
      # Java VM: Java HotSpot(TM) 64-Bit Server VM (17.0.5+9-LTS-191, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)

      A DESCRIPTION OF THE PROBLEM :
      My app reads a smartcard, that works fine, but the app coredumps just before closing. I have reduced it to a very small app that coredumps as follows:

      ---- sample code ---
      package quicktests;

      import java.io.File;
      import java.io.FileOutputStream;
      import java.security.AuthProvider;
      import java.security.KeyStore;
      import java.security.Provider;
      import java.security.Security;
      import java.util.Enumeration;

      public class App {

          /**
           * @param args
           */
          public static void main(String[] args) {
              String driver = "/usr/lib/libaetpkss.so.3";
      try {
      String config = "name=UZICardReader" + System.lineSeparator() +
      "library=" + driver + System.lineSeparator() +
      "";

      File f = File.createTempFile("pkcs", ".cfg");

      try(FileOutputStream fos = new FileOutputStream(f)) {
      fos.write(config.getBytes("UTF8"));
      fos.flush();
      }

      Provider provider = Security.getProvider("SunPKCS11");
      System.out.println("config path: " + f.getAbsolutePath());
      provider = (AuthProvider) provider.configure(f.getAbsolutePath());
      Security.addProvider(provider);

                             // rest not needed for coredump, but in my case it really does read the contents of the card.
      KeyStore result = KeyStore.getInstance("PKCS11", provider);
      result.load(null, "532941".toCharArray());
      Enumeration<String> aliases = result.aliases();
      while (aliases.hasMoreElements()) {
      System.out.println(aliases.nextElement());
      }
      } catch (Exception e) {
      e.printStackTrace();
      }

          }
      }


      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See sample application in description. Run the java application.

      ACTUAL -
      Application reads the card, but coredumps before finishing

      ---------- BEGIN SOURCE ----------
      package quicktests;

      import java.io.File;
      import java.io.FileOutputStream;
      import java.security.AuthProvider;
      import java.security.KeyStore;
      import java.security.Provider;
      import java.security.Security;
      import java.util.Enumeration;

      public class App {

          /**
           * @param args
           */
          public static void main(String[] args) {
              String driver = "/usr/lib/libaetpkss.so.3";
      try {
      String config = "name=UZICardReader" + System.lineSeparator() +
      "library=" + driver + System.lineSeparator() +
      "";

      File f = File.createTempFile("pkcs", ".cfg");

      try(FileOutputStream fos = new FileOutputStream(f)) {
      fos.write(config.getBytes("UTF8"));
      fos.flush();
      }

      Provider provider = Security.getProvider("SunPKCS11");
      System.out.println("config path: " + f.getAbsolutePath());
      provider = (AuthProvider) provider.configure(f.getAbsolutePath());
      Security.addProvider(provider);

      // Next bit is not actually necessary for reproducing,
      // I just added it to verify that card reading works,
      // and it does work.
      KeyStore result = KeyStore.getInstance("PKCS11", provider);
      result.load(null, "532941".toCharArray());
      Enumeration<String> aliases = result.aliases();
      while (aliases.hasMoreElements()) {
      System.out.println(aliases.nextElement());
      }
      } catch (Exception e) {
      e.printStackTrace();
      }

          }
      }

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

      CUSTOMER SUBMITTED WORKAROUND :
      None found

      FREQUENCY : always


      Attachments

        Activity

          People

            valeriep Valerie Peng
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: