1

I have an unique problem which happens in the user's system which is not reproducible in any other system. System does not crash.

So this my thread model. I have a main SWT thread which triggers few daemon threads and of which a daemon thread (Thread-1), does some operations and then do some file operations like getting the file attribute view and check for a file attribute. Logs are only printing before the file operations are performed.

I took a thread dump but strangely the thread-1 daemon was not listed there, so only reason could be that this thread-1 was done ? But if it was done it should have printed the file operations related logs.

This is the code for file operation part which is a suspect

UserDefinedFileAttributeView fileAttributeView = Files.getFileAttributeView(fullPath, UserDefinedFileAttributeView.class);
List<String> userAttributes = fileAttributeView.list();
if (userAttributes.contains("id")) {
    byte[] b = (byte[]) Files.getAttribute(fullPath, "id");
    String objectId = new String(b, "UTF-8");
    return objectId;
}

I have proper exception handling implemented such that any error in thread-1 would be printed. I am lost with ideas now. Is there anything which can be done ? Is there anyway the above file API calls can crash or gets blocked?

I know the scenario is bit hypothetical now rather than the code being shown, but I can't help much as the scenario is unique.

Jan
  • 13,738
  • 3
  • 30
  • 55
saurav
  • 5,388
  • 10
  • 56
  • 101
  • If this is a windows system, I'd run procmon to verify if the thread actually get's created and run. – Lieven Keersmaekers Dec 22 '15 at 13:19
  • I would add into the SWT threadsome checking for the existence and state of the Thread-1. Even more, if a problem could happen with Thread-1, it could happen with any thread. So, I would make SWT thread check all threads and make a nice report on demand. – Gangnus Dec 22 '15 at 15:36
  • thanks for your comments @LievenKeersmaekers and gangnus....will update this post once i find anything – saurav Dec 23 '15 at 03:36
  • Are you using any logging framework to log the message or doing a sysout? If it is some logging framework you may want to see if it is throwing some exception during startup and replace that log with sysout for your testing. Also, I might sound too pessimistic but one common oversight, am assuming you didn't forget to call the start method on Thread-1. – Madhusudana Reddy Sunnapu Dec 26 '15 at 09:20

0 Answers0