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

Rob Godfrey commented on QPID-6955:
-----------------------------------

So I think this is due to a bug I fixed this morning, which came to light after 
I committed my original change on QPID-6953.

The trivial fix in https://svn.apache.org/r1720340 should also apply to the 
6.0.0 code and I think would fix the issue (basically message.getSize() is 
returning 0 for all AMQP 1.0 messages, so an empty byte[] is being created to 
copy the message content into, causing the buffer overflow).

> BufferOverflowException downloading message content
> ---------------------------------------------------
>
>                 Key: QPID-6955
>                 URL: https://issues.apache.org/jira/browse/QPID-6955
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: qpid-java-6.0
>         Environment: Red Hat Enterprise Linux Server release 6.7 (Santiago)
> OpenJDK Runtime Environment (build 1.8.0_65-b17)
> OpenJDK 64-Bit Server VM (build 25.65-b01, mixed mode)
> 2015-12-16 13:32:09,111 INFO  [Broker-Config] (q.m.b.startup) - [Broker] 
> BRK-1001 : Startup : Version: 6.0.0 Build: 1717754
> 2015-12-16 13:32:09,116 INFO  [Broker-Config] (q.m.b.platform) - [Broker] 
> BRK-1010 : Platform : JVM : Oracle Corporation version: 1.8.0_65-b17 OS : 
> Linux version: 2.6.32-573.8.1.el6.x86_64 arch: amd64 cores: 1
> 2015-12-16 13:32:09,118 INFO  [Broker-Config] (q.m.b.max_memory) - [Broker] 
> BRK-1011 : Maximum Memory : Heap : 528,154,624 bytes Direct : 1,610,612,736 
> bytes
>            Reporter: Mark Soderquist
>
> Received the following exception when downloading message content from Qpid 
> HTTP Manager:
> 2015-12-16 13:29:31,768 ERROR [HttpManagement-HTTPS-117] 
> (o.a.q.s.m.p.f.ExceptionHandlingFilter) - Unexpected exception in servlet 
> '/api/latest/queue/default/default/ext-zions-validation-mock/getMessageContent':
>  
> java.nio.BufferOverflowException: null
>         at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:214) ~[na:1.8.0_65]
>         at 
> org.apache.qpid.bytebuffer.QpidByteBuffer.copyTo(QpidByteBuffer.java:236) 
> ~[qpid-common-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.store.berkeleydb.AbstractBDBMessageStore$StoredBDBMessage.getContent(AbstractBDBMessageStore.java:1113)
>  ~[qpid-bdbstore-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.message.AbstractServerMessageImpl.getContent(AbstractServerMessageImpl.java:178)
>  ~[qpid-broker-core-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.queue.AbstractQueue$MessageContentFinder.visit(AbstractQueue.java:3445)
>  ~[qpid-broker-core-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.queue.AbstractQueue.visit(AbstractQueue.java:1799) 
> ~[qpid-broker-core-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.queue.AbstractQueue.getMessageContent(AbstractQueue.java:3349)
>  ~[qpid-broker-core-6.0.0.jar:6.0.0]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
> ~[na:1.8.0_65]
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
> ~[na:1.8.0_65]
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  ~[na:1.8.0_65]
>         at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_65]
>         at 
> org.apache.qpid.server.model.ConfiguredObjectOperation.perform(ConfiguredObjectOperation.java:155)
>  ~[qpid-broker-core-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.RestServlet.doOperation(RestServlet.java:634)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.RestServlet.doGetWithSubjectAndActor(RestServlet.java:358)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet$1.run(AbstractServlet.java:90)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet$1.run(AbstractServlet.java:86)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at java.security.AccessController.doPrivileged(Native Method) 
> ~[na:1.8.0_65]
>         at javax.security.auth.Subject.doAs(Subject.java:422) ~[na:1.8.0_65]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.doWithSubjectAndActor(AbstractServlet.java:215)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.AbstractServlet.doGet(AbstractServlet.java:84)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:575) 
> ~[geronimo-servlet_3.0_spec-1.0.jar:1.0]
>         at 
> org.apache.qpid.server.management.plugin.servlet.rest.RestServlet.service(RestServlet.java:465)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) 
> ~[geronimo-servlet_3.0_spec-1.0.jar:1.0]
>         at 
> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684) 
> ~[jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1496)
>  [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.apache.qpid.server.management.plugin.filter.ForbiddingAuthorisationFilter.doFilter(ForbiddingAuthorisationFilter.java:90)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
>  [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.apache.qpid.server.management.plugin.filter.ForbiddingTraceFilter.doFilter(ForbiddingTraceFilter.java:65)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
>  [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.apache.qpid.server.management.plugin.filter.LoggingFilter.doFilter(LoggingFilter.java:70)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
>  [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.apache.qpid.server.management.plugin.filter.ExceptionHandlingFilter.doFilter(ExceptionHandlingFilter.java:60)
>  ~[qpid-broker-plugins-management-http-6.0.0.jar:6.0.0]
>         at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1467)
>  [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:501) 
> [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:229)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429) 
> [jetty-servlet-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) 
> [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at org.eclipse.jetty.server.Server.handle(Server.java:370) 
> [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:971)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1033)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:644) 
> [jetty-http-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235) 
> [jetty-http-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.server.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
>  [jetty-server-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.io.nio.SslConnection.handle(SslConnection.java:196) 
> [jetty-io-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:696)
>  [jetty-io-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:53)
>  [jetty-io-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>  [jetty-util-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at 
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>  [jetty-util-8.1.17.v20150415.jar:8.1.17.v20150415]
>         at java.lang.Thread.run(Thread.java:745) [na:1.8.0_65]



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to