Bug #5473 Possible bug in MySQL driver Out of memory
Submitted: 8 Sep 2004 14:14 Modified: 31 Mar 2014 7:46
Reporter: Jan Vitasek Email Updates:
Status: Can't repeat Impact on me:
None 
Category:Connector / J Severity:S2 (Serious)
Version:3.0.15 OS:Microsoft Windows (windows XP)
Assigned to: Alexander Soklakov CPU Architecture:Any

[8 Sep 2004 14:14] Jan Vitasek
Description:
I use JBossMQ and MySQL for message persistence.
JBoss throws exception which ends in this driver.
here is an exception:

java.lang.ArrayIndexOutOfBoundsException
MESSAGE: 1879

STACKTRACE:

java.lang.ArrayIndexOutOfBoundsException: 1879
	at com.mysql.jdbc.Buffer.readnBytes(Buffer.java:440)
	at com.mysql.jdbc.MysqlIO.unpackField(MysqlIO.java:419)
	at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:243)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1156)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
	at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
	at org.jboss.mq.pm.jdbc2.PersistenceManager.restoreQueue(PersistenceManager.java:454)
	at org.jboss.mq.server.JMSQueue.<init>(JMSQueue.java:44)
	at org.jboss.mq.server.jmx.Queue.startService(Queue.java:79)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
	at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
	at $Proxy0.start(Unknown Source)
	at org.jboss.system.ServiceController.start(ServiceController.java:373)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy4.start(Unknown Source)
	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy8.deploy(Unknown Source)
	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
	at $Proxy0.start(Unknown Source)
	at org.jboss.system.ServiceController.start(ServiceController.java:373)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy4.start(Unknown Source)
	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy5.deploy(Unknown Source)
	at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
	at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
	at org.jboss.Main.boot(Main.java:151)
	at org.jboss.Main$1.run(Main.java:405)
	at java.lang.Thread.run(Thread.java:595) 

How to repeat:
java.lang.ArrayIndexOutOfBoundsException
MESSAGE: 1879

STACKTRACE:

java.lang.ArrayIndexOutOfBoundsException: 1879
	at com.mysql.jdbc.Buffer.readnBytes(Buffer.java:440)
	at com.mysql.jdbc.MysqlIO.unpackField(MysqlIO.java:419)
	at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:243)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1156)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:2030)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1563)
	at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeQuery(WrappedPreparedStatement.java:296)
	at org.jboss.mq.pm.jdbc2.PersistenceManager.restoreQueue(PersistenceManager.java:454)
	at org.jboss.mq.server.JMSQueue.<init>(JMSQueue.java:44)
	at org.jboss.mq.server.jmx.Queue.startService(Queue.java:79)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
	at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
	at $Proxy0.start(Unknown Source)
	at org.jboss.system.ServiceController.start(ServiceController.java:373)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at org.jboss.system.ServiceController.start(ServiceController.java:395)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy4.start(Unknown Source)
	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy8.deploy(Unknown Source)
	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:305)
	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:481)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:204)
	at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:277)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:271)
	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:221)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:848)
	at $Proxy0.start(Unknown Source)
	at org.jboss.system.ServiceController.start(ServiceController.java:373)
	at sun.reflect.GeneratedMethodAccessor5.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:72)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy4.start(Unknown Source)
	at org.jboss.deployment.SARDeployer.start(SARDeployer.java:261)
	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:935)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:746)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:709)
	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:693)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:582)
	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:141)
	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:80)
	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:119)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:131)
	at org.jboss.mx.server.Invocation.invoke(Invocation.java:74)
	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:236)
	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:642)
	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
	at $Proxy5.deploy(Unknown Source)
	at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:396)
	at org.jboss.system.server.ServerImpl.start(ServerImpl.java:293)
	at org.jboss.Main.boot(Main.java:151)
	at org.jboss.Main$1.run(Main.java:405)
	at java.lang.Thread.run(Thread.java:595)
[8 Sep 2004 16:32] Eric Herman
In order to investigate this, it would be useful to be able to recreate this error. From the stack trace, all I can tell, so far, is that a Prepared Statement was executed. It then tries to read byte 1879 from the results from the server, which isn't there. Without an idea of what the tables are like, what the data is like, and what the query being executed is like, it is difficult to make a very good guess.

Ideally, it would be great to write a very small java program which:
  1) creates a test table(s)
  2) populates the table(s) with any required test data
  3) creates a prepared statement, and executes the query resulting in the stack trace
[31 Mar 2014 7:46] Alexander Soklakov
I close this report as "Can't repeat" because there is no feedback for a long time and codebase is too old. Please, feel free to reopen it if the problem still exists in current driver.