[MNT-10876] Range Requests Can Fail For Files Over 2GB in Some Cases Created: 10-Mar-14  Updated: 18-Jul-14  Resolved: 01-Apr-14

Status: Closed
Project: Service Packs and Hot Fixes
Component/s: Web Scripts and Surf, WebDAV
Affects Version/s: 4.1.7, 4.2.1
Fix Version/s: 4.1.9

Type: Bug
Reporter: Ray Gauss [X] (Inactive) Assignee: Closed Bugs (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
relates to MNT-9770 WebDAV uploads over 2gb in size fails. Closed
Bug Priority:
Category 3
Build Location: http://releases.alfresco.com/Enterprise%204.1/4.1.9/build-00036/

 Description   

When dealing with files over 2GB some clients can issue requests with a byte range specification that causes a NegativeArraySizeException.

OS X's built-in WebDAV is one such client that can cause the following in the log:

15:46:36,750  DEBUG [alfresco.webdav.protocol] WebDAV request GET on path /alfresco/webdav/Sites/family/documentLibrary/Test/Concerts/Bob%20Marley.m4v
15:46:36,751  DEBUG [alfresco.webdav.protocol] Range header supplied: bytes=8184-
15:46:36,752  DEBUG [alfresco.webdav.protocol] Fetched node for path: 
   root: workspace://SpacesStore/87e71b2e-bf84-4434-a9bb-04a7ac852dcb
   path: /Sites/family/documentLibrary/Test/Concerts/Bob Marley.m4v
   result: FileInfo[name=Bob Marley.m4v, isFolder=false, nodeRef=workspace://SpacesStore/4a87a9ec-9814-4e60-89d3-ac425fa9b8d0]
15:46:36,754  DEBUG [web.util.HttpRangeProcessor] Processing: Content-Range: bytes 8184-2330108829/2330108830
15:46:36,754  ERROR [alfresco.webdav.protocol] Error while reading content
java.lang.NegativeArraySizeException
	at org.alfresco.repo.web.util.HttpRangeProcessor.streamRangeBytes(HttpRangeProcessor.java:469)
	at org.alfresco.repo.web.util.HttpRangeProcessor.processSingleRange(HttpRangeProcessor.java:228)
	at org.alfresco.repo.web.util.HttpRangeProcessor.processRange(HttpRangeProcessor.java:88)
	at org.alfresco.repo.webdav.GetMethod.attemptReadContent(GetMethod.java:318)
	at org.alfresco.repo.webdav.GetMethod.readContent(GetMethod.java:269)
	at org.alfresco.repo.webdav.GetMethod.executeImpl(GetMethod.java:259)
	at org.alfresco.repo.webdav.WebDAVMethod$2.execute(WebDAVMethod.java:398)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:342)
	at org.alfresco.repo.webdav.WebDAVMethod.execute(WebDAVMethod.java:406)
	at org.alfresco.repo.webdav.WebDAVServlet.service(WebDAVServlet.java:138)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.alfresco.repo.webdav.auth.AuthenticationFilter.doFilter(AuthenticationFilter.java:254)
	at sun.reflect.GeneratedMethodAccessor449.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.alfresco.repo.management.subsystems.ChainingSubsystemProxyFactory$1.invoke(ChainingSubsystemProxyFactory.java:125)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
	at com.sun.proxy.$Proxy319.doFilter(Unknown Source)
	at org.alfresco.repo.web.filter.beans.BeanProxyFilter.doFilter(BeanProxyFilter.java:82)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.alfresco.web.app.servlet.GlobalLocalizationFilter.doFilter(GlobalLocalizationFilter.java:61)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
	at org.apache.coyote.ajp.AjpProcessor.process(AjpProcessor.java:200)
	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
	at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:724)
15:46:36,755  INFO  [alfresco.webdav.protocol] GET took 5ms to execute [/alfresco/webdav/Sites/family/documentLibrary/Test/Concerts/Bob%20Marley.m4v]

The issue is similar to MNT-9770 in that a long value greater than Integer.MAX_VALUE is being cast to int which results in a negative int value.


Generated at Sun Oct 25 15:57:35 GMT 2020 using Jira 7.13.15#713015-sha1:7c5ddd2c3e1709974ae9c48c17df8edd3919fe2c.