Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 7 issue when a files is delete in a directory raise a Native Exception #82

Closed
ph opened this issue Dec 8, 2015 · 11 comments
Closed

Comments

@ph
Copy link
Contributor

ph commented Dec 8, 2015

It was first reported by @jsvd

Under a Logstash shipping with JRuby 1.7.23 , when we watch a directory of files under Windows 7 and one of the file is deleted, the watch process is throwing a native exception and Logstash crash.

I don't see this behavior on Windows 2012 or Windows 10, only Windows 7 seems to be affected. If I revert to JRuby 1.7.22 it fixes the problem, we know that .23 changed some part of the stat handling for windows.

This look to be an error with the native calls inside one of the library that JRuby is using see this (error log)[https://gist.github.com/ph/c0dcc55573337a8d2296] for more details.

How to reproduce the bug:

Logstash config:

input {
  file {
   path => ["C:/logs/*.log"]
   sincedb_write_interval => 10000
  }
}
output {
 stdout {}
}

And use this script to randomly generate or delete files in the logs directory (You may need to adjust the path)

@enebo
Copy link

enebo commented Jan 14, 2016

@ph how long does this take to exhibit the problem? I have 1.7.23 installed (which has the bad jnr-posix installed with it) and I have not gotten a crash yet (running for 10-15 minutes). Is is possible C:/logs has an alternate name (not entirely sure I know what this is)?

@enebo
Copy link

enebo commented Jan 14, 2016

@ph actually ignore alternate name question. I just found out it is the 8.2 classic name.

@ph
Copy link
Contributor Author

ph commented Jan 14, 2016

@enebo takes 3-4 minutes?

@ph
Copy link
Contributor Author

ph commented Jan 14, 2016

Not more than that, I can consistently get it.

@enebo
Copy link

enebo commented Jan 14, 2016

@ph Also is this 32 bit or 64 bit win7? I am using 64 bit.

@enebo
Copy link

enebo commented Jan 14, 2016

@ph also is it 32 or 64 bit JVM?

@ph
Copy link
Contributor Author

ph commented Jan 14, 2016

32bits for both, but IIRC @jsvd is 64bits

@enebo
Copy link

enebo commented Jan 14, 2016

@ph thanks. Ok I am on 64 bit for both. I can try 32 bit JVM to see if something bad happens (I don't have 32 bit win7). If @jsvd could try it out to see if he is still crashing that might help (I did definitely fix an issue with FindFirstFile).

@enebo
Copy link

enebo commented Jan 14, 2016

hmm:
"If you are writing a 32-bit application to list all the files in a directory and the application may be run on a 64-bit computer, you should call the Wow64DisableWow64FsRedirectionfunction before calling FindFirstFile and call Wow64RevertWow64FsRedirection after the last call to FindNextFile. For more information, see File System Redirector."

from https://msdn.microsoft.com/en-us/library/windows/desktop/aa364418%28v=vs.85%29.aspx

If I don't could this be a crash?

@enebo
Copy link

enebo commented Jan 14, 2016

Nope...this appears to just redirect system directories so you do not see the wrong ones 64 bit when running 32 bit in file listings....ok sorry for spamming :)

ph added a commit to ph/logstash that referenced this issue Jan 21, 2016
This release fix the following problems we have:
  - File.stat on 32 bits JVM on windows logstash-plugins/logstash-input-file#82
  - Annoying io/console warning on Windows elastic#3087

Full changelog http://jruby.org/2016/01/20/jruby-1-7-24.html
ph added a commit to ph/logstash that referenced this issue Jan 21, 2016
This release fix the following problems we have:
- File.stat on 32 bits JVM on windows logstash-plugins/logstash-input-file#82
- Annoying io/console warning on Windows elastic#3087

Full changelog http://jruby.org/2016/01/20/jruby-1-7-24.html
elasticsearch-bot pushed a commit to elastic/logstash that referenced this issue Jan 21, 2016
This release fix the following problems we have:
- File.stat on 32 bits JVM on windows logstash-plugins/logstash-input-file#82
- Annoying io/console warning on Windows #3087

Full changelog http://jruby.org/2016/01/20/jruby-1-7-24.html

Fixes #4541
elasticsearch-bot pushed a commit to elastic/logstash that referenced this issue Jan 21, 2016
This release fix the following problems we have:
- File.stat on 32 bits JVM on windows logstash-plugins/logstash-input-file#82
- Annoying io/console warning on Windows #3087

Full changelog http://jruby.org/2016/01/20/jruby-1-7-24.html

Fixes #4541
@ph
Copy link
Contributor Author

ph commented Apr 12, 2016

This was fixed version Jruby 1.7.24 and newer
The bugs is present in logstash 2.3.1 and 2.X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants