JDK-4931889 : ArrayStoreException on BigInteger.toString() on Solaris x86
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.math
  • Affected Version: 1.4.2_02
  • Priority: P3
  • Status: Closed
  • Resolution: Cannot Reproduce
  • OS: solaris_9
  • CPU: x86
  • Submitted: 2003-10-02
  • Updated: 2005-11-30
  • Resolved: 2005-11-30
Related Reports
Relates :  
Description
This has only been noticed once and not easy to reproduce.  Below is the
exception stacktrace when the problem happened while a multi-threaded MQ 
test running 

The ArrayStoreException happened on (multi-threads run concurrently)
String userpwd = MD5.getHashString("guest" + ":" + "guest");
where MD5 does following:
----------------
 public static String getHashString(String plaintext) {
      try {
      return convertToString(getHash(plaintext.getBytes("UTF8")));
      } catch (java.io.UnsupportedEncodingException  e) {
      throw new RuntimeException(e.toString());
      }
  }

  public static byte[] getHash(byte[] plainText)  {
    try {
      MessageDigest md = MessageDigest.getInstance("MD5");
      return md.digest(plainText);
    }
    catch(Exception e) {
      throw new RuntimeException(e.toString());
    }
  }

  public static String convertToString(byte[] digest_ba) {
    return new BigInteger(digest_ba).toString(16);
  }

-------------------------------------------
com.sun.messaging.jms.JMSException: [C4038]: java.lang.ArrayStoreException
        at com.sun.messaging.jmq.jmsclient.ExceptionHandler.getJMSException(ExceptionHandler.java:327)
        at com.sun.messaging.jmq.jmsclient.ExceptionHandler.handleException(ExceptionHandler.java:279)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:585)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:263)
        at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:33)
        at com.sun.messaging.jmq.jmsclient.TopicConnectionImpl.<init>(TopicConnectionImpl.java:30)
        at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:102)
        at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:87)
        at test.jmsserver.conn.conLoad.TestRun.runTest(ThreadTest.java:203)
        at test.jmsserver.conn.conLoad.TestRun.run(ThreadTest.java:166)
        at java.lang.Thread.run(Thread.java:534)
Caused by: java.lang.ArrayStoreException
        at java.math.BigInteger.toString(BigInteger.java:2570)
        at com.sun.messaging.jmq.util.MD5.convertToString(MD5.java:41)
        at com.sun.messaging.jmq.util.MD5.getHashString(MD5.java:24)
        at com.sun.messaging.jmq.jmsclient.auth.JMQDigestAuthenticationHandler.handleRequest(JMQDigestAuthenticationHandler.java:58)
        at com.sun.messaging.jmq.jmsclient.ProtocolHandler.authenticate(ProtocolHandler.java:714)
        at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:668)
        at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:604)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.hello(ConnectionImpl.java:332)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:1743)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:561)
        ... 8 more
Linked ex is java.lang.ArrayStoreException
java.lang.ArrayStoreException
        at java.math.BigInteger.toString(BigInteger.java:2570)
        at com.sun.messaging.jmq.util.MD5.convertToString(MD5.java:41)
        at com.sun.messaging.jmq.util.MD5.getHashString(MD5.java:24)
        at com.sun.messaging.jmq.jmsclient.auth.JMQDigestAuthenticationHandler.handleRequest(JMQDigestAuthenticationHandler.java:58)
        at com.sun.messaging.jmq.jmsclient.ProtocolHandler.authenticate(ProtocolHandler.java:714)
        at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:668)
        at com.sun.messaging.jmq.jmsclient.ProtocolHandler.hello(ProtocolHandler.java:604)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.hello(ConnectionImpl.java:332)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.openConnection(ConnectionImpl.java:1743)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.init(ConnectionImpl.java:561)
        at com.sun.messaging.jmq.jmsclient.ConnectionImpl.<init>(ConnectionImpl.java:263)
        at com.sun.messaging.jmq.jmsclient.UnifiedConnectionImpl.<init>(UnifiedConnectionImpl.java:33)
        at com.sun.messaging.jmq.jmsclient.TopicConnectionImpl.<init>(TopicConnectionImpl.java:30)
        at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:102)
        at com.sun.messaging.ConnectionFactory.createTopicConnection(ConnectionFactory.java:87)
        at test.jmsserver.conn.conLoad.TestRun.runTest(ThreadTest.java:203)
        at test.jmsserver.conn.conLoad.TestRun.run(ThreadTest.java:166)
        at java.lang.Thread.run(Thread.java:534)
Received error on testAutocreate6, iteration 9, exiting thread early 

Comments
EVALUATION Closing as not reproducible.
30-11-2005

EVALUATION Instance of missing synchronization?
11-11-2005

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
14-06-2004

EVALUATION Given the description, it may be a transient problem difficult to reproduce or track down. A self-contained test case would ease investigation of this bug. Please indicate if this problem is observed on other platforms. ###@###.### 2003-10-28
28-10-2003