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

[vim9] Segmentation fault when iterating over list of objects inside a function #11823

Closed
lifepillar opened this issue Jan 15, 2023 · 1 comment
Labels

Comments

@lifepillar
Copy link
Contributor

Steps to reproduce

Source this script:

vim9script

class Foo
  def Add()
  enddef
endclass


def ProcessList(fooList: list<Foo>)
  for foo in fooList
    foo.Add()
  endfor
enddef

var l: list<Foo> = [Foo.new()]

ProcessList(l)

Vim should segfault. Possibly related to #11822.

Expected behaviour

The script should compile and run just fine.

Version of Vim

9.0.1201

Environment

macOS 13.1
Apple Terminal
xterm-256color
ZSH 5.8.1

Logs and stack traces

No response

@lifepillar lifepillar added the bug label Jan 15, 2023
@lifepillar
Copy link
Contributor Author

Sorry, forgot to attach a stack trace. The crash seems to happen inside copy_type():

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   libsystem_kernel.dylib        	       0x195391bfc __kill + 8
1   vim                           	       0x102e19524 may_core_dump + 64
2   vim                           	       0x102e193c8 mch_exit + 204
3   vim                           	       0x102feae9c getout + 1008
4   vim                           	       0x102dcddfc preserve_exit + 212
5   vim                           	       0x102e1ef9c deathtrap + 596
6   libsystem_platform.dylib      	       0x1953f72a4 _sigtramp + 56
7   vim                           	       0x102f88f8c copy_type + 132
8   vim                           	       0x102f8da9c copy_type_deep_rec + 156
9   vim                           	       0x102f8db30 copy_type_deep_rec + 304
10  vim                           	       0x102f8db30 copy_type_deep_rec + 304
11  vim                           	       0x102f8db30 copy_type_deep_rec + 304
12  vim                           	       0x102f8d9e0 copy_type_deep + 56
13  vim                           	       0x102f8a100 typval2type_int + 796
14  vim                           	       0x102f89d6c typval2type + 72
15  vim                           	       0x102f8b070 check_typval_type + 204
16  vim                           	       0x102f8af98 check_typval_arg_type + 72
17  vim                           	       0x102f6e64c call_def_function + 1720
18  vim                           	       0x102f46378 call_user_func + 564
19  vim                           	       0x102f460c0 call_user_func_check + 332
20  vim                           	       0x102f44a74 call_func + 1808
21  vim                           	       0x102f44220 get_func_tv + 476
22  vim                           	       0x102cf0454 eval_func + 396
23  vim                           	       0x102cefcec eval9 + 2160
24  vim                           	       0x102cf2054 eval8 + 512
25  vim                           	       0x102cf19cc eval7 + 52
26  vim                           	       0x102cf1118 eval6 + 64
27  vim                           	       0x102cf0d74 eval5 + 40
28  vim                           	       0x102cf0990 eval4 + 68
29  vim                           	       0x102cf0528 eval3 + 44
30  vim                           	       0x102ce804c eval2 + 44
31  vim                           	       0x102ce2280 eval1 + 64
32  vim                           	       0x102ce7d6c eval0_retarg + 168
33  vim                           	       0x102ce189c eval0 + 52
34  vim                           	       0x102d38e0c ex_eval + 140
35  vim                           	       0x102d260b4 do_one_cmd + 6948
36  vim                           	       0x102d23498 do_cmdline + 2736
37  vim                           	       0x102e9cc18 do_source_ext + 2904
38  vim                           	       0x102e9c0b4 do_source + 56
39  vim                           	       0x102e9bf4c cmd_source + 496
40  vim                           	       0x102e9bd50 ex_source + 32
41  vim                           	       0x102d260b4 do_one_cmd + 6948
42  vim                           	       0x102d23498 do_cmdline + 2736
43  vim                           	       0x102deb7e8 nv_colon + 420
44  vim                           	       0x102de38d4 normal_cmd + 2564
45  vim                           	       0x102feb9d4 main_loop + 2408
46  vim                           	       0x102fea09c vim_main2 + 2648
47  vim                           	       0x102fe7364 main + 1416
48  dyld                          	       0x19509fe50 start + 2544

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

No branches or pull requests

1 participant