[jira] [Commented] (SLING-9925) ArrayIndexOutOfBoundsException in AbstractSlingFilterChain

2020-11-23 Thread Carsten Ziegeler (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17237372#comment-17237372
 ] 

Carsten Ziegeler commented on SLING-9925:
-

Reading the servlet spec and taking the reference implementation into account, 
the current implementation in the Sling engine seems to have the correct 
expectation, that it is only invoked once - and if an exception occurs it must 
not be invoked for another time.

However, an AIOOB exception is maybe not the nicest way of indicating this, an 
IllegalStateException might be more appropriate

> ArrayIndexOutOfBoundsException in AbstractSlingFilterChain
> --
>
> Key: SLING-9925
> URL: https://issues.apache.org/jira/browse/SLING-9925
> Project: Sling
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: Engine 2.7.2
>Reporter: Karl Pauls
>Priority: Major
> Fix For: Engine 2.7.4
>
>
> Apparently, it is possible for an AIOOB Exception to happen in the 
> AbstractSlingFilterChain. Unclear to me why but it looks like this:
> {code:java}
> rg.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught 
> Throwable
> java.lang.ArrayIndexOutOfBoundsException: Index 29 out of bounds for length 29
> at 
> org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:86)
>  [org.apache.sling.engine:2.7.2]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)


[jira] [Commented] (SLING-9925) ArrayIndexOutOfBoundsException in AbstractSlingFilterChain

2020-11-23 Thread Carsten Ziegeler (Jira)


[ 
https://issues.apache.org/jira/browse/SLING-9925?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17237354#comment-17237354
 ] 

Carsten Ziegeler commented on SLING-9925:
-

This sounds like an abuse in the invocation pattern. My guess is that a custom 
filter is catching an exception and when doing so, invoking the filter chain 
again - which means that the filter chain is invoked more often than 
anticipated.

However, we can probably easily fix this by decrementing this.current in the 
finally block of the doFilter method, restoring the state to the same values as 
before the invokation. 
We probably need to think about how to handle the timing of the filter method. 
So probably instead of setting times[filterIdx] in the filter method, 
incrementing it 

> ArrayIndexOutOfBoundsException in AbstractSlingFilterChain
> --
>
> Key: SLING-9925
> URL: https://issues.apache.org/jira/browse/SLING-9925
> Project: Sling
>  Issue Type: Bug
>  Components: Engine
>Affects Versions: Engine 2.7.2
>Reporter: Karl Pauls
>Priority: Major
> Fix For: Engine 2.7.3
>
>
> Apparently, it is possible for an AIOOB Exception to happen in the 
> AbstractSlingFilterChain. Unclear to me why but it looks like this:
> {code:java}
> rg.apache.sling.engine.impl.SlingRequestProcessorImpl service: Uncaught 
> Throwable
> java.lang.ArrayIndexOutOfBoundsException: Index 29 out of bounds for length 29
> at 
> org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:86)
>  [org.apache.sling.engine:2.7.2]
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)