{"action":"created","issue":{"url":"https://api.github.com/repos/guard/listen/issues/354","labels_url":"https://api.github.com/repos/guard/listen/issues/354/labels{/name}","comments_url":"https://api.github.com/repos/guard/listen/issues/354/comments","events_url":"https://api.github.com/repos/guard/listen/issues/354/events","html_url":"https://github.com/guard/listen/issues/354","id":116660458,"number":354,"title":"Directory scan sometimes crashes","user":{"login":"unjello","id":155669,"avatar_url":"https://avatars.githubusercontent.com/u/155669?v=3","gravatar_id":"","url":"https://api.github.com/users/unjello","html_url":"https://github.com/unjello","followers_url":"https://api.github.com/users/unjello/followers","following_url":"https://api.github.com/users/unjello/following{/other_user}","gists_url":"https://api.github.com/users/unjello/gists{/gist_id}","starred_url":"https://api.github.com/users/unjello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unjello/subscriptions","organizations_url":"https://api.github.com/users/unjello/orgs","repos_url":"https://api.github.com/users/unjello/repos","events_url":"https://api.github.com/users/unjello/events{/privacy}","received_events_url":"https://api.github.com/users/unjello/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/guard/listen/labels/bug","name":"bug","color":"e10c02"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-12T22:55:03Z","updated_at":"2015-11-13T16:45:31Z","closed_at":null,"body":"It looks like once in a while instead of filename as a key, and options as values sometimes values hold not a Hash but Float or Fixnum or String. I have temporarily added `values.is_a? Hash` if to the each block and it works, but didn't have time to root cause it why the values get passed like that.\r\n\r\nCrash stack:\r\n>E, [2015-11-12T23:32:00.713023 #62036] ERROR -- : fsevent: running worker failed: undefined method `key?' for 1447367514.0:Float: /Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/record.rb:59:in `block in dir_entries'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/record.rb:54:in `each'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/record.rb:54:in `dir_entries'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/directory.rb:10:in `scan'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/change.rb:56:in `invalidate'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/directory.rb:62:in `_change'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/directory.rb:27:in `block in scan'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/2.2.0/set.rb:283:in `each_key'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/2.2.0/set.rb:283:in `each'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/directory.rb:24:in `scan'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/change.rb:56:in `invalidate'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/base.rb:107:in `_queue_change'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/darwin.rb:45:in `block in _process_event'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/darwin.rb:40:in `each'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/darwin.rb:40:in `_process_event'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/base.rb:42:in `block (2 levels) in configure'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rb-fsevent-0.9.6/lib/rb-fsevent/fsevent.rb:45:in `call'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/rb-fsevent-0.9.6/lib/rb-fsevent/fsevent.rb:45:in `run'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/darwin.rb:51:in `_run_worker'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/darwin.rb:35:in `_run'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/adapter/base.rb:78:in `block in start'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/internals/thread_pool.rb:6:in `call'\r\n>/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/internals/thread_pool.rb:6:in `block in add'"},"comment":{"url":"https://api.github.com/repos/guard/listen/issues/comments/156483998","html_url":"https://github.com/guard/listen/issues/354#issuecomment-156483998","issue_url":"https://api.github.com/repos/guard/listen/issues/354","id":156483998,"user":{"login":"unjello","id":155669,"avatar_url":"https://avatars.githubusercontent.com/u/155669?v=3","gravatar_id":"","url":"https://api.github.com/users/unjello","html_url":"https://github.com/unjello","followers_url":"https://api.github.com/users/unjello/followers","following_url":"https://api.github.com/users/unjello/following{/other_user}","gists_url":"https://api.github.com/users/unjello/gists{/gist_id}","starred_url":"https://api.github.com/users/unjello/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/unjello/subscriptions","organizations_url":"https://api.github.com/users/unjello/orgs","repos_url":"https://api.github.com/users/unjello/repos","events_url":"https://api.github.com/users/unjello/events{/privacy}","received_events_url":"https://api.github.com/users/unjello/received_events","type":"User","site_admin":false},"created_at":"2015-11-13T16:45:30Z","updated_at":"2015-11-13T16:45:30Z","body":"Hey, can't upload full dumps right now - the easiest way for me to reproduce it is on some proprietary stuff and it'd take a while to strip it. Sorry in advance. I can probably spend some time trying to isolate a testing scenario, but here it is what I've found so far. Maybe you'll come up with a rootcause form the top of your head :)\r\n\r\nSo the issue seems to reproduce when you create and delete files. It does not happen every time you do that, but from 3 occurences I've checked it's always that. You create a file X, even fires up, you delete the file X and create file Y - event fires up again. On the second event what happens is:\r\n\r\nFile X is present in `previous.inspect` with uncleaned `:md5` property. No other file has it:\r\n```\r\n\"X\"=>{:mtime=>1447407967.0, :mode=>33188, :md5=>\"\\x9D\\\\-\\xA5|\\x05\\x19\\xEE\\x9D\\x9DH\\f?r|x\"}}\r\n```\r\nThen, in the processing loop this file is somehow misidentified as directory, and that's when it crashes:\r\n```\r\nD, [2015-11-13T17:28:38.073847 #71691] DEBUG -- : unknown: dir:/Users/angelo/test/X ({:recursive=>true})\r\nW, [2015-11-13T17:28:38.074029 #71691]  WARN -- : scan DIED: undefined method `key?' for 1447432111.0:Float:/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/record.rb:55:in `block in dir_entries'\r\n/Users/angelo/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/listen-3.0.4/lib/listen/record.rb:53:in `each'\r\n```"}}