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

crash when running sql query #1194

Closed
symphorien opened this issue Oct 6, 2023 · 0 comments
Closed

crash when running sql query #1194

symphorien opened this issue Oct 6, 2023 · 0 comments
Labels

Comments

@symphorien
Copy link

lnav version
Reproduced with the static linux executable of 0.11.2 found on https://lnav.org/downloads on ubuntu 20.04 and on commit 930748a (master of a few days ago) on nixos 23.05

Describe the bug
When running sql query

;update all_logs as a set log_mark=1 from all_logs as b where a.log_line > b.log_line and a.log_line <= b.log_line + 10 and  b.log_time > '2023-09-26T11:00:00' and a.log_text like "%systemd%" and b.log_text like "%btrbk%";

lnav crashes

To Reproduce
Steps to reproduce the behavior:
run lnav tiny where tiny contains the following two lines:

{"_HOSTNAME": "uqbar", "__REALTIME_TIMESTAMP": "1696456810505929", "_SOURCE_REALTIME_TIMESTAMP": "1696456810505770", "_SYSTEMD_UNIT": "init.scope", "_TRANSPORT": "journal", "_CMDLINE": "/run/current-system/systemd/lib/systemd/systemd", "INVOCATION_ID": "9ae6c003e30f4c768998d1ad9951410c", "_SYSTEMD_SLICE": "-.slice", "PRIORITY": "6", "_SYSTEMD_CGROUP": "/init.scope", "TID": "1", "_PID": "1", "MESSAGE": "Starting Takes BTRFS snapshots and maintains retention policies....", "CODE_FILE": "src/core/job.c", "__MONOTONIC_TIMESTAMP": "162841593078", "_GID": "0", "JOB_TYPE": "start", "MESSAGE_ID": "7d4958e842da4a758f6c1cdc7b36dcc5", "_RUNTIME_SCOPE": "system", "_SELINUX_CONTEXT": "kernel", "JOB_ID": "72682", "SYSLOG_FACILITY": "3", "_CAP_EFFECTIVE": "1ffffffffff", "_UID": "0", "UNIT": "btrbk-remote.service", "_BOOT_ID": "2866eb189e8b48b198434c8df0ec4c32", "_COMM": "systemd", "_MACHINE_ID": "b8231d2a01ab4165bcc1690f29a5febe", "CODE_LINE": "581", "CODE_FUNC": "job_emit_start_message", "SYSLOG_IDENTIFIER": "systemd", "_EXE": "/nix/store/9gzw98jc64qkwd17a6qqm63w25zysi57-systemd-253.6/lib/systemd/systemd", "__CURSOR": "s=b5ed86a19adb4635a3ae8bdd5baf59c3;i=9245c1;b=2866eb189e8b48b198434c8df0ec4c32;m=25ea1d84f6;t=606eb219126c9;x=bd72f761961d2cb6"}
{"_SYSTEMD_CGROUP": "/background.slice/btrbk-remote.service", "__MONOTONIC_TIMESTAMP": "162852824790", "_HOSTNAME": "uqbar", "_COMM": "sudo", "_GID": "998", "_SELINUX_CONTEXT": "kernel", "_CMDLINE": "sudo -n readlink -v -e /var/lib/btrbk/remote", "_SYSTEMD_UNIT": "btrbk-remote.service", "__CURSOR": "s=b5ed86a19adb4635a3ae8bdd5baf59c3;i=9245c2;b=2866eb189e8b48b198434c8df0ec4c32;m=25eac8e6d6;t=606eb223c88aa;x=98fffa7c4d9bcf01", "_TRANSPORT": "syslog", "SYSLOG_IDENTIFIER": "sudo", "MESSAGE": "   btrbk : PWD=/ ; USER=root ; COMMAND=/nix/store/j4fwy5gi1rdlrlbk2c0vnbs7fmlm60a7-coreutils-9.1/bin/readlink -v -e /var/lib/btrbk/remote", "_RUNTIME_SCOPE": "system", "_SYSTEMD_SLICE": "background.slice", "_SYSTEMD_INVOCATION_ID": "9ae6c003e30f4c768998d1ad9951410c", "_SOURCE_REALTIME_TIMESTAMP": "1696456821737614", "SYSLOG_FACILITY": "10", "_BOOT_ID": "2866eb189e8b48b198434c8df0ec4c32", "SYSLOG_TIMESTAMP": "Oct  5 00:00:21 ", "__REALTIME_TIMESTAMP": "1696456821737642", "_UID": "999", "_PID": "947088", "_MACHINE_ID": "b8231d2a01ab4165bcc1690f29a5febe", "_CAP_EFFECTIVE": "1ffffffffff", "_EXE": "/nix/store/ikihc25mjb4sk7v8c0877kfz0c7cww50-sudo-1.9.13p3/bin/sudo", "PRIORITY": "5"}

