neovim segfaults after dismissing and reopening onscreen keyboard

If I open a particular file in neovim, scroll to the very last line, minimize termux and then open it, neovim segfaults. Consistently. I eliminated my configs as a reason. What about dismissing and reopening the virtual keyboard that could cause a segfault? Is it possible to recreate those conditions on a PC? This is my main ask. I want to figure out if this is problem belongs to neovim, termux, or both. Steps to reproduce: Use the virtual keyboard for this. 1. Paste into termux: curl -s https://termbin.com/2q2fq | nvim -u NONE -c "set linebreak" (You can copy the command from the 1st comment for convenience) 2. Type G$ (move the cursor to the end of the last line in the file) 3. Dismiss the virtual keyboard (open the side menu and hit "keyboard") 4. Bring the virtual keyboard back up (repeat prior step). It looks like the bug is caused by the last line being wrapped and partially offscreen. So your terminal dimensions have to allow that. Environment information: Neovim version: 0.8.3 Termux version: 0.118.0 Android Version: 10 Terminal dimensions: 35 cols × 14 lines. (This has to do with line wrapping, if the line doesn't wrap, it won't work.) Edit 1: Simplified reproduction steps. You don't have to paste commands into neovim anymore. Edit 2: Added environment information section. Edit 3: Changed mentions of suspending termux to dismissing the keyboard.
23 Replies
zeb (ping me on replies)
curl -s https://termbin.com/2q2fq | nvim -u NONE -c "set linebreak" ^ The command to paste, for convenience
fisher
fisher2y ago
are you sure its a segfault adn not android killing the process? it can be phantom process killing you should share a screenshot ?tag A12
Dyno
Dyno2y ago
Phantom Process Killing 📱 🔫 👻 Termux being randomly killed is a known problem because of Android 12 CPU optimisation mechanism, displayed as [Process completed (signal 9) - press Enter] error - More information about the issue: https://github.com/termux/termux-app/issues/2366 - Potential solutions to fix that https://github.com/agnostic-apollo/Android-Docs/blob/master/en/docs/apps/processes/phantom-cached-and-empty-processes.md#commands-to-disable-phantom-process-killing-and-tldr (link above takes you to end chapter, the whole thing has in-depth description of what's happening)
zeb (ping me on replies)
It says Segmentation Fault in the terminal. I don't have Android 12. It's a consistent segfault with this file, and it doesn't happen with files in general. So I doubt this is the culprit.
fisher
fisher2y ago
cant reproduce this in v0.9.0-dev or v0.8.3
zeb (ping me on replies)
Interesting. Is the line wrapping? And did you make sure to hit $? It doesn't happen unless you're near the end of the last line.
fisher
fisher2y ago
yea i did G$
No description
fisher
fisher2y ago
v0.8.3
No description
zeb (ping me on replies)
Ah. Ok. This makes some sense. Blow up the font size more. Try to get it close to 35 columns.
fisher
fisher2y ago
34 columns
No description
zeb (ping me on replies)
Interesting. Ok, try to make sure the bottom line cannot fit fully on the screen. So either use your virtual keyboard or blow up the font some more. Or use a font with larger letters. Using a split prevents this error from happening for me, so that's not an option to shrink the height of the window. More information: Dismissing the virtual keyboard and then bringing it back up again causes the segfault, too. The suspension may not be the problem. Hypothesis: Maybe screen resizes cause it. Test: Blow up the font and then reduce it. This resizes the screen. See if a segfault happens. Result: No segfault. The segfaults happen at dimensions of 13 lines × 33 columns and 14 lines × 35 columns. The start of the line being offscreen seems necessary for a segfault, but doesn't guarantee it.
fisher
fisher2y ago
did get a segfault but it exited with an error it happens when you zoom in enough to hide the eob (end of buffer)
fisher
fisher2y ago
errors dont happen on first one
No description
No description
zeb (ping me on replies)
What error code did you get?
fisher
fisher2y ago
oh, it is segfault
No description
zeb (ping me on replies)
Does anyone know what more investigation I can do to figure out the cause(s)?
fisher
fisher2y ago
raise an issue on github, theyll be able to explain it better
zeb (ping me on replies)
Termux's github?
fisher
fisher2y ago
GitHub
GitHub - neovim/neovim: Vim-fork focused on extensibility and usabi...
Vim-fork focused on extensibility and usability. Contribute to neovim/neovim development by creating an account on GitHub.
zeb (ping me on replies)
Thank you Fisher for helping me reproduce!
zeb (ping me on replies)
GitHub
Neovim segfaults on termux when dismissing and raising onscreen key...
Describe the bug If I open a particular file in neovim, scroll to the very last line, dismiss the onscreen keyboard, and then pull the keyboard back up again, neovim segfaults. Consistently. I elim...
zeb (ping me on replies)
I'm marking this as complete because it looks like they managed to reproduce this without termux.
Want results from more Discord servers?
Add your server