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

moar version 1.30.0 crashed on macOS #259

Open
ciscohack opened this issue Dec 9, 2024 · 10 comments
Open

moar version 1.30.0 crashed on macOS #259

ciscohack opened this issue Dec 9, 2024 · 10 comments

Comments

@ciscohack
Copy link

ciscohack commented Dec 9, 2024

moar crash with follow syntax search and freeze at crash prompt

 ug 'stuck' asa.txt | ug 'loop'                                                                                                                                                                                           ✔
^[[?1049h^[[?1006;1000l^[[?25l^[]11;?^GPlease post the following report at <https://github.com/walles/moar/issues>,
or e-mail it to [email protected].

Version: v1.30.0
LANG   : en_US.UTF-8
TERM   : tmux-256color
MOAR   : -colors=16M --render-unprintable=whitespace -mousemode=select
EDITOR :

GOOS    : darwin
GOARCH  : arm64
Compiler: gc
NumCPU  : 12

panic: runtime error: index out of range [-1] [recovered]
        panic: runtime error: index out of range [-1] [recovered]
        panic: runtime error: index out of range [-1]

goroutine 1 [running]:
main.main.func1()
        github.com/walles/moar/moar.go:598 +0x150
panic({0x1046b9560?, 0x14000134498?})
        runtime/panic.go:785 +0x124
main.startPaging.func1()
        github.com/walles/moar/moar.go:652 +0x114
panic({0x1046b9560?, 0x14000134498?})
        runtime/panic.go:785 +0x124
github.com/walles/moar/m.(*Pager).decorateLine(0x1400028a000, 0x140004481e0, {0x14000482480, 0x7, 0x7}, {0x140004481d8, 0x0, {0x104406a71, 0x5}, 0x1, ...})
        github.com/walles/moar/m/screenLines.go:362 +0xba4
github.com/walles/moar/m.(*Pager).renderLine(0x1400028a000, 0x1400035e260, {0x0}, {0x140004481d8, 0x0, {0x104406a71, 0x5}, 0x1, {0x0, 0x0, ...}})
        github.com/walles/moar/m/screenLines.go:240 +0x27c
github.com/walles/moar/m.(*scrollPositionInternal).handlePositiveDeltaScreenLines(0x1400028a020, 0x1400028a000)
        github.com/walles/moar/m/scrollPosition.go:142 +0xc0
github.com/walles/moar/m.(*scrollPositionInternal).canonicalize(0x1400028a020, 0x1400028a000)
        github.com/walles/moar/m/scrollPosition.go:255 +0x198
github.com/walles/moar/m.(*Pager).lineNumber(...)
        github.com/walles/moar/m/scrollPosition.go:277
github.com/walles/moar/m.(*Pager).renderLines(0x1400028a000)
        github.com/walles/moar/m/screenLines.go:118 +0x64
github.com/walles/moar/m.(*Pager).renderScreenLines(0x1400028a000)
        github.com/walles/moar/m/screenLines.go:77 +0x28
github.com/walles/moar/m.(*Pager).redraw(0x1400028a000, {0x0, 0x0})
        github.com/walles/moar/m/screenLines.go:42 +0x4c
github.com/walles/moar/m.(*Pager).StartPaging(0x1400028a000, {0x1046d2638, 0x1400015c0e0}, 0x1400035e0c0, 0x1400048f430)
        github.com/walles/moar/m/pager.go:350 +0x2d0
main.startPaging(0x14000112230?, {0x1046d2638?, 0x1400015c0e0?}, 0x1046cd750?, 0x14000170001?)
        github.com/walles/moar/moar.go:670 +0x54
main.main()
        github.com/walles/moar/moar.go:623 +0x234
@walles
Copy link
Owner

walles commented Dec 19, 2024

I've been able to reproduce this crash in a test by setting the screen width to 0.

Seems you are in tmux, is that right?

I wonder what would make tmux report zero width terminal...

@ciscohack
Copy link
Author

ciscohack commented Dec 19, 2024

I've been able to reproduce this crash in a test by setting the screen width to 0.

Seems you are in tmux, is that right?

I wonder what would make tmux report zero width terminal...

Yes i am using tmux.. not sure on terminal part

@walles
Copy link
Owner

walles commented Dec 19, 2024

Inside the tmux session where this crash happens:

  1. Does this crash happen every time or does it sometimes work?
  2. What if you just view some file in moar like moar /etc/services, does that also crash?
  3. Can you try tput cols and post the output here?
  4. Which terminal program are you using?

It's strange that you see ^[[?1049h^[[?1006;1000l^[[?25l^[]11;?^G, which is part of moar's terminal init sequence.

Kind of like something blocking moar from talking to the terminal.

@ciscohack
Copy link
Author

@walles

=> I tried 2 times and crash happened 2 times then i didn't tried.
=> tried moar /etc/services and this didn't cause crash
=> tput cols result output 172
=> i am using iterm2

walles added a commit that referenced this issue Dec 31, 2024
Relates to #259.

I don't understand how this could happen, but this should at least
take us closer to the source.
walles added a commit that referenced this issue Dec 31, 2024
To improve diagnoability of #259.
@walles
Copy link
Owner

walles commented Dec 31, 2024

Do you have a .ugrep config file?

If you do, could you share it here?

@ciscohack
Copy link
Author

Do you have a .ugrep config file?

If you do, could you share it here?

bkp.ugrep.zip

Here you go

walles added a commit that referenced this issue Jan 1, 2025
For improved debugability of #259.
@walles
Copy link
Owner

walles commented Jan 1, 2025

Do you have a ~/.tmux.conf or a /etc/tmux file?

If you could upload those here as well I'd like to have a look!

@ciscohack
Copy link
Author

ciscohack commented Jan 1, 2025

Do you have a ~/.tmux.conf or a /etc/tmux file?

If you could upload those here as well I'd like to have a look!

https://github.com/gpakosz/.tmux

this is what i am using just minor keybinding change nothing else ..so you can use this

@ciscohack
Copy link
Author

ciscohack commented Jan 3, 2025

@walles Any change in recent moar 1.30.1 update.. when i run ugrep "search_pattern" * then terminal is freeze and search result is very slow..when terminal freezes i noticed moar not let to exit the moar prompt.. this is bad and it force to manual kill the terminal completely to recover it

@ciscohack
Copy link
Author

@walles Any change in recent moar 1.30.1 update.. when i run ugrep "search_pattern" * then terminal is freeze and search result is very slow..when terminal freezes i noticed moar not let to exit the moar prompt.. this is bad and it force to manual kill the terminal completely to recover it

please ignore this message .....i found the issue and it has nothing to do with moar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants