Skip to content

Segmentation fault when trying to add an IN or OUT filter from past history #1614

@dardhal

Description

@dardhal

lnav version
Compiled from upstream code as of 2026-01-08

Describe the bug
When trying to add an IN filter navigating the history back in the list of previous filters added, "lnav" unexpectedly.

To Reproduce

  • Open lnav
  • Go to the "Text Filters" menu
  • Attempt to add an IN filter ("i")
  • Instead of typing a string or expression, arrow up to revisit the history
  • On hitting "ENTER" to accept the filter, "lnav" crashes
  • Same occurs when trying to add an "OUT filter"

The stack dump for the process looks as follows :

Program terminated with signal SIGSEGV, Segmentation fault.
Downloading source file /usr/src/debug/glibc-2.41-11.fc42.x86_64/nptl/pthread_join_common.c
#0  __pthread_clockjoin_ex (threadid=0, thread_return=thread_return@entry=0x1ed42ed8, clockid=clockid@entry=0, abstime=abstime@entry=0x0, block=block@entry=true) at pthread_join_common.c:43                                    
43       if (INVALID_NOT_TERMINATED_TD_P (pd))
[Current thread is 1 (Thread 0x7fc29397cc40 (LWP 399732))]
(gdb) bt
#0  __pthread_clockjoin_ex (threadid=0, thread_return=thread_return@entry=0x1ed42ed8, clockid=clockid@entry=0, abstime=abstime@entry=0x0, block=block@entry=true) at pthread_join_common.c:43
#1  0x00007fc294367b13 in ___pthread_join (threadid=<optimized out>, thread_return=thread_return@entry=0x1ed42ed8) at pthread_join.c:24
#2  0x0000000000d24707 in stop_inputlayer (ti=ti@entry=0x1ed383c0) at in.c:2787
#3  0x0000000000d39169 in free_terminfo_cache (ti=ti@entry=0x1ed383c0) at termdesc.c:197
#4  0x0000000000d29904 in notcurses_stop (nc=0x1ed380c0) at notcurses.c:1545
#5  0x00000000004c195a in screen_curses::log_crash_recover (this=0x7fff75d67e30) at /home/user/Lnav/lnav/src/view_curses.hh:67
#6  0x0000000000b4933e in operator()<const termios*> (__closure=<synthetic pointer>, termios=0x7fff75d68ea4) at lnav_log.cc:749
#7  operator|<std::optional<const termios*>&, sigabrt(int, siginfo_t*, void*)::<lambda(auto:33)> > (t=std::optional = {...}, f=...) at /home/user/Lnav/lnav/src/base/opt_util.hh:69
#8  sigabrt (sig=<optimized out>, info=<optimized out>, ctx=<optimized out>) at lnav_log.cc:747
#9  0x0000000000d3e4e9 in invoke_old (old=0x1043200 <old_segv>, signo=11, sinfo=0x1ed44170, v=0x1ed44040) at unixsig.c:136
#10 fatal_handler (signo=11, siginfo=0x1ed44170, v=0x1ed44040) at unixsig.c:151
#11 <signal handler called>
#12 mapbox::util::variant<long, role_t, text_attrs, intern_string_t, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::shared_ptr<logfile>, bookmark_metadata*, string_fragment, block_elem_t, styling::color_unit, ui_icon_t, char const*, ui_command, text_format_t>::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, (void*)0> (this=0x18) at ./mapbox/variant.hpp:720
#13 string_attr_wrapper<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::get<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > (this=<optimized out>)
    at base/attr_line.hh:96
#14 lnav::prompt::rl_completion (this=0xfbeb20 <lnav::prompt::get()::retval>, tc=...) at lnav.prompt.cc:532
#15 0x0000000000943f1e in textinput_curses::handle_key (this=0x1ed32660, ch=...) at textinput_curses.cc:1223
#16 0x0000000000699db8 in listview_curses::handle_key_using_delegates (this=this@entry=0xfc5cc8 <lnav_data+10408>, ch=...) at listview_curses.cc:208
#17 listview_curses::handle_key (this=this@entry=0xfc5cc8 <lnav_data+10408>, ch=...) at listview_curses.cc:219
#18 0x00000000004b9a86 in handle_config_ui_key (nc=0x1ed380c0, ch=..., keyseq=0x7fff75d679f0 "n4201761") at lnav.cc:756
#19 handle_key (nc=0x1ed380c0, ch=..., keyseq=0x7fff75d679f0 "n4201761") at lnav.cc:826
#20 0x000000000068cb54 in std::function<bool(notcurses*, ncinput const&, char const*)>::operator() (this=0xfd07a0 <lnav_data+54144>, __args#0=<optimized out>, __args#1=..., __args#2=<optimized out>)
    at /usr/include/c++/15/bits/std_function.h:593
#21 input_dispatcher::new_input (this=this@entry=0xfd0778 <lnav_data+54104>, current_time=..., nc=0x1ed380c0, ch=...) at input_dispatcher.cc:114
#22 0x00000000004beb5f in looper () at lnav.cc:2322
#23 0x00000000004778c5 in main (argc=<optimized out>, argv=<optimized out>) at lnav.cc:4450

Attached the debug log to this issue.

debug.log.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions