Faulty Winsock initialization code in src/os/windows/vm/os_windows.cpp

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • hs24
    • Affects Version/s: 7
    • Component/s: hotspot
    • None
    • x86
    • windows_nt

        Dan discovered a faulty Winsock initialization code in src/os/windows/vm/os_windows.cpp:initSock().

        Copied from Dan's email, the line number may not be accurate.
               This block is supposed to only allow one thread to init the
               WinSock2 stuff. Consider this scenario:

               - thread-1 makes it through line 4638 so it owns the mutex
               - thread-2 makes it past line 4635 so it calls mutexInit()
                 on the mutex that thread-1 owns; does this mess up the
                 mutex?
               - thread-1 finishes initializing WinSock2 and gets to line 4647
                 where it calls mutexUnlock() on the mutex; does this work when
                 thread-2 has called mutexInit() on the mutex?

              Assignee:
              Nils Eliasson (Inactive)
              Reporter:
              Zhengyu Gu
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: