Skip to content

Segfault with netrw on Alpine Linux after v8.2.3584 #9318

@ktprograms

Description

@ktprograms

Steps to reproduce

(Steps here using docker to ensure maximum reproducibility):

  1. docker run -it --rm alpine:3.15
  2. apk add alpine-sdk xxd ncurses-dev lua5.3-dev python3-dev gtk+3.0-dev libx11-dev libxt-dev
  3. cd ~
  4. git clone --depth=1 https://github.com/vim/vim -b v8.2.3584
  5. cd vim/
  6. ./configure --prefix=/usr --enable-luainterp --enable-python3interp=dynamic --without-x --disable-nls --enable-multibyte --enable-gui=no --with-lua-prefix=/usr/lua5.3
  7. make -j$(nproc)
  8. make install
  9. cd /usr/share/vim
  10. curl -o vimrc https://tpaste.us/ovJr
  11. vim /etc/ (Or any directory)

Expected behaviour

No segfault.

Operating system

Alpine Linux v3.15, Docker Image

Version of Vim

Started happening after v8.2.3584, still happens on master (v8.2.3770 at time of reporting). Installed package versions: https://tpaste.us/jNgm

Logs and stack traces

Notes:

  • Segfault happens when there are 3 or more user defined commands anywhere in the vim initialisation procedure (even in plugins) any you open netrw. (Commenting out any one of the user defined commands in the example vimrc prevents the segfault from happening).
  • Segfault doesn't happen if running vim -u /usr/share/vim/vimrc /etc/, even though that's the default vimrc.
  • Segfault doesn't happen if ~/.vimrc exists (can be completely empty)
  • According to GDB, the segfault happens in

    vim/src/usercmd.c

    Line 1778 in 58ef8a3

    if ((cmd->uc_argt & EX_KEEPSCRIPT) == 0)
    (line number as of v8.2.3584).
  • The segfault doesn't happen on Debian (with compiling the problematic version)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions