[GLASSFISH-18826] Infinite(?) loop in UIComponentBase.publishAfterViewEvents Created: 22/Jun/12  Updated: 22/Feb/13  Resolved: 13/Nov/12

Status: Closed
Project: glassfish
Component/s: jsf
Affects Version/s: 3.1.1
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Vetle Leinonen-Roeim Assignee: rogerk
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Glassfish 3.1.1, Linux, JDK 1.6.0_24


Issue Links:
Related
is related to JAVASERVERFACES-2600 Infinite(?) loop in UIComponentBase.p... Closed
Tags: 311, jsf, mojarra

 Description   

When running performance tests on our application, we recently saw four threads using 100% CPU.
A thread dump reveals the following stack trace:

"http-thread-pool-8080(24)" daemon prio=10 tid=0x0000000054c2e800 nid=0x67a5 runnable [0x000000004e30f000]
java.lang.Thread.State: RUNNABLE
at javax.faces.component.UIComponent.popComponentFromEL(UIComponent.java:1961)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2214)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2202)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2202)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2210)
at javax.faces.component.UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2202)
at javax.faces.component.UIComponentBase.doPostAddProcessing(UIComponentBase.java:1883)
at javax.faces.component.UIComponentBase.setParent(UIComponentBase.java:400)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2631)
at javax.faces.component.UIComponentBase$ChildrenList.add(UIComponentBase.java:2603)
at com.sun.faces.facelets.tag.jsf.ComponentSupport.addComponent(ComponentSupport.java:559)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.addComponentToView(ComponentTagHandlerDelegateImpl.java:290)
at com.sun.faces.facelets.tag.jsf.ComponentTagHandlerDelegateImpl.apply(ComponentTagHandlerDelegateImpl.java:204)
at javax.faces.view.facelets.DelegatingMetaTagHandler.apply(DelegatingMetaTagHandler.java:120)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:98)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:308)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:367)
at com.sun.faces.facelets.impl.DefaultFacelet.include(DefaultFacelet.java:346)
at com.sun.faces.facelets.impl.DefaultFaceletContext.includeFacelet(DefaultFaceletContext.java:199)
at com.sun.faces.facelets.tag.ui.CompositionHandler.apply(CompositionHandler.java:155)
at com.sun.faces.facelets.compiler.NamespaceHandler.apply(NamespaceHandler.java:93)
at com.sun.faces.facelets.compiler.EncodingHandler.apply(EncodingHandler.java:86)
at com.sun.faces.facelets.impl.DefaultFacelet.apply(DefaultFacelet.java:152)
at com.sun.faces.application.view.FaceletViewHandlingStrategy.buildView(FaceletViewHandlingStrategy.java:769)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:410)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:343)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:215)

The threads seem to be stuck in UIComponentBase.publishAfterViewEvents. Unfortunately this bug is not consistent, and it's the first time that we've seen it during our performance tests.



 Comments   
Comment by chernanq88 [ 29/Oct/12 ]

I have gotten a very similar issue, the difference is that it happends on a weblogic 10.3.4, i have 4 instances of my application and it was shown only in one.
i use icefaces 3.0.0 but the Thread is Stuck in the same place, the behaviour is the same, the process consumes 100% CPU watching it from the Red Hat process list.

JSF Mojarra 2.1.9
Icefaces 3.0.0
Linux Red Hat
Weblogic 10.3.4
jrockit-jdk1.6.0_29-R28.2.2-4.1.0

this Stuck Thread was gotten when running performance tests and it has been Stuck for 4 days and it does not change its status yet.

"[STUCK] ExecuteThread: '68' for queue: 'weblogic.kernel.Default (self-tuning)'" id=192 idx=0x2fc tid=13408 prio=1 alive, native_blocked, daemon

at javax/faces/component/UIComponent.popComponentFromEL(UIComponent.java:1910)[optimized]

at javax/faces/component/UIComponent.popComponentFromEL(UIComponent.java:1936)[optimized]

at javax/faces/component/UIComponentBase.publishAfterViewEvents(UIComponentBase.java:2218)[optimized]

at javax/faces/component/UIComponentBase.doPostAddProcessing(UIComponentBase.java:1883)[inlined]

at javax/faces/component/UIComponentBase.setParent(UIComponentBase.java:400)[optimized]

at javax/faces/component/UIComponentBase$ChildrenList.add(UIComponentBase.java:2635)[inlined]

at javax/faces/component/UIComponentBase$ChildrenList.add(UIComponentBase.java:2607)[optimized]

at com/icesoft/faces/component/menubar/MenuItems.setParentsRecursive(MenuItems.java:127)[inlined]

at com/icesoft/faces/component/menubar/MenuItems.prepareChildren(MenuItems.java:99)[inlined]

at com/icesoft/faces/component/menubar/MenuItemsRenderer.encodeChildren(MenuItemsRenderer.java:37)[optimized]

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341)[optimized]

at com/icesoft/faces/component/menubar/MenuBarRenderer.encodeChildren(MenuBarRenderer.java:100)

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at javax/faces/component/UIComponent.encodeAll(UIComponent.java:1779)[optimized]

at javax/faces/render/Renderer.encodeChildren(Renderer.java:168)[optimized]

at org/icefaces/impl/renderkit/RendererWrapper.encodeChildren(RendererWrapper.java:49)

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341)[inlined]

at com/icesoft/faces/renderkit/dom_html_basic/GridRenderer.encodeChildren(GridRenderer.java:191)[optimized]

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341)[inlined]

