klogg icon indicating copy to clipboard operation
klogg copied to clipboard

Klogg crash on file with long section of null characters

Open letsencrypt6 opened this issue 3 years ago • 8 comments

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 avatar Apr 11 '22 14:04 letsencrypt6

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

letsencrypt6 avatar Apr 11 '22 14:04 letsencrypt6

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

letsencrypt6 avatar Apr 11 '22 14:04 letsencrypt6

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.

variar avatar Apr 11 '22 16:04 variar

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

letsencrypt6 avatar Apr 11 '22 16:04 letsencrypt6

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 avatar Apr 12 '22 19:04 variar

Works fine for the attached log in 22.04.0.1216+

variar avatar Apr 16 '22 11:04 variar

thanks a lot. Variar.

letsencrypt6 avatar Apr 21 '22 08:04 letsencrypt6

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.

variar avatar May 14 '22 12:05 variar