ArrayIndexOutOfBoundsException withe BaseX version 8.5
Wednesday, 6 July 2016 · 2 messages · last reply 7 Jul 2016
SC
Simon Chatelain6 Jul 2016 15:11 #
Hello,
I just updated BaseX to the last version (8.5), and I am now facing some issues, while with the previous version (8.4.4) my application was working flawlessly.
My application receive XML documents from a TCP socket and store them in BaseX, in parallel and upon user request the same collection is queried. For both adding new documents and querying the collection, I am using a LocalSession, each one in its own thread.
The problem is that the following exception occurs very often, and when it happens, it seems to corrupt definitely the DB.
I wrote 2 simple test cases. The ArrayExceptionTest.java exhibits the problem while NoArrayExceptionTest.java does not.
The only difference between the 2 is:
· ArrayExceptionTest.java uses LocalSession for adding documents to and querying the collection
· NoArrayExceptionTest.java uses LocalSession only for querying the collection, adding documents in the collection is done by using directly the Context.
org.basex.core.BaseXException: Improper use? Potential bug? Your feedback is welcome:
Contact: basex-talk at mailman.uni-konstanz.de
Version: BaseX 8.5
Java: Oracle Corporation, 1.7.0_80
OS: Windows 7, x86
Stack Trace:
java.lang.ArrayIndexOutOfBoundsException: 2147483647
at
org.basex.io.random.TableDiskAccess.fpre(TableDiskAccess.java:501)
at
org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:452)
at
org.basex.io.random.TableDiskAccess.read2(TableDiskAccess.java:155)
at org.basex.data.Data.nameId(Data.java:360)
at org.basex.data.Data.name(Data.java:375)
at org.basex.query.value.node.DBNode.name(DBNode.java:169)
at org.basex.query.expr.path.NameTest.eq(NameTest.java:92)
at org.basex.query.func.db.DbAccess$1.next(DbAccess.java:67)
at org.basex.query.func.db.DbAccess$1.next(DbAccess.java:62)
at org.basex.query.iter.Iter.value(Iter.java:53)
at org.basex.query.expr.ParseExpr.value(ParseExpr.java:68)
at org.basex.query.QueryContext.value(QueryContext.java:417)
at
org.basex.query.expr.path.CachedPath.nodeIter(CachedPath.java:36)
at org.basex.query.expr.path.AxisPath.iter(AxisPath.java:78)
at org.basex.query.expr.path.AxisPath.iter(AxisPath.java:51)
at org.basex.query.expr.gflwor.For$1.next(For.java:109)
at org.basex.query.expr.gflwor.OrderBy$1.sort(OrderBy.java:76)
at org.basex.query.expr.gflwor.OrderBy$1.next(OrderBy.java:57)
at org.basex.query.expr.gflwor.GFLWOR$1.next(GFLWOR.java:96)
at org.basex.query.func.fn.FnCount.item(FnCount.java:27)
at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:44)
at org.basex.query.MainModule.iter(MainModule.java:118)
at org.basex.query.QueryContext.iter(QueryContext.java:340)
at org.basex.query.QueryProcessor.iter(QueryProcessor.java:91)
at org.basex.core.cmd.AQuery.query(AQuery.java:94)
at org.basex.core.cmd.XQuery.run(XQuery.java:22)
at org.basex.core.Command.run(Command.java:253)
at org.basex.core.Command.execute(Command.java:99)
at
org.basex.api.client.LocalSession.execute(LocalSession.java:132)
at org.basex.api.client.Session.execute(Session.java:36)
at
basextest.ArrayExceptionTest$1.run(ArrayExceptionTest.java:57)
at org.basex.core.Command.execute(Command.java:100)
at
org.basex.api.client.LocalSession.execute(LocalSession.java:132)
at org.basex.api.client.Session.execute(Session.java:36)
at
basextest.ArrayExceptionTest$1.run(ArrayExceptionTest.java:57)
Regards
Simon
CG
Christian Grün7 Jul 2016 12:31 #
Hi Simon,
Thanks, the problem has been fixed. We are currently collecting more feedback; the next patch release (8.5.1) will be due next week.
Cheers,
Christian
[1] http://files.basex.org/releases/latest/
Quoted text · Simon Chatelain · 139 lines
On Wed, Jul 6, 2016 at 3:11 PM, Simon Chatelain <schatela at gmail.com> wrote: > Hello, > > > > I just updated BaseX to the last version (8.5), and I am now facing some > issues, while with the previous version (8.4.4) my application was working > flawlessly. > > > > My application receive XML documents from a TCP socket and store them in > BaseX, in parallel and upon user request the same collection is queried. For > both adding new documents and querying the collection, I am using a > LocalSession, each one in its own thread. > > > > The problem is that the following exception occurs very often, and when it > happens, it seems to corrupt definitely the DB. > > > > I wrote 2 simple test cases. The ArrayExceptionTest.java exhibits the > problem while NoArrayExceptionTest.java does not. > > The only difference between the 2 is: > > · ArrayExceptionTest.java uses LocalSession for adding documents to > and querying the collection > > · NoArrayExceptionTest.java uses LocalSession only for querying the > collection, adding documents in the collection is done by using directly the > Context. > > > > org.basex.core.BaseXException: Improper use? Potential bug? Your feedback is > welcome: > > Contact: basex-talk at mailman.uni-konstanz.de > > Version: BaseX 8.5 > > Java: Oracle Corporation, 1.7.0_80 > > OS: Windows 7, x86 > > Stack Trace: > > java.lang.ArrayIndexOutOfBoundsException: 2147483647 > > at > org.basex.io.random.TableDiskAccess.fpre(TableDiskAccess.java:501) > > at > org.basex.io.random.TableDiskAccess.cursor(TableDiskAccess.java:452) > > at > org.basex.io.random.TableDiskAccess.read2(TableDiskAccess.java:155) > > at org.basex.data.Data.nameId(Data.java:360) > > at org.basex.data.Data.name(Data.java:375) > > at org.basex.query.value.node.DBNode.name(DBNode.java:169) > > at org.basex.query.expr.path.NameTest.eq(NameTest.java:92) > > at org.basex.query.func.db.DbAccess$1.next(DbAccess.java:67) > > at org.basex.query.func.db.DbAccess$1.next(DbAccess.java:62) > > at org.basex.query.iter.Iter.value(Iter.java:53) > > at org.basex.query.expr.ParseExpr.value(ParseExpr.java:68) > > at org.basex.query.QueryContext.value(QueryContext.java:417) > > at > org.basex.query.expr.path.CachedPath.nodeIter(CachedPath.java:36) > > at org.basex.query.expr.path.AxisPath.iter(AxisPath.java:78) > > at org.basex.query.expr.path.AxisPath.iter(AxisPath.java:51) > > at org.basex.query.expr.gflwor.For$1.next(For.java:109) > > at org.basex.query.expr.gflwor.OrderBy$1.sort(OrderBy.java:76) > > at org.basex.query.expr.gflwor.OrderBy$1.next(OrderBy.java:57) > > at org.basex.query.expr.gflwor.GFLWOR$1.next(GFLWOR.java:96) > > at org.basex.query.func.fn.FnCount.item(FnCount.java:27) > > at org.basex.query.expr.ParseExpr.iter(ParseExpr.java:44) > > at org.basex.query.MainModule.iter(MainModule.java:118) > > at org.basex.query.QueryContext.iter(QueryContext.java:340) > > at org.basex.query.QueryProcessor.iter(QueryProcessor.java:91) > > at org.basex.core.cmd.AQuery.query(AQuery.java:94) > > at org.basex.core.cmd.XQuery.run(XQuery.java:22) > > at org.basex.core.Command.run(Command.java:253) > > at org.basex.core.Command.execute(Command.java:99) > > at > org.basex.api.client.LocalSession.execute(LocalSession.java:132) > > at org.basex.api.client.Session.execute(Session.java:36) > > at > basextest.ArrayExceptionTest$1.run(ArrayExceptionTest.java:57) > > > > at org.basex.core.Command.execute(Command.java:100) > > at > org.basex.api.client.LocalSession.execute(LocalSession.java:132) > > at org.basex.api.client.Session.execute(Session.java:36) > > at > basextest.ArrayExceptionTest$1.run(ArrayExceptionTest.java:57) > > > > Regards > > > > Simon
Written for BaseX 8.5. BaseX may have changed since: please check the current documentation.
⚡Generated with XQuery