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

9.0.457 is broken #11123

Closed
chdiza opened this issue Sep 13, 2022 · 14 comments
Closed

9.0.457 is broken #11123

chdiza opened this issue Sep 13, 2022 · 14 comments
Labels

Comments

@chdiza
Copy link

chdiza commented Sep 13, 2022

Steps to reproduce

vim -u NONE

Expected behaviour

Vim should start like usual.

Instead, I see this repeated five times at the bottom of the screen, as vim messages: E341: Internal error: lalloc(0, )

Version of Vim

9.0.457

Environment

Ubuntu 20.04
terminal= kitty 0.26.2
shell: bash 5.0.17

Logs and stack traces

No response

@chdiza chdiza added the bug label Sep 13, 2022
@chdiza
Copy link
Author

chdiza commented Sep 13, 2022

I should also add that once I make the messages go away, the statusline is the last screen line in the console, instead of the penultimate one.

This last symptom also happens in gvim.

@chdiza
Copy link
Author

chdiza commented Sep 13, 2022

Sorry, it looks like one needs a vimrc containing se ls=2 to make this show up right when starting vim. I have make a vimrc that contains ONLY that, I see the problem upon startup.

Also, git bisecting reveals that the bad patch is 9.0.455.

@chdiza
Copy link
Author

chdiza commented Sep 13, 2022

The incorrect placement of the statusline also appears in xterm, though using xterm I don't see the error messages.

@bfrg
Copy link
Contributor

bfrg commented Sep 13, 2022

Setting cmdheight temporarily to 2 and then back to 1 will redraw the statusline correctly: :set cmdheight=2 cmdheight=1

Tested with alacritty terminal.

@lacygoill
Copy link

I have the exact same environment (OS, terminal, shell, Vim) and I can't reproduce. I guess something else is required.

If Vim is compiled locally, how is it configured?

If it's not, what's the output of :version?

@lacygoill
Copy link

Also, git bisecting reveals that the bad patch is 9.0.455.

Cc: @luukvbaal via #11117

@luukvbaal
Copy link
Contributor

luukvbaal commented Sep 13, 2022

Able to reproduce in kitty, not in st(my usual terminal). I'll look into it.

@brammool
Copy link
Contributor

Using a file only containing "set ls=2" and using "vim -u {that-file}" I see there is no command line.
Reverting patch 9.0.0455 fixes it.

Since no test catches this I suspect it's a startup problem.
I hope Luuk can locate the problem.

@luukvbaal
Copy link
Contributor

luukvbaal commented Sep 13, 2022

Yes, the problem was easily located(the change in main.c from 5ed3917 is the culprit, it seems some terminal communication may rely on the window size before it is initialized with that change, resulting in the alloc error.). I'll find another workaround to fix this issue.

luukvbaal added a commit to luukvbaal/vim that referenced this issue Sep 13, 2022
Problem:    'scroll' is not updated when resizing windows, alloc error due to unitialized window size in terminal communication?
Solution:   Update 'scroll' in win_fix_scroll(), revert win_init_size() relocation in main.c and update prev_height for gui instead. (closes vim#11123, vim#11119)
@dpelle
Copy link
Member

dpelle commented Sep 13, 2022

I see the same issue with my ~/.vimrc on Linux.
The problem started with this patch:

commit 5ed391708a62b4ebaa84dd23e32a416e5c3383d9 (tag: v9.0.0455)
Author: Luuk van Baal <luukvbaal@gmail.com>
Date:   Tue Sep 13 11:55:10 2022 +0100

    patch 9.0.0455: a few problems with 'splitscroll'

    Problem:    A few problems with 'splitscroll'.
    Solution:   Fix 'splitscroll' problems. (Luuk van Baal, closes #11117)

Yet my ~/.vimrc does not set splitscroll.

Furthermore, just doing /foo to search for string foo fails like this:

E342: Out of memory!  (allocating 18446744073709551604 bytes)
E486: Pattern not found: foo

This silly looking command works around it:

:set cmdheight=2 cmdheight=1

Note that merely doing :set cmdheight=1 does not fix it.

Bug does not happen with vim --clean. I'll try to narrow down what triggering it in my ~/.vimrc.

@luukvbaal
Copy link
Contributor

@dpelle have you checked the linked patch? Does the issue still occur there?

@dpelle
Copy link
Member

dpelle commented Sep 13, 2022

If I use this minimalistic one-liner ~/.vimrc...

set laststatus=2

.... then, just starting vim gives:

E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )

I see it with the latest vim-9.0.459 and it started with vim-9.0.455 (vim-9.0.454 and earlier are fine).

@dpelle have you checked the linked patch? Does the issue still occur there?

Ah, I just saw your message as I was investigating.
Yes your patch posted earlier indeed fixes it.
Heel erg bedankt @Luuk!

@dpelle
Copy link
Member

dpelle commented Sep 14, 2022

For what it's worth, this reproduced the bug without having to create/modify ~/.vimrc:

$ vim --clean --cmd 'set laststatus=2'
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )
E341: Internal error: lalloc(0, )

luukvbaal referenced this issue Sep 14, 2022
Problem:    'scroll' is not always updated.
Solution:   Call win_init_size() at the right place.
@chrisbra
Copy link
Member

apparently fixed by 470a141

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

Successfully merging a pull request may close this issue.

7 participants