cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Brown (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-13949) java.lang.ArrayIndexOutOfBoundsException while executing query
Date Wed, 11 Oct 2017 13:09:00 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-13949?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16200242#comment-16200242
] 

Jason Brown edited comment on CASSANDRA-13949 at 10/11/17 1:08 PM:
-------------------------------------------------------------------

I tried to reproduce using your attached scripts (very handy, thanks!) on a local running
instance of casandra, but was unable to reproduce the {{NullPointerException}}. I did however,
get a very curious output in the {{value}} field: at four point in the large json blob, there
are a few Kb of printed null characters {{\x00}}. See the attached image. I hexdump'ed your
insert.cql and it looked legit (no stray characters).

I then checked our json libs, and they are quite old - jackson*-1.9.2, committed in 2011!
The latest jackson jars are version 1.9.13 on maven central (from 2013). I naively replaced
the jars in lib/, and I didn't get the null character output anymore.

[~lrodriguez2002cu] Can you try simply replacing the jars and see if the NPE stops occurring?
If it does, then I'll create a more formal patch, run tests, and so on.


was (Author: jasobrown):
I tried to reproduce using your attached scripts (very handy, thanks!) on a local running
instance of casandra, but was unable to reproduce the {{NullPointerException}}. I did however,
get a very curious output in the {{value}} field: at four point in the large json blob, there
are a few Kb of printed null characters {{\x00}}. See the attached image. I hexdump'ed your
insert.cql and it looked legit (no stray characters).

I then checked our json libs, and they are quite old - jackson*-1.9.2, committed in 2011!
The latest jackson jars are version 1.9.13 on maven central (from 2013). I naively replaced
the jars in lib/, and I didn't get the null character output anymore.

Can you try simply replacing the jars and see if the NPE stops occurring? If it does, then
I'll create a more formal patch, run tests, and so on.

> java.lang.ArrayIndexOutOfBoundsException while executing query
> --------------------------------------------------------------
>
>                 Key: CASSANDRA-13949
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-13949
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>         Environment: Setup of 3 servers y using docker image [https://github.com/docker-library/cassandra/blob/ca3c9df03cab318d34377bba0610c741253b0466/3.11/Dockerfile]
>            Reporter: Luis E Rodriguez Pupo
>             Fix For: 3.11.x
>
>         Attachments: 13949.png, insert.cql, query.cql, schema.cql
>
>
> While executing a query on a  table contaninig a field with a (escaped) json, the following
exception occurs:
> java.lang.ArrayIndexOutOfBoundsException: null
>         at org.codehaus.jackson.io.JsonStringEncoder.quoteAsString(JsonStringEncoder.java:141)
~[jackson-core-asl-1.9.2.jar:1.9.2]
>         at org.apache.cassandra.cql3.Json.quoteAsJsonString(Json.java:45) ~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.db.marshal.UTF8Type.toJSONString(UTF8Type.java:66) ~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.selection.Selection.rowToJson(Selection.java:291)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.selection.Selection$ResultSetBuilder.getOutputRow(Selection.java:431)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.selection.Selection$ResultSetBuilder.build(Selection.java:417)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.statements.SelectStatement.process(SelectStatement.java:763)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.statements.SelectStatement.processResults(SelectStatement.java:400)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:378)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:251)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.statements.SelectStatement.execute(SelectStatement.java:79)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.QueryProcessor.processStatement(QueryProcessor.java:217)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:248)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:233)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.transport.messages.QueryMessage.execute(QueryMessage.java:116)
~[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:517)
[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.transport.Message$Dispatcher.channelRead0(Message.java:410)
[apache-cassandra-3.11.0.jar:3.11.0]
>         at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
[netty-all-4.0.44.Final.jar:4.0.44.Final]
>         at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:357)
[netty-all-4.0.44.Final.jar:4.0.44.Final]
>         at io.netty.channel.AbstractChannelHandlerContext.access$600(AbstractChannelHandlerContext.java:35)
[netty-all-4.0.44.Final.jar:4.0.44.Final]
>         at io.netty.channel.AbstractChannelHandlerContext$7.run(AbstractChannelHandlerContext.java:348)
[netty-all-4.0.44.Final.jar:4.0.44.Final]
>         at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_131]
>         at org.apache.cassandra.concurrent.AbstractLocalAwareExecutorService$FutureTask.run(AbstractLocalAwareExecutorService.java:162)
[apache-cassandra-3.11.0.jar:3.11.0]
>         at org.apache.cassandra.concurrent.SEPWorker.run(SEPWorker.java:109) [apache-cassandra-3.11.0.jar:3.11.0]
>         at java.lang.Thread.run(Thread.java:748) [na:1.8.0_131]
> Find attached the schema of the table, the insertion query with the data provoking the
failure, and the failing query.
>  



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org


Mime
View raw message