Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6940578

StringIndexOutOfBoundsException due to String.indexOf() intrinsic SSE 4.2 x86

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • 6u18
    • hotspot
    • x86
    • solaris_2.5.1

      FULL PRODUCT VERSION :
      java version "1.6.0_18"
      Java(TM) SE Runtime Environment (build 1.6.0_18-b07)
      Java HotSpot(TM) Client VM (build 16.0-b13, mixed mode)


      FULL OS VERSION :
      Red Hat Enterprise Linux AS release 4 (Nahant Update 8)
      Linux adc2100591 2.6.9-89.0.0.0.1.ELxenU #1 SMP Tue May 19 04:48:26 EDT 2009 i686 i686 i386 GNU/Linux


      A DESCRIPTION OF THE PROBLEM :
      We run into a JDK bug that appears to be present in the JDK build 1.6.0_18-b07 that we're currently consuming in our WebLogic product stack, and the bug only seems to manifest itself in x86-based Red Hat Linux boxes.

      ADF Faces/Apache Trinidad code that auto-generates CSS at runtime fails with StringIndexOutOfBoundsException because of this. The problem goes away if we specify the JVM option -XX:-UseSSE42Intrinsics or -Djava.compiler=NONE when starting WebLogic.
        
      We found a similar bug -- http://bugs.sun.com/view_bug.do?bug_id=6875866 that was apparently fixed in 6u18(b02). So we shouldn't be running into this problem with 1.6.0_18-b07. Also, the simple test case given in the mentioned bug does not reproduce. Perhaps this is some edge case that the fix did not cover?
       


      THE PROBLEM WAS REPRODUCIBLE WITH -Xint FLAG: Did not try

      THE PROBLEM WAS REPRODUCIBLE WITH -server FLAG: Yes

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      No simple reproducible test case available.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      java.lang.StringIndexOutOfBoundsException: String index out of range: -2
         at java.lang.String.substring(String.java:1937)
         at java.lang.String.substring(String.java:1904)
         at org.apache.myfaces.trinidadinternal.style.util.CSSGenerationUtils._getNSComponentSelector(CSSGenerationUtils.java:632)
         at org.apache.myfaces.trinidadinternal.style.util.CSSGenerationUtils.getNamespacedSelectors(CSSGenerationUtils.java:525)
         at org.apache.myfaces.trinidadinternal.style.cache.FileSystemStyleCache._getShortStyleClassMap(FileSystemStyleCache.java:1086)
         at org.apache.myfaces.trinidadinternal.style.cache.FileSystemStyleCache._getStyleSheetDocument(FileSystemStyleCache.java:652)
         at org.apache.myfaces.trinidadinternal.style.cache.FileSystemStyleCache._getEntry(FileSystemStyleCache.java:421)
         at org.apache.myfaces.trinidadinternal.style.cache.FileSystemStyleCache.getStyleSheetURIs(FileSystemStyleCache.java:177)
         at org.apache.myfaces.trinidadinternal.renderkit.core.xhtml.StyleSheetRenderer.encodeAll(StyleSheetRenderer.java:97)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1501)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer._renderSkinStylesheet(DocumentRenderer.java:1835)
         at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:781)
         at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1369)
         at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:335)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:751)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.__encodeRecursive(UIXComponentBase.java:1501)
         at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeAll(UIXComponentBase.java:771)
         at javax.faces.component.UIComponent.encodeAll(UIComponent.java:942)
         at com.sun.faces.application.ViewHandlerImpl.doRenderView(ViewHandlerImpl.java:271)
         at com.sun.faces.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:202)
         at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:189)
         at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:193)
         at oracle.ocs.web.admin.fwk.adf.phase.RenderResponsePhaseListener.beforePhase(RenderResponsePhaseListener.java:98)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:258)
         at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:205)
         at javax.faces.webapp.FacesServlet.service(FacesServlet.java:266)
         at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
         at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
         at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
         at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
         at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
         at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:97)


      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      The Apache MyFaces Trinidad could is opensource and available at http://tinyurl.com/ydba4xk


      ---------- END SOURCE ----------

            Unassigned Unassigned
            rlewis Roger Lewis (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: