title: rxtx fatal EXCEPTION_ACCESS_VIOLATION
body: <p>I'm having a problem with the RXTX library. I was trying to add support to my project for reading/writing to multiple serial ports at a time, and started receiving the following message at runtime.</p>
  
  <pre><code># A fatal error has been detected by the Java Runtime Environment:
  #
  #  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00000001800071cd, pid=9032, tid=5016
  #
  # JRE version: Java(TM) SE Runtime Environment (7.0_51-b13) (build 1.7.0_51-b13)
  # Java VM: Java HotSpot(TM) 64-Bit Server VM (24.51-b03 mixed mode windows-amd64 compressed oops)
  # Problematic frame:
  # C  [rxtxSerial.dll+0x71cd]
  #
  # Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
  #
  # An error report file with more information is saved as:
  # C:\Users\Jack\workspace\TestProject\hs_err_pid9032.log
  #
  # If you would like to submit a bug report, please visit:
  #   http://bugreport.sun.com/bugreport/crash.jsp
  # The crash happened outside the Java Virtual Machine in native code.
  # See problematic frame for where to report the bug.
  #
  </code></pre>
  
  <p>I've been able to isolate the code which produces this crash, and was hoping someone could provide an explanation as to why it's happening, and/or perhaps verify that this is indeed the expected behavior of rxtx (and not a result of some misconfiguration of my setup. RXTX does complain about the mismatch between my native-lib and jar everytime. native-lib 2.2pre2 and jar version 2.1-7, but I've ignored that to no apparent ill affect so far)</p>
  
  <p>The simplest code that produces the error:</p>
  
  <pre><code>public static void main(String[] args) throws Exception {
      CommPortIdentifier com13PI = CommPortIdentifier
              .getPortIdentifier("COM13");
      CommPortIdentifier com1PI = CommPortIdentifier
              .getPortIdentifier("COM1");
      SerialPort com13 = (SerialPort) com13PI.open(main.class.getName(), 400);
      SerialPort com1 = (SerialPort) com1PI.open(main.class.getName(), 400);
      com13.close();
      //com1.close();
      com13PI = CommPortIdentifier.getPortIdentifier("COM13");
      com13 = (SerialPort) com13PI.open(main.class.getName(), 400);
   }
  </code></pre>
  
  <p>The crucial line is the 'com1.close()' which is currently commented out. When uncommented, this code works fine. In it's current form, it produces the aforementioned exception.</p>
  
  <p>The documentation for RXTX is so lacking, I can't tell if this is the expected behavior or not. However, the ability to open and close one serial port, while another remains open seems like something that would crop up fairly often when using the RXTX library, so it seems a bit shocking if this is an unfixed bug in rxtx. If someone with rxtx installed could test this code and report back the results, or provide an explanation, I'd appreciate it. </p>