(it's an excerpt of journalctl json output)

then run the above sql query

lnav crashes and prompts to open gdb, with the following backtrace:

#0  0x00007f38baaebb27 in __GI___wait4 (pid=0xffffffff, stat_loc=0x7f38ac7fda64, options=0x0, usage=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:30
#1  0x000000000099e750 in sigabrt (sig=<optimized out>, info=<optimized out>, ctx=<optimized out>) at lnav_log.cc:577
#2  <signal handler called>
#3  0x0000000000855ef9 in logfile_sub_source::indexed_content::operator strong_int<unsigned long, __content_line_distinct> (this=<optimized out>)
    at /build/source/src/logfile_sub_source.hh:701
#4  logfile_sub_source::at (vl=..., this=0xcb86b0 <lnav_data+25488>) at /build/source/src/logfile_sub_source.hh:495
#5  log_vtab_impl::is_valid (this=0x2428100, lc=..., lss=...) at log_vtab_impl.cc:226
#6  0x000000000085d3ba in vt_next (cur=0x27a28b0) at log_vtab_impl.cc:516
#7  0x00007f38bb1b0d7a in sqlite3VdbeExec (p=p@entry=0x2667068) at sqlite3.c:98429
#8  0x00007f38bb1ba2c7 in sqlite3Step (p=<optimized out>) at sqlite3.c:88491
#9  sqlite3_step (pStmt=<optimized out>) at sqlite3.c:23016
#10 sqlite3_step (pStmt=<optimized out>) at sqlite3.c:23005
#11 0x00000000005313ca in execute_sql (ec=..., 
    sql=";update all_logs as a set log_mark=1 from all_logs as b where a.log_line > b.log_line and a.log_line <= b.log_line + 10 and  b.log_time > '2023-09-26T11:00:00' and a.log_text like \"%systemd%\" and b.log_text like \"%btrbk%\";", alt_msg="") at ./base/auto_mem.hh:128
#12 0x0000000000737422 in rl_callback_int (rc=0x246f710, is_alt=<optimized out>) at readline_callbacks.cc:715
#13 0x0000000000744eb8 in std::function<void (readline_curses*)>::operator()(readline_curses*) const (this=<optimized out>, __args#0=<optimized out>)
    at /nix/store/b7hvml0m3qmqraz1022fwvyyg6fc1vdy-gcc-12.2.0/include/c++/12.2.0/bits/std_function.h:591
#14 0x0000000000740089 in readline_curses::check_poll_set (this=0x246f710, pollfds=...) at readline_curses.cc:1290
#15 0x000000000072d057 in pollable_supervisor::check_poll_set (this=0x20eb410, pollfds=std::vector of length 5, capacity 8 = {...}) at pollable.cc:86
#16 0x00000000004939d3 in looper () at lnav.cc:1870
#17 0x0000000000462676 in main (argc=<optimized out>, argv=<optimized out>) at lnav.cc:3517
@symphorien symphorien added the bug label Oct 6, 2023
@tstack tstack closed this as completed in 0b985ef Oct 7, 2023
tstack added a commit that referenced this issue Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant