YS-L / csvlens

Command line csv viewer
MIT License
2.47k stars 41 forks source link

Crash (panic) on Windows after a while with an "overflow when subtracting durations" error message #77

Closed gschizas closed 3 months ago

gschizas commented 4 months ago

On Windows 11, using latest version (0.8.1), and piping some data to csvlens, I get this error after a while (not immediately, mostly on idle):

The error seems to be overflow when subtracting durations

thread 'main' panicked at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\time.rs:954:31:
overflow when subtracting durations
stack backtrace:
   0:     0x7ff78d708cc9 - <unknown>
   1:     0x7ff78d5c411d - <unknown>
   2:     0x7ff78d705be1 - <unknown>
   3:     0x7ff78d708afa - <unknown>
   4:     0x7ff78d70b3b9 - <unknown>
   5:     0x7ff78d70b075 - <unknown>
   6:     0x7ff78d5f9b45 - <unknown>
   7:     0x7ff78d70b963 - <unknown>
   8:     0x7ff78d70b809 - <unknown>
   9:     0x7ff78d709399 - <unknown>
  10:     0x7ff78d70b482 - <unknown>
  11:     0x7ff78d73eb07 - <unknown>
  12:     0x7ff78d73eac2 - <unknown>
  13:     0x7ff78d5e7f73 - <unknown>
  14:     0x7ff78d5e7eb8 - <unknown>
  ...     14...78 are all the same
  78:     0x7ff78d5e7eb8 - <unknown>
  79:     0x7ff78d5e1076 - <unknown>
  80:     0x7ff78d60454f - <unknown>
  81:     0x7ff78d5fad2c - <unknown>
  82:     0x7ff78d6141b6 - <unknown>
  83:     0x7ff78d61e11c - <unknown>
  84:     0x7ff78d6ffdae - <unknown>
  85:     0x7ff78d60125c - <unknown>
  86:     0x7ff78d71990c - <unknown>
  87:     0x7fff0100257d - BaseThreadInitThunk
  88:     0x7fff01beaa48 - RtlUserThreadStart

The length of the backtrace varies (the number of 0x7ff78d5e7eb8 actually, the rest are the same). This happens both by reading a file from disk, and from piping data.

EDIT: If it helps, OS Version:

YS-L commented 3 months ago

Thanks for reporting! I pushed a potential fix to the main branch, but I don't have access to a Windows machine to reproduce or test this. It would be great if you can check if this still occurs in the main branch.

YS-L commented 3 months ago

Closing for now, feel free to reopen if the issue persists.

gschizas commented 3 months ago

I wasn't even able to reproduce it on the original build, or on an alternate computer :/ - I guess it's something to do with the number of processors.

Let's just assume it's working, those heisenbugs are the worst!

EDIT: Ok, using the installed (original) version, I was able to reproduce the error, but using the new version I don't see it. So, all good. Of course with these kinds of bugs, you really don't know, but it's good enough for me. Thank you!