ogham / exa

A modern replacement for ‘ls’.
https://the.exa.website/
MIT License
23.66k stars 661 forks source link

Guard against invalid timestamps crashing exa #566

Closed rustyrazorblade closed 4 years ago

rustyrazorblade commented 5 years ago

I just ran into a weird case where the hugo utility generated a directory with an incorrect modified timestamp, and when I tried to view the directory with exa it crashed. Here's the crash output:

jhaddad@rustyrazorbook ~/Dev/rustyrazorblade.com$ exa -al  
thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: SystemTimeError(6795364578.871345152s)', src/libcore/result.rs:999:5
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[1]    79816 abort      exa -al
jhaddad@rustyrazorbook ~/Dev/rustyrazorblade.com$ exa -a  
.git        .gradle  archetypes  build.gradle  content   gradle   gradlew.bat  public      resources  settings.gradle
.gitignore  .idea    bin         config.toml   examples  gradlew  Makefile     README.txt  scripts    themes

I removed flags from the exa command till I noticed the -l flag was causing the problem. I took a look at my directory and noticed this:

drwxr-xr-x  24 jhaddad  staff   768 Aug 30  1754 public

I doubt this will come up very often - I'm not even sure why that directory has such weird metadata. It was generated via the hugo utility.

After I touch the directory, the timestamp is fixed, and exa works again as expected.

KL1RL commented 4 years ago

Bingo, same problem with hugo over here too.

ogham commented 4 years ago

The fix for this (#670) has been merged and will go out with the next release.