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

Closing ResultSet from getMetaData on closed Connection crashes VM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 1.4.0
    • core-libs

    Description



      Name: rmT116609 Date: 04/23/2002


      FULL PRODUCT VERSION :
      java version "1.4.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-b92)
      Java HotSpot(TM) Client VM (build 1.4.0-b92, mixed mode)

      FULL OPERATING SYSTEM VERSION :
      Microsoft Windows 2000 [Version 5.00.2195] Service Pack 2

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      Connecting to an SQL Server 7 database.

      A DESCRIPTION OF THE PROBLEM :
      If you call ResultSet.close on a ResultSet returned by Connection.getMetaData after you close the Connection used, the virtual machine crashes with EXCEPTION_ACCESS_VIOLATION.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile and run the attached test program: java TestDB
      sun.jdbc.odbc.JdbcOdbcDriver jdbc:odbc:<odbc data source> <user>
      <password>

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      No output, or an SQLException. With J-netdirect's JSQLConnect driver,
      there is no output, but I guess an SQLException would be reasonable.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      An unexpected exception has been detected in native code outside the VM.
      Unexpected Signal :EXCEPTION_ACCESS_VIOLATION occurred at PC=0x41249C2E
      Function=[Unknown.]
      Library=(N/A)

      NOTE: We are unable to locate the function name symbol for the error
            just occurred. Please refer to release documentation for possible
            reason and solutions.


      Current Java thread:
      at sun.jdbc.odbc.JdbcOdbc.freeStmt(Native Method)
      at sun.jdbc.odbc.JdbcOdbc.SQLFreeStmt(JdbcOdbc.java:2797)
      at sun.jdbc.odbc.JdbcOdbcResultSet.close(JdbcOdbcResultSet.java:1469)
      - locked <02A32910> (a sun.jdbc.odbc.JdbcOdbcResultSet)
      at TestDB.main(TestDB.java:25)

      Dynamic libraries:
      0x00400000 - 0x00406000 c:\j2sdk1.4.0\bin\java.exe
      0x77F80000 - 0x77FFB000 C:\WINNT\System32\ntdll.dll
      0x77DB0000 - 0x77E0B000 C:\WINNT\system32\ADVAPI32.dll
      0x77E80000 - 0x77F35000 C:\WINNT\system32\KERNEL32.DLL
      0x77D40000 - 0x77DB0000 C:\WINNT\system32\RPCRT4.DLL
      0x78000000 - 0x78046000 C:\WINNT\system32\MSVCRT.dll
      0x6D330000 - 0x6D442000 c:\j2sdk1.4.0\jre\bin\client\jvm.dll
      0x77E10000 - 0x77E74000 C:\WINNT\system32\USER32.dll
      0x77F40000 - 0x77F7C000 C:\WINNT\system32\GDI32.DLL
      0x77570000 - 0x775A0000 C:\WINNT\System32\WINMM.dll
      0x6CA60000 - 0x6CA68000 C:\WINNT\System32\LPK.DLL
      0x66650000 - 0x666A4000 C:\WINNT\System32\USP10.dll
      0x681A0000 - 0x681A7000 C:\WINNT\System32\serwvdrv.dll
      0x66740000 - 0x66747000 C:\WINNT\System32\umdmxfrm.dll
      0x6D1D0000 - 0x6D1D7000 c:\j2sdk1.4.0\jre\bin\hpi.dll
      0x6D300000 - 0x6D30D000 c:\j2sdk1.4.0\jre\bin\verify.dll
      0x6D210000 - 0x6D228000 c:\j2sdk1.4.0\jre\bin\java.dll
      0x6D320000 - 0x6D32D000 c:\j2sdk1.4.0\jre\bin\zip.dll
      0x6D250000 - 0x6D25A000 C:\j2sdk1.4.0\jre\bin\JdbcOdbc.dll
      0x1F7D0000 - 0x1F804000 C:\WINNT\System32\ODBC32.dll
      0x76B30000 - 0x76B6E000 C:\WINNT\system32\comdlg32.dll
      0x77C70000 - 0x77CBA000 C:\WINNT\system32\SHLWAPI.DLL
      0x77B50000 - 0x77BD9000 C:\WINNT\system32\COMCTL32.DLL
      0x782F0000 - 0x78532000 C:\WINNT\system32\SHELL32.DLL
      0x1F8C0000 - 0x1F8D6000 C:\WINNT\System32\odbcint.dll
      0x77820000 - 0x77827000 C:\WINNT\system32\VERSION.dll
      0x759B0000 - 0x759B6000 C:\WINNT\system32\LZ32.DLL
      0x75170000 - 0x751BF000 C:\WINNT\System32\NETAPI32.dll
      0x77BE0000 - 0x77BEF000 C:\WINNT\System32\SECUR32.DLL
      0x751C0000 - 0x751C6000 C:\WINNT\System32\NETRAP.DLL
      0x75150000 - 0x75160000 C:\WINNT\System32\SAMLIB.DLL
      0x75030000 - 0x75043000 C:\WINNT\System32\WS2_32.DLL
      0x75020000 - 0x75028000 C:\WINNT\System32\WS2HELP.DLL
      0x77950000 - 0x77979000 C:\WINNT\system32\WLDAP32.DLL
      0x77980000 - 0x779A4000 C:\WINNT\System32\DNSAPI.DLL
      0x75050000 - 0x75058000 C:\WINNT\System32\WSOCK32.DLL
      0x779B0000 - 0x77A4B000 C:\WINNT\system32\OLEAUT32.dll
      0x77A50000 - 0x77B46000 C:\WINNT\system32\ole32.dll
      0x1F820000 - 0x1F83A000 C:\WINNT\System32\odbccp32.dll
      0x785C0000 - 0x785CC000 C:\WINNT\System32\rnr20.dll
      0x77340000 - 0x77353000 C:\WINNT\System32\iphlpapi.dll
      0x77520000 - 0x77525000 C:\WINNT\System32\ICMP.DLL
      0x77320000 - 0x77337000 C:\WINNT\System32\MPRAPI.DLL
      0x773B0000 - 0x773DE000 C:\WINNT\System32\ACTIVEDS.DLL
      0x77380000 - 0x773A2000 C:\WINNT\System32\ADSLDPC.DLL
      0x77830000 - 0x7783E000 C:\WINNT\System32\RTUTILS.DLL
      0x77880000 - 0x7790D000 C:\WINNT\System32\SETUPAPI.DLL
      0x77C10000 - 0x77C6D000 C:\WINNT\System32\USERENV.DLL
      0x774E0000 - 0x77512000 C:\WINNT\System32\RASAPI32.DLL
      0x774C0000 - 0x774D1000 C:\WINNT\System32\RASMAN.DLL
      0x77530000 - 0x77552000 C:\WINNT\System32\TAPI32.DLL
      0x77360000 - 0x77379000 C:\WINNT\System32\DHCPCSVC.DLL
      0x775A0000 - 0x77625000 C:\WINNT\System32\CLBCATQ.DLL
      0x777E0000 - 0x777E8000 C:\WINNT\System32\winrnr.dll
      0x777F0000 - 0x777F5000 C:\WINNT\System32\rasadhlp.dll
      0x74FD0000 - 0x74FEF000 C:\WINNT\system32\msafd.dll
      0x75010000 - 0x75017000 C:\WINNT\System32\wshtcpip.dll
      0x75500000 - 0x75504000 C:\WINNT\System32\security.dll
      0x782D0000 - 0x782EE000 C:\WINNT\system32\msv1_0.dll
      0x77920000 - 0x77943000 C:\WINNT\system32\imagehlp.dll
      0x72A00000 - 0x72A2D000 C:\WINNT\system32\DBGHELP.dll
      0x690A0000 - 0x690AB000 C:\WINNT\System32\PSAPI.DLL

      Local Time = Tue Apr 23 11:29:30 2002
      Elapsed Time =
      2
      #
      # The exception above was detected in native code outside the VM
      #
      # Java VM: Java HotSpot(TM) Client VM (1.4.0-b92 mixed mode)
      #
      # An error report file has been saved as hs_err_pid1276.log.
      # Please refer to the file for further information.
      #

      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      import java.sql.*;

      public class TestDB
      {
          public static void main( String[] args) throws SQLException, ClassNotFoundException
          {
      if ( args.length != 4 ) {
      throw new IllegalArgumentException( getUsage() );
      }
      String driver = args[ 0 ];
      String url = args[ 1 ];
      String user = args[ 2 ];
      String password = args[ 3 ];

      Class.forName( driver );
      Connection conn = DriverManager.getConnection( url, user, password );
      ResultSet rs = conn.getMetaData().getTables( null, null, "tbl_Foo", null );
      conn.close();
      rs.close();
          }

          public static String getUsage()
          {
      String usage = "java " + TestDB.class.getName() + " <jdbc driver>" + " <jdbc url>" + " <db user>" + " <db password";
       
      return usage;
          }
      }
      ---------- END SOURCE ----------

      CUSTOMER WORKAROUND :
      Close the ResultSet before closing the Connection!
      (Review ID: 145765)
      ======================================================================

      Attachments

        Issue Links

          Activity

            People

              ahandasunw Amit Handa (Inactive)
              rmandalasunw Ranjith Mandala (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: