variar / klogg

Really fast log explorer based on glogg project
https://klogg.filimonov.dev
GNU General Public License v3.0
2.36k stars 207 forks source link

Klogg crash on file with long section of null characters #459

Open letsencrypt6 opened 2 years ago

letsencrypt6 commented 2 years ago

Details for the issue

What did you do?

just open one log file.


Crash id 5cdfe4e2-df42-4f01-9081-e6803a6c3ce7

Useful extra information

Klogg version 20.12.0.813 (built from commit 576b91d) [built for x86_64-little_endian-llp64] running on Windows 10 Version 2009 (winnt/10.0.19042) [x86_64] and Qt 5.15.2

letsencrypt6 commented 2 years ago

you can download the log file at the below link: https://drive.google.com/file/d/13yR_aOUdurYeIIozO4aTCfO02nOWL81T/view?usp=sharing

letsencrypt6 commented 2 years ago

Every time this file is opened, the program crashes and exits.

variar commented 2 years ago

Great! Many thanks for the file, as it is always hard to reproduce such issues locally. I’ll check it this week when I get home from vacation.

letsencrypt6 commented 2 years ago

Thanks a lot, Variar. the log from the Cisco IOS-XR router.

variar commented 2 years ago

I've checked the file. The structure of it is quite unusual. It has 4Gb zeroes at the beginning and then some meaningfull characters. Klogg is not smart enough to skip those zero bytes, and strings in Qt5 are limited to about 2^30 characters, so Qt crashes when klogg tries to read the text. Current dev versions will not crash but still is not able to handle this file. I'm not sure how that could be handled correctly in general case. I think that klogg can treat each zero byte as an empty line, that would allow to load the file. However, building an index for file with 2^32 lines will be slow, and it will use a log of memory.

variar commented 2 years ago

Works fine for the attached log in 22.04.0.1216+

letsencrypt6 commented 2 years ago

thanks a lot. Variar.

variar commented 2 years ago

Magic handling for long lines of null breaks search in some more common casese. Klogg needs to have support for lines with more than 2^30 characters.