[vim/vim] Crash with nested map functions against object (#4890)

20 views
Skip to first unread message

itchyny

unread,
Sep 3, 2019, 12:43:10 AM9/3/19
to vim/vim, Subscribed

Instructions: Replace the template text and remove irrelevant text (including this line)

Describe the bug
There're still some crash cases with nested map/filter functions.

To Reproduce
Detailed steps to reproduce the behavior:

  1. Run vim --clean (or gvim --clean, etc.)
  2. Execute :echo map({'x':{'y':1}}, 'map(v:val, "2")')
  3. Vim dies with SIGABRT

Expected behavior
No SIGABRT happens, echoes {'x': {'y': 2}}.

Screenshots
If applicable, copy/paste the text or add screenshots to help explain your problem.

Environment (please complete the following information):

  • Vim version v8.1.1967 (current latest HEAD)
  • OS: macOS 10.14
  • Terminal: iTerm2

Additional context
This resembles #4888 but different report (because this reproduces with v8.1.1967).
Replacing map with filter also reproduce the crash.
I git-bisected the repository and the bad commit was;

e5cdf153bcb348c68011b308c8988cea42d6ddeb is the first bad commit
commit e5cdf153bcb348c68011b308c8988cea42d6ddeb
Author: Bram Moolenaar <Br...@vim.org>
Date:   Thu Aug 29 22:09:46 2019 +0200

patch 8.1.1939: code for handling v: variables in generic eval file

Problem:    Code for handling v: variables in generic eval file.
Solution:   Move v: variables to evalvars.c. (Yegappan Lakshmanan,
        closes #4872)

    src/eval.c             | 1041 +-----------------------------------------------
    src/evalvars.c         | 1028 ++++++++++++++++++++++++++++++++++++++++++++++-
    src/proto/eval.pro     |   34 +-
    src/proto/evalvars.pro |   34 ++
    src/version.c          |    2 +
5 files changed, 1077 insertions(+), 1062 deletions(-)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub

Bram Moolenaar

unread,
Sep 3, 2019, 11:14:14 AM9/3/19
to vim/vim, Subscribed

Closed #4890 via 27da7de.

Yegappan Lakshmanan

unread,
Sep 3, 2019, 11:14:36 AM9/3/19
to vim_dev, reply+ACY5DGHAE2YKCNWDKB...@reply.github.com, vim/vim, Subscribed
Hi,

On Mon, Sep 2, 2019 at 9:43 PM itchyny <vim-dev...@256bit.org> wrote:
>
> Instructions: Replace the template text and remove irrelevant text (including this line)
>
> Describe the bug
> There're still some crash cases with nested map/filter functions.
>

I am attaching a patch that reverts the logic for setting the v:
variable type and value
back to the one before 8.1.1939. This fixes the crash reported here.

- Yegappan
evalvars_crash.diff

vim-dev ML

unread,
Sep 3, 2019, 11:15:04 AM9/3/19
to vim/vim, vim-dev ML, Your activity
Hi,

On Mon, Sep 2, 2019 at 9:43 PM itchyny <vim-dev...@256bit.org> wrote:
>
> Instructions: Replace the template text and remove irrelevant text (including this line)
>
> Describe the bug
> There're still some crash cases with nested map/filter functions.
>

I am attaching a patch that reverts the logic for setting the v:
variable type and value
back to the one before 8.1.1939. This fixes the crash reported here.

- Yegappan

Reply all
Reply to author
Forward
0 new messages