at com/icesoft/faces/renderkit/dom_html_basic/GridRenderer.encodeChildren(GridRenderer.java:191)[optimized]

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341)[inlined]

at com/icesoft/faces/renderkit/dom_html_basic/GridRenderer.encodeChildren(GridRenderer.java:191)[optimized]

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341)[inlined]

at com/icesoft/faces/renderkit/dom_html_basic/GroupRenderer.encodeChildren(GroupRenderer.java:79)[optimized]

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at com/icesoft/faces/renderkit/dom_html_basic/DomBasicRenderer.encodeParentAndChildren(DomBasicRenderer.java:341)[inlined]

at com/icesoft/faces/renderkit/dom_html_basic/GroupRenderer.encodeChildren(GroupRenderer.java:79)[optimized]

at javax/faces/component/UIComponentBase.encodeChildren(UIComponentBase.java:845)[optimized]

at javax/faces/component/UIComponent.encodeAll(UIComponent.java:1779)[optimized]

at javax/faces/component/UIComponent.encodeAll(UIComponent.java:1782)[optimized]

at org/icefaces/impl/context/DOMPartialViewContext.processPartial(DOMPartialViewContext.java:146)[optimized]

at javax/faces/component/UIViewRoot.encodeChildren(UIViewRoot.java:981)[optimized]

at javax/faces/component/UIComponent.encodeAll(UIComponent.java:1779)[optimized]

at com/sun/faces/application/view/FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:390)[optimized]

at com/sun/faces/application/view/MultiViewHandler.renderView(MultiViewHandler.java:131)[inlined]

at com/sun/faces/lifecycle/RenderResponsePhase.execute(RenderResponsePhase.java:121)[optimized]

at com/sun/faces/lifecycle/Phase.doPhase(Phase.java:101)[optimized]

at com/sun/faces/lifecycle/LifecycleImpl.render(LifecycleImpl.java:139)[optimized]

at javax/faces/webapp/FacesServlet.service(FacesServlet.java:594)[optimized]

at weblogic/servlet/internal/StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)[optimized]

at weblogic/servlet/internal/StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)[inlined]

at weblogic/servlet/internal/ServletStubImpl.execute(ServletStubImpl.java:300)[optimized]

at weblogic/servlet/internal/TailFilter.doFilter(TailFilter.java:26)[optimized]

at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:311)[optimized]

at org/springframework/security/web/access/intercept/FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:116)[inlined]

at org/springframework/security/web/access/intercept/FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/access/ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/session/SessionManagementFilter.doFilter(SessionManagementFilter.java:101)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/authentication/AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/servletapi/SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:54)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/savedrequest/RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45)

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/authentication/AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:182)

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/authentication/logout/LogoutFilter.doFilter(LogoutFilter.java:105)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/context/SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/session/ConcurrentSessionFilter.doFilter(ConcurrentSessionFilter.java:125)[optimized]

at org/springframework/security/web/FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:323)[optimized]

at org/springframework/security/web/FilterChainProxy.doFilter(FilterChainProxy.java:173)[optimized]

at org/springframework/web/filter/DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346)[inlined]

at org/springframework/web/filter/DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:259)[optimized]

at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[optimized]

at weblogic/servlet/internal/RequestEventsFilter.doFilter(RequestEventsFilter.java:27)[optimized]

at weblogic/servlet/internal/FilterChainImpl.doFilter(FilterChainImpl.java:56)[inlined]

at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)[inlined]

at weblogic/servlet/internal/WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)[optimized]

at weblogic/security/acl/internal/AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)[optimized]

at weblogic/security/service/SecurityManager.runAs(SecurityManager.java:120)[inlined]

at weblogic/servlet/internal/WebAppServletContext.securedExecute(WebAppServletContext.java:2277)[inlined]

at weblogic/servlet/internal/WebAppServletContext.execute(WebAppServletContext.java:2183)[optimized]

at weblogic/servlet/internal/ServletRequestImpl.run(ServletRequestImpl.java:1454)[optimized]

at weblogic/work/ExecuteThread.execute(ExecuteThread.java:207)[inlined]

at weblogic/work/ExecuteThread.run(ExecuteThread.java:176)[optimized]

at jrockit/vm/RNI.c2java(JJJJJ)V(Native Method)

– end of trace

Comment by Manfred Riem [ 13/Nov/12 ]

Closing as duplicate, see associated issue for resolution.

Comment by Manfred Riem [ 17/Dec/12 ]

Can you supply us with an example application (with sources) that demonstrates the problem? Can you verify if it is still an issue on the latest 2.1 release?

Comment by Manfred Riem [ 17/Jan/13 ]

Lowering priority on JSF side because of no response

Comment by cur3n4vjara1 [ 07/Feb/13 ]

I believe the issue is on these lines:

UIComponent.java
      for (UIComponent topComponent = componentELStack.peek();
           topComponent != this;
           topComponent = componentELStack.peek())
      {
          topComponent.popComponentFromEL(context);
      }

Is it possible that this goes on forever if the component is not in the stack, due to UIComponent not being thread safe?
Thanks

Comment by Manfred Riem [ 20/Feb/13 ]

Can you verify if the application in question is using component binding?

Comment by Vetle Leinonen-Roeim [ 22/Feb/13 ]

Yes, our application does use component binding in some places.

We have not had time to do more testing on this issue, but will start performance testing again soon, and let you know if we have more details.

Generated at Mon May 25 07:37:44 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.