You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When opening a file that is then truncated, the program crashes with a SIGBUS.
Platform
MacOS 14.3
tl v1.0.0
How to reproduce
The easiest way is to create a large file with a bunch of lines, run tl bigfile.txt. Then, while tl is scanning for new lines, run truncate -s 0 bigfile.txt in another terminal.
Details
Using mmap() on a file the app doesn't own/control is problematic since changes to the file can mess up your process. It would probably be best to avoid mmap() and use regular file I/O instead.
While this may seem unlikely, it can happen in practice because of things like logrotate's copytruncate option which will copy the file contents and then truncate it.
The text was updated successfully, but these errors were encountered:
Description
When opening a file that is then truncated, the program crashes with a SIGBUS.
Platform
MacOS 14.3
tl v1.0.0
How to reproduce
The easiest way is to create a large file with a bunch of lines, run
tl bigfile.txt
. Then, while tl is scanning for new lines, runtruncate -s 0 bigfile.txt
in another terminal.Details
Using
mmap()
on a file the app doesn't own/control is problematic since changes to the file can mess up your process. It would probably be best to avoidmmap()
and use regular file I/O instead.While this may seem unlikely, it can happen in practice because of things like
logrotate
'scopytruncate
option which will copy the file contents and then truncate it.The text was updated successfully, but these errors were encountered: