schell / steeloverseer

A file watcher and development tool.
BSD 3-Clause "New" or "Revised" License
128 stars 15 forks source link

Crashes on emacs lock files. (symbolic link without a real target) #12

Closed Prillan closed 4 years ago

Prillan commented 7 years ago

While editing a file, emacs creates a lock file (symbolic link) of the form .#filename → user@host.pid:timestamp (not sure if it's a real timestamp or not).

While checking file status on files in the target directory, sos crashes with the following message:

sos: /path/to/file: getFileStatus: does not exist (No such file or directory)

Steps to reproduce:

  1. Create an invalid link.

    $ cd /tmp
    $ ln -s /invalid/target link
  2. Run sos

    $ sos .
    sos: /tmp/link: getFileStatus: does not exist (No such file or directory)
schell commented 7 years ago

That's interesting. Thanks for the report, I'll see what I can find.

schell commented 7 years ago

@Prillan - does it happen even when you specify a pattern (one that doesn't match the lock file)?

Prillan commented 7 years ago

It does. Minimal example:

$ ln -s /invalid/link link
$ sos -p very_random_pattern
Hit Ctrl+C to quit.
sos: /tmp/test/link: getFileStatus: does not exist (No such file or directory)
mitchellwrosen commented 7 years ago

This looks like an fsnotify bug

mitchellwrosen commented 7 years ago

@schell Can I get commit access to the repo?

schell commented 7 years ago

You should be good to go, @mitchellwrosen - thanks 👍

schell commented 7 years ago

I'm on spacemacs now and this isn't happening. Methinks it's fixed?

Prillan commented 7 years ago

Try starting sos after emacs.

  1. Navigate to a clean folder
  2. Start emacs on a non-existing file $ emacs asdf &
  3. Type some stuff in emacs, do not save the file.
  4. Start sos
schell commented 7 years ago

Thanks for the update @Prillan. Temporarily can you use a pattern that excludes those files? Something like ^[#]*otherstuff$?

Prillan commented 7 years ago

I haven't needed to use the program for some time, so I'm fine for now.

schell commented 6 years ago

This doesn't crash for me, I see changes to these artifacts proc'ing if they are not excluded, which is expected.

schell commented 6 years ago

This only happens if you start sos in a directory where one of these files exists. If sos is started before that and then emacs creates the lock file, everything is business as usual.