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

Deadlock when initializing MulticastSocket and DatagramSocket

    Details

    • Subcomponent:
    • Resolved In Build:
      b82
    • CPU:
      x86
    • OS:
      windows_7, windows_8
    • Verification:
      Verified

      Backports

        Description

        FULL PRODUCT VERSION :
        java version "1.8.0_25"
        Java(TM) SE Runtime Environment (build 1.8.0_25-b18)
        Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

        ADDITIONAL OS VERSION INFORMATION :
        Same experience on multiple windows platforms
        and with 1.7.51 and 1.8.25

        A DESCRIPTION OF THE PROBLEM :
        java deadlocks when
        MulticastSocket and DatagramSocket sockets are created at the same time in 2 threads

        REGRESSION. Last worked in version 7u51

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        // Threads 1 - Listener for DatagramPacket
        new MulticastSocket(6000);

        // Thread 2 - DatagramPacket Sender
        new DatagramSocket(6000);


        ERROR MESSAGES/STACK TRACES THAT OCCUR :
        Occasionally deadlocks with following stack trace for both threads

        Thread [MulticastSender]
        waiting for: (id=21)
        AbstractPlainDatagramSocketImpl.init() line: not available [native method] AbstractPlainDatagramSocketImpl.<clinit>() line: not available
        DefaultDatagramSocketImplFactory.createDatagramSocketImpl(boolean) line: not available
        DatagramSocket.createImpl() line: not available
        DatagramSocket.<init>(SocketAddress) line: not available
        DatagramSocket.<init>(int, InetAddress) line: not available
        DatagramSocket.<init>(int) line: not available
        MulticastSender.<init>(InetAddress, int, InetAddress) line: 35

        MulticastSender.init line 35 is: ds = new DatagramSocket(port);



        Thread [MulticastReceiver] (Suspended)
        waiting for: (id=27)
        DefaultDatagramSocketImplFactory.createDatagramSocketImpl(boolean) line: not available
        MulticastSocket(DatagramSocket).createImpl() line: not available
        MulticastSocket(DatagramSocket).<init>(SocketAddress) line: not available
        MulticastSocket.<init>(SocketAddress) line: not available
        MulticastSocket.<init>(int) line: not available
        MulticastReceiver.run() line: 48
         
        where MulticastReceiver.run line 48: ms = new MulticastSocket(port);

        REPRODUCIBILITY :
        This bug can be reproduced occasionally.

        CUSTOMER SUBMITTED WORKAROUND :
        synchronize construction

          Issue Links

            Activity

            Hide
            lpriima Lev Priima (Inactive) added a comment -
            probably fix of JDK-8001227 may help.
            Show
            lpriima Lev Priima (Inactive) added a comment - probably fix of JDK-8001227 may help.
            Hide
            igerasim Ivan Gerasimov added a comment -
            Show
            igerasim Ivan Gerasimov added a comment - Will need to re-request the review: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-February/031560.html
            Hide
            igerasim Ivan Gerasimov added a comment -
            Show
            igerasim Ivan Gerasimov added a comment - The review respinned: http://mail.openjdk.java.net/pipermail/core-libs-dev/2015-September/035041.html A regression test was added.
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/3884ca98c792
            User: igerasim
            Date: 2015-09-09 13:34:05 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/dev/jdk/rev/3884ca98c792 User: igerasim Date: 2015-09-09 13:34:05 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3884ca98c792
            User: lana
            Date: 2015-09-16 20:45:29 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/3884ca98c792 User: lana Date: 2015-09-16 20:45:29 +0000

              People

              • Assignee:
                igerasim Ivan Gerasimov
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: