lnav icon indicating copy to clipboard operation
lnav copied to clipboard

lnav as MANPAGER quits on launch

Open KAGEYAM4 opened this issue 6 months ago • 11 comments

lnav version v0.13.0

Describe the bug lnav quits instantly after launching. Got the debug output using MANPAGER='lnav -q -d /tmp/lnav_output and SYSTEMD_PAGER='lnav -q -d /tmp/lnav_output'

To Reproduce I used following commands -->

  1. man rg
  2. systemctl cat man-db.service

https://gist.github.com/KAGEYAM4/519c43c864bae02e1bd372030604ef5c https://gist.github.com/KAGEYAM4/f091056696a72222f588549251b3e984

KAGEYAM4 avatar Aug 01 '25 23:08 KAGEYAM4

Does lnav run at all? Looks like you're using Arch and #1512 mentions it's crashing there as well.

tstack avatar Aug 02 '25 00:08 tstack

For me its running when used normally. Because i am using static binary from github release and didnt biuld it using PKGFILE.

When i biuld through PKGFILE, it was also same for me - segmentation fault.

For the above bug, i have to run the multiple time to finally stop lnav from quitting.

KAGEYAM4 avatar Aug 02 '25 00:08 KAGEYAM4

Hmm, I'm not having luck replicating this crash on arch. I'm pretty sure the crash mentioned in #1512 is the same as #1505 . I can't quite tell from the crash log what's going on yet.

tstack avatar Aug 02 '25 04:08 tstack

Hmm, I'm not having luck replicating this crash on arch. I'm pretty sure the crash mentioned in #1512 is the same as #1505 . I can't quite tell from the crash log what's going on yet.

Same here, 70% chance here on my side. I will try using latest git build.

KAGEYAM4 avatar Aug 02 '25 07:08 KAGEYAM4

@tstack so i am on latest git, running man db using lnav as pager kills the terminal too.

Aug 02 15:46:50 ArchLinux kernel: io[116208]: segfault at 100 ip 0000562396afa50b sp 00007f9483ff70e0 error 4 in ghostty[1b4650b,562396609000+6ad000] likely on CPU 10 (core 4, socket 0)
Aug 02 15:46:50 ArchLinux kernel: Code: 30 41 f6 c1 01 0f 85 b6 00 00 00 48 01 cb 48 29 c8 c6 04 24 00 31 c9 e9 29 01 00 00 4c 3b 77 08 75 08 48 c7 47 08 00 00 00 00 <49> 8b 86 00 01 00 00 48 89 07 49 c7 86 00 01 00 00 00 00 00 00 49

But after successive try, eventually man db succeeds.

It could be terminal fault, currently using ghostty, i will swith to kitty.

KAGEYAM4 avatar Aug 02 '25 10:08 KAGEYAM4

Can you try this again with beta4? It's possible this is the same as #1526, which is fixed now.

tstack avatar Aug 19 '25 05:08 tstack

Can you try this again with beta4? It's possible this is the same as #1526, which is fixed now.

still happening for me. But, this only happens in ghostty and not in kitty.

Do i create a bug report on ghosttty repo ?

KAGEYAM4 avatar Aug 19 '25 05:08 KAGEYAM4

Sigh, thanks for trying it out. I've tried quite a few things and haven't had luck repro'ing yet.

Do i create a bug report on ghosttty repo ?

No, this is lnav sucking...

tstack avatar Aug 19 '25 05:08 tstack

If you're willing to waste a little more time... a backtrace from when it crashes would be really helpful. Maybe configure the system to dump core? You could also redirect the output of man to a file, start lnav with -N and gdb attach to it, then run :sh cat /tmp/man.out.

tstack avatar Aug 19 '25 05:08 tstack

To make sure you didn' missed it before, Ghosttty terminal crashes and not just lnav. Whereas kitty does not crashes and lnav works perfectly there when used as MANPAGER='lnav -q'

I got the coredump for ghostty using coredumpctl dump --output=ghostty.core ghostty but the output file is 330.8 MiB in size, where can i upload it ?

KAGEYAM4 avatar Aug 19 '25 06:08 KAGEYAM4

Forget MANPAGER='lnav -q' man db, running lnav -N is enough to crash the ghostty terminal.

KAGEYAM4 avatar Aug 19 '25 06:08 KAGEYAM4