JDK-7194370 : (fs) WatchService fails if volume S/N is 0 [win]
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2012-08-27
  • Updated: 2013-04-03
  • Resolved: 2012-12-09
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b69Fixed
Description
FULL PRODUCT VERSION :
java version "1.7.0_06"
Java(TM) SE Runtime Environment (build 1.7.0_06-b24)
Java HotSpot(TM) Client VM (build 23.2-b09, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

EXTRA RELEVANT SYSTEM CONFIGURATION :
I have XP running in a VM using VMWare Fusion on OS X 10.8.1. I have smb file sharing turned on and I map a network drive from the XP to a shared directory on OS X.

A DESCRIPTION OF THE PROBLEM :
Using the WatchService to watch a directory in a Network Share whose Volume Serial Number is 0000-0000 causes hang.

java.lang.AssertionError: Should not get here
      at sun.nio.fs.WindowsFileAttributes.volSerialNumber(WindowsFileAttributes.java:387)
      at sun.nio.fs.WindowsWatchService$Poller.implRegister(WindowsWatchService.java:361)
      at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:260)
      at sun.nio.fs.WindowsWatchService$Poller.run(WindowsWatchService.java:531)
      at java.lang.Thread.run(Thread.java:722)


STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
On windows map a network drive to a smb share from os x.

Create a Directory Watcher (��java.nio.file.WatchService ) for a directory on the mapped drive.

Error occurs

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The directory watcher should handle this error better - probably should check the directory when the directory tries to register itself vs the error coming from the poll thread.
ACTUAL -
java.lang.AssertionError: Should not get here
      at sun.nio.fs.WindowsFileAttributes.volSerialNumber(WindowsFileAttributes.java:387)
      at sun.nio.fs.WindowsWatchService$Poller.implRegister(WindowsWatchService.java:361)
      at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:260)
      at sun.nio.fs.WindowsWatchService$Poller.run(WindowsWatchService.java:531)
      at java.lang.Thread.run(Thread.java:722)


ERROR MESSAGES/STACK TRACES THAT OCCUR :
java.lang.AssertionError: Should not get here
      at sun.nio.fs.WindowsFileAttributes.volSerialNumber(WindowsFileAttributes.java:387)
      at sun.nio.fs.WindowsWatchService$Poller.implRegister(WindowsWatchService.java:361)
      at sun.nio.fs.AbstractPoller.processRequests(AbstractPoller.java:260)
      at sun.nio.fs.WindowsWatchService$Poller.run(WindowsWatchService.java:531)
      at java.lang.Thread.run(Thread.java:722)


REPRODUCIBILITY :
This bug can be reproduced always.