Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

streampager crashes if input file is truncated #9

Closed
jsgf opened this issue Jun 4, 2019 · 0 comments
Closed

streampager crashes if input file is truncated #9

jsgf opened this issue Jun 4, 2019 · 0 comments

Comments

@jsgf
Copy link

jsgf commented Jun 4, 2019

When doing sp file (where file is large enough to need paging), if file is truncated then sp is killed with a SIGBUS. It should probably survive this.

@jsgf jsgf changed the title streampage crashes if input file is truncated streampager crashes if input file is truncated Jun 4, 2019
markbt added a commit that referenced this issue Jan 12, 2020
Implement a new reader for on-disk files, that reads the data out of the file
rather than mmapping it.

It's a bit simple right now, so it reloads each line from the file whenever it
wants to display it.  It would be better to go through some kind of LRU block
cache for loading chunks of the file.  The cache can be flushed whenever we
detect a reload is necessary.

The heuristic for append-vs-reload is whether the last 4k of the file has
changed or not.  Also, any time we try to parse a line and fine a newline
in the middle of the line, we trigger a full reload.

This should help with #8 and #9, as we now watch the file and load new contents
if the file is appended to, or reload the file if the contents change or the
file is truncated.

The mmap implementation is retained in case it will be useful, but for now is
unused.
markbt added a commit that referenced this issue Jan 12, 2020
Implement a new reader for on-disk files, that reads the data out of the file
rather than mmapping it.

It's a bit simple right now, so it reloads each line from the file whenever it
wants to display it.  It would be better to go through some kind of LRU block
cache for loading chunks of the file.  The cache can be flushed whenever we
detect a reload is necessary.

The heuristic for append-vs-reload is whether the last 4k of the file has
changed or not.  Also, any time we try to parse a line and fine a newline
in the middle of the line, we trigger a full reload.

This should help with #8 and #9, as we now watch the file and load new contents
if the file is appended to, or reload the file if the contents change or the
file is truncated.

The mmap implementation is retained in case it will be useful, but for now is
unused.
markbt added a commit that referenced this issue Jan 18, 2020
Implement a new reader for on-disk files, that reads the data out of the file
rather than mmapping it.

Reads to the file for display and search go through an LRU cache of 1MB blocks.

If a file change is detected, then depending on whether or not the file
has been appended to or rewritten, streampager will load the remaining data
or flush its caches and reload the file.

The heuristic for append-vs-reload is whether the last 4k of the file has
changed or not, or if any time we try to parse a line we find a newline
in the middle of the line.

This replaces the mmap implementation, giving a better experience for looking
at files on disk.

The mmap implementation is retained in case it will be useful, but for now is
unused.

Fixes #8
Fixes #9
markbt added a commit that referenced this issue Jan 18, 2020
Implement a new reader for on-disk files, that reads the data out of the file
rather than mmapping it.

Reads to the file for display and search go through an LRU cache of 1MB blocks.

If a file change is detected, then depending on whether or not the file
has been appended to or rewritten, streampager will load the remaining data
or flush its caches and reload the file.

The heuristic for append-vs-reload is whether the last 4k of the file has
changed or not, or if any time we try to parse a line we find a newline
in the middle of the line.

This replaces the mmap implementation, giving a better experience for looking
at files on disk.

The mmap implementation is retained in case it will be useful, but for now is
unused.

Fixes #8
Fixes #9
@markbt markbt closed this as completed in bfb5743 Jan 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant