Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ArrayIndexOutofBounds during connection [JDBC277] #147

Closed
firebird-automations opened this issue Oct 22, 2012 · 9 comments
Closed

ArrayIndexOutofBounds during connection [JDBC277] #147

firebird-automations opened this issue Oct 22, 2012 · 9 comments

Comments

@firebird-automations
Copy link

Submitted by: adam (kadam)

Attachments:
pump.xml

I am experiencing following exception

Caused by: pump.xml:33: java.lang.ArrayIndexOutOfBoundsException: 0
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:115)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1181)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:416)
... 17 more
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseAttachDatabaseInfo(AbstractJavaGDSImpl.java:558)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:441)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:369)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:86)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:477)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:119)
at org.firebirdsql.jdbc.FBDriver.connect(FBDriver.java:131)
at org.apache.tools.ant.taskdefs.JDBCTask.getConnection(JDBCTask.java:319)
at org.apache.tools.ant.taskdefs.SQLExec.execute(SQLExec.java:414)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.GeneratedMethodAccessor1934.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105)
... 24 more

Where pump.xml is an ant script invoking a sql task.
Server is under load - about 100 parallel connections.
I am not sure if this is driver or server problem, can you help me to analyze futher?

Server version is 2.1.3 18185, running on suse linux.
I am not able to reliably reproduce - happened just once.

thanks.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Can you consistently reproduce this error? If so, could you try Jaybird 2.2.1 and see if the error occurs with that as well (if so, please include the stacktrace under Jaybird 2.2.1)?

Does this script itself create a single connection, or multiple connections?

For Jaybird 2.2 I made some changes that are related to the parseAttachDatabaseInfo call (in JDBC190), it was for a different error, but I suspect it might be related.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Could you also describe what your script does?

@firebird-automations
Copy link
Author

Commented by: adam (kadam)

Attached the script.
It crashed during postpump target.
This script is invoked in parallel, but each time for another database instance/file(through the same server).

I am not able to reliably reproduce.. Has been observed just once.

@firebird-automations
Copy link
Author

Modified by: adam (kadam)

Attachment: pump.xml [ 12244 ]

@firebird-automations
Copy link
Author

Commented by: adam (kadam)

We've run the test with 2.2.1 driver. Stacktrace follows:
Caused by: java.lang.ArrayIndexOutOfBoundsException: 0
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseAttachDatabaseInfo(AbstractJavaGDSImpl.java:610)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:465)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:410)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:101)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:482)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:120)
at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:126)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:154)

Occured outside of that script this time.

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Could you provide the following additional information:
* Full Firebird version
* Full Java version
* OS/platform running Firebird
* OS/platform running the Java application
* Connection properties of the Jaybird connection
* Does the firebird.log contain any errors around the time that the application gave this error?

@firebird-automations
Copy link
Author

Commented by: @mrotteveel

Potentially readStatusVector might swallow an exception if the first reported error is a warning. Not sure if that could actually occur though.

@firebird-automations
Copy link
Author

Commented by: Panos Konstantinidis (konstpan)

I had for some time the same problem. When trying to concurrently open many new connections (around 150, each to different database) some of the connections threw the exception:

java.lang.ArrayIndexOutOfBoundsException: 0
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.parseAttachDatabaseInfo(AbstractJavaGDSImpl.java:610)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.internalAttachDatabase(AbstractJavaGDSImpl.java:465)
at org.firebirdsql.gds.impl.wire.AbstractJavaGDSImpl.iscAttachDatabase(AbstractJavaGDSImpl.java:410)
at org.firebirdsql.jca.FBManagedConnection.<init>(FBManagedConnection.java:101)
at org.firebirdsql.jca.FBManagedConnectionFactory.createManagedConnection(FBManagedConnectionFactory.java:482)
at org.firebirdsql.jca.FBStandAloneConnectionManager.allocateConnection(FBStandAloneConnectionManager.java:69)
at org.firebirdsql.jdbc.FBDataSource.getConnection(FBDataSource.java:120)
at org.firebirdsql.jdbc.AbstractDriver.connect(AbstractDriver.java:126)
at java.sql.DriverManager.getConnection(DriverManager.java:620)
at java.sql.DriverManager.getConnection(DriverManager.java:169)
....

Firebird 2.1.4 (Classic), jaybird 2.2.1, on FreeBSD 9

In the end, after examining firebird.log, the actual error for every failed connection was:
Fatal lock manager error: semaphores are exhausted, errno: 1

After increasing number of semaphores in firebird.conf (it was 25) the problem has not occurred again.

@firebird-automations
Copy link
Author

Modified by: @mrotteveel

status: Open [ 1 ] => Closed [ 6 ]

resolution: Cannot Reproduce [ 5 ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants