This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 190476

Summary: java.io.IOException: error reading
Product: platform Reporter: Jan Lahoda <jlahoda>
Component: FilesystemsAssignee: Petr Nejedly <pnejedly>
Status: RESOLVED FIXED    
Severity: normal CC: jglick
Priority: P3    
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: DEFECT Exception Reporter: 172679
Attachments: stacktrace

Description Jan Lahoda 2010-09-21 10:03:01 UTC
This issue was reported manually by jlahoda.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build 100921-f4a15e384e39)
VM: Java HotSpot(TM) Client VM, 17.0-b16, Java(TM) SE Runtime Environment, 1.6.0_21-b06
OS: Linux

User Comments:
jlahoda: Seems to be related to suspend to ram.




Stacktrace: 
java.io.IOException: error reading
   at org.netbeans.modules.masterfs.watcher.LinuxNotifier.nextEvent(LinuxNotifier.java:124)
   at org.netbeans.modules.masterfs.watcher.Watcher$Ext.run(Watcher.java:141)
   at java.lang.Thread.run(Thread.java:619)
Comment 1 Jan Lahoda 2010-09-21 10:03:05 UTC
Created attachment 102091 [details]
stacktrace
Comment 2 Jesse Glick 2010-09-22 14:28:51 UTC
Yes, happened to me after I resumed from suspend and switched to the IDE.
Comment 3 Jan Lahoda 2010-09-23 19:33:18 UTC
FWIW: to reproduce, it is enough to suspend the IDE using Ctrl-Z from parent shell and then resume it using fg.
Comment 4 Petr Nejedly 2010-09-24 16:56:34 UTC
Thanks for such a nice test case.
I have reproduced the "problem" in a small native testing application and the errno (which I had difficulty accessing through JNA) revealed that the read ended in EINTR. Quite expectable.

The good news is that the system uses different signaling for event queue overflow and that if you re-issue the IO (which is what the OS expects you to do),
you'll get all the missed events and not necessarily the queue overflow either.

I'll try restarting the IO once (reset after each successful transfer) and only fail on double error. Or if I find a way to reach my thread's errno through JNA reliably, I can detect this condition correctly.
Comment 5 Jesse Glick 2010-09-24 17:29:32 UTC
AFAIK JNA supports access to errno, but I don't know much about it.
Comment 6 Petr Nejedly 2010-09-27 09:14:53 UTC
The errno access is working OK when linked from the right thread (it is a native thread local, after all).

Fixed: http://hg.netbeans.org/core-main/rev/685f9e2ba0cd