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

Deadlock between URLStreamHandler.getHostAddress and file.Handler.openconnection

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b06
    • CPU:
      x86
    • OS:
      windows_7

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.6.0_29"
        Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-10M3527)
        Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)


        ADDITIONAL OS VERSION INFORMATION :
        all OSs


        A DESCRIPTION OF THE PROBLEM :
        I've included the relevant deadlock stack trace below, but the root cause is that both

        java.net.URLStreamHandler.getHostAddress

        and

        sun.net.www.protocol.file.Handler.openconnection

        are synchronized. Either remove synchronized from getHostAddress and use a local lock object to protect that api or look at Handler and determine if you even need that to be synchronized or not (I didn't see any obvious reason it needed to be).


        "dbwriter for ws_attachments [Run1User1Cycle] writing 1 objects, started batch at Thu Feb 16 13:06:00 MST 2012" prio=5 tid=7fed77863800 nid=0x118a61000 waiting for monitor entry [118a5e000]
           java.lang.Thread.State: BLOCKED (on object monitor)
        at java.net.URLStreamHandler.getHostAddress(URLStreamHandler.java:412)
        - waiting to lock <7e002da38> (a sun.net.www.protocol.file.Handler)
        at java.net.URLStreamHandler.hostsEqual(URLStreamHandler.java:439)
        at sun.net.www.protocol.file.Handler.hostsEqual(Handler.java:117)
        at java.net.URLStreamHandler.sameFile(URLStreamHandler.java:396)
        at java.net.URLStreamHandler.equals(URLStreamHandler.java:316)
        at java.net.URL.equals(URL.java:842)
        at java.security.CodeSource.equals(CodeSource.java:135)
        at java.util.HashMap.get(HashMap.java:305)
        at java.security.SecureClassLoader.getProtectionDomain(SecureClassLoader.java:233)
        - locked <7e0040648> (a java.util.HashMap)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        - locked <7e00205b8> (a sun.misc.Launcher$AppClassLoader)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
        - locked <7e00205b8> (a sun.misc.Launcher$AppClassLoader)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
        - locked <7e04223c0> (a com.itko.lisa.test.TestExecClassLoader)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at org.eclipse.persistence.internal.jpa.deployment.PersistenceUnitProcessor.loadClass(PersistenceUnitProcessor.java:261)


        "ws_attachments [Run1User1Cycle]/0" daemon prio=5 tid=7fed7a80f000 nid=0x116172000 waiting for monitor entry [116170000]
           java.lang.Thread.State: BLOCKED (on object monitor)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:293)
        - waiting to lock <7e00205b8> (a sun.misc.Launcher$AppClassLoader)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.net.URL.getURLStreamHandler(URL.java:1144)
        at java.net.URL.<init>(URL.java:393)
        at java.net.URL.<init>(URL.java:283)
        at java.net.URL.<init>(URL.java:306)
        at sun.net.www.protocol.file.Handler.openConnection(Handler.java:74)
        - locked <7e002da38> (a sun.net.www.protocol.file.Handler)
        at sun.net.www.protocol.file.Handler.openConnection(Handler.java:55)
        - locked <7e002da38> (a sun.net.www.protocol.file.Handler)
        at java.net.URL.openConnection(URL.java:945)
        at java.net.URL.openStream(URL.java:1010)
        at javax.activation.URLDataSource.getInputStream(URLDataSource.java:92)
        at org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:118)
        at org.apache.axis.attachments.MimeUtils.getContentLength(MimeUtils.java:63)
        at org.apache.axis.attachments.AttachmentsImpl.getContentLength(AttachmentsImpl.java:461)
        at org.apache.axis.Message.getContentLength(Message.java:513)
        at com.itko.lisa.ws.axis.LisaHTTPSender$MessageRequestEntity.getContentMessageLength(LisaHTTPSender.java:989)


        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        It's hard to reproduce, but the stack traces are clear as to what the issue is

        EXPECTED VERSUS ACTUAL BEHAVIOR :
        EXPECTED -
        it should not deadlock
        ACTUAL -
        threads deadlock

        REPRODUCIBILITY :
        This bug can be reproduced occasionally.

        CUSTOMER SUBMITTED WORKAROUND :
        There are no work-arounds

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                jpai Jaikiran Pai
                Reporter:
                webbuggrp Webbug Group
                Votes:
                0 Vote for this issue
                Watchers:
                11 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: