bensadeh/tailspin

Can't access a file through a symlink

TerDale opened this issue · 4 comments

tailspin crashes with a file accessed via symlink:

$ ls -l /tmp
lrwxr-xr-x@ 1 root  wheel  11 Dec 15 15:43 /tmp -> private/tmp
$ \cat /tmp/tst
2024-04-04T18:22:45:825+0200 INFO    {something here} class.path.ClassName:215 some message

$ tspin /tmp/tst
tspin /tmp/tst
The application panicked (crashed).
Message:  Could not add file to linemux: Custom { kind: Other, error: Error { kind: Generic("No such file or directory (os error 2) about [\"/Users/jmdelatre/dev/projects/identity-server/private/tmp\"]"), paths: [] } }
Location: src/io/reader/linemux.rs:41

  ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ BACKTRACE ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                ⋮ 9 frames hidden ⋮
  10: tokio::runtime::park::CachedParkThread::block_on::{{closure}}::hfad963a99e690733
      at <unknown source file>:<unknown line>
  11: tokio::runtime::park::CachedParkThread::block_on::h94ffe7e9349b73ec
      at <unknown source file>:<unknown line>
  12: tokio::runtime::context::runtime::enter_runtime::h8c8f587a4ef7843e
      at <unknown source file>:<unknown line>
  13: tokio::runtime::runtime::Runtime::block_on::h1796d210888213b2
      at <unknown source file>:<unknown line>
  14: tspin::main::h7b3122842da474a0
      at <unknown source file>:<unknown line>
  15: std::sys_common::backtrace::__rust_begin_short_backtrace::h2ea01f86d0940228
      at <unknown source file>:<unknown line>
  16: std::rt::lang_start::{{closure}}::hfc34fbb878ba1f4e
      at <unknown source file>:<unknown line>
  17: std::panicking::try::h74b7a94cf51f8766
      at <unknown source file>:<unknown line>
  18: std::rt::lang_start_internal::hb20de8572a8d2d4d
      at <unknown source file>:<unknown line>
  19: _main<unknown>
      at <unknown source file>:<unknown line>
$ tspin /private/tmp/tst
[=> less]
2024-04-04T18:22:45:825+0200 INFO    {something here} class.path.ClassNamese:215 some message

/var/folders/6p/38g5_jq16t5bjlrh01p95f700000gn/T/.tmpHEPtc2/tailspin.temp.1038272032 (END)

Thank you for opening this ticket with such clear steps to reproduce. This should definitely be supported.

I wasn't able to reproduce this on my machine, but I added a step to resolve symlinks in 62e48f7. Let me know if this changes anything for you.

Closing due to inactivity and since I cannot reproduce it on my machine (symlinks seem to be resolved properly as-is). Feel free to reopen and test with the commit if needed.

Same bug here on macOS 14.5. I think some part resolved this symlink (/tmp to /private/tmp on macOS) but used it as a local path (private/tmp, or $PWD/private/tmp).