lnav icon indicating copy to clipboard operation
lnav copied to clipboard

assert failed in string_fragment::find_left_boundary

Open kcwu opened this issue 8 months ago • 1 comments

lnav version master

To Reproduce Steps to reproduce the behavior:

echo H4sIAESFEWgCA+PkNBg0gBMNEFCJWx8OA7CqwcJDFsUwAYtrpKPNzK0N/A0AQDaUxUwBAAA= | base64 -d | gzip -d | lnav -n
lnav: base/intern_string.hh:370: string_fragment string_fragment::find_left_boundary(size_t, P&&, size_t) const [with P = tag1; size_t = long unsigned int]: Assertion `(int) start <= this->length()' failed.
#4  0x00007ffff7432420 in __assert_fail_base (fmt=<optimized out>, assertion=<optimized out>, file=<optimized out>, line=370, function=<optimized out>) at ./assert/assert.c:118
#5  0x0000555555690cb4 in string_fragment::find_left_boundary<string_fragment::tag1> (count=1, predicate=..., start=<optimized out>, this=<optimized out>) at base/intern_string.hh:370
#6  0x0000555555690fca in string_fragment::find_left_boundary<string_fragment::tag1> (predicate=..., this=<optimized out>, start=<optimized out>, count=<optimized out>) at document.sections.cc:406
#7  lnav::document::discover_metadata_int (al=..., mb=...) at document.sections.cc:305
#8  0x0000555555c90a90 in lnav::document::structure_walker::walk (this=this@entry=0x7fffffff9b20) at document.sections.cc:782
#9  0x0000555555c8b0cc in lnav::document::discover_builder::perform (this=this@entry=0x7fffffff9cd0) at /usr/include/c++/14/bits/unique_ptr.h:191
#10 0x0000555555a488f8 in plain_text_source::replace_with_mutable (this=0x5555576d67a0, text_lines=..., tf=text_format_t::TF_UNKNOWN) at /home/kcwu/src/lnav/src/document.sections.hh:152
#11 0x0000555555b2b0b8 in textfile_sub_source::rescan_files (this=this@entry=0x555556f2a098 <lnav_data+46840>, callback=..., deadline=std::optional [no contained value])
    at /home/kcwu/src/lnav/src/logfile.hh:190
#12 0x000055555576e82a in rebuild_indexes (deadline=std::optional [no contained value]) at lnav.indexing.cc:245
#13 0x000055555576fb29 in rebuild_indexes_repeatedly () at lnav.indexing.cc:435
#14 0x00005555556c6cc1 in main (argc=<optimized out>, argv=<optimized out>) at lnav.cc:3912

found by afl++

kcwu avatar Apr 30 '25 02:04 kcwu

this failed with similar call stack

echo KLUv/WTzAiUBAMBSIigKMDAi9I6WjjAJCQkbWzY3OzBPMDADAABRt2AZ7QrQAV0MUqE= | base64 -d | zstd -d | lnav -n

kcwu avatar Jun 04 '25 02:06 kcwu