nsubstitute / NSubstitute.Analyzers

Roslyn analysers for NSubstitute.
MIT License
30 stars 7 forks source link

Using NSubstitute.Analyzers.CSharp in VisualStudio for Mac 2020 Preview crashes Visual Studio #177

Open iduras3 opened 2 years ago

iduras3 commented 2 years ago

Like the title mentions the NSubstitute.Analyzers.CSharp crashes Visual Studio.

Visual Studio Version: 17.0 Preview (17.0 build 4729) NSubstitute.Analyzers.CSharp 1.0.15

tpodolak commented 2 years ago

Hi @iduras3, NSubstitute.Analyzers were never tested on VS for Mac. I would assume that underlying analyzers engine is the same as in standard VS, but you never know. Unfortunately I dont have access to Mac so I cant check if this is issue with the package or rather problem with beta version of VS. Can you provide us with some logs from the crash? @nsubstitute/core-contributors do you guys maybe have Mac to check this on your own?

iduras3 commented 2 years ago

The crash happens as soon as I am opening a test file with the NSubstitute.Analyzers in the project. The log file: crash-log.txt

dtchepak commented 2 years ago

I was able to reproduce this on VS 2022 for Mac Preview (17.0 build 4172). I'm updating VS to the latest to see if it still occurs. Builds from the command line seem to work fine. Also noticed Analyzers 1.0.13 seems to work ok, but 1.0.14 and 1.0.15 seem to crash.

I haven't been able to find a good exception message . :-\

Thread 23 Crashed:: Thread Pool Worker
0   libsystem_kernel.dylib          0x00007fff6f8c833a __pthread_kill + 10
1   libsystem_pthread.dylib         0x00007fff6f984e60 pthread_kill + 430
2   libsystem_c.dylib               0x00007fff6f84f8a2 __abort + 139
3   libsystem_c.dylib               0x00007fff6f84f817 abort + 135
4   com.microsoft.visual-studio-preview 0x000000010632af20 log_callback(char const*, char const*, char const*, int, void*) + 64 (runtime.m:1239)
5   com.microsoft.visual-studio-preview 0x000000010663b888 monoeg_g_logv_nofree + 168 (goutput.c:167)
6   com.microsoft.visual-studio-preview 0x000000010663b9ff monoeg_assertion_message + 143 (goutput.c:201)
7   com.microsoft.visual-studio-preview 0x00000001065441be do_mono_metadata_type_equal + 1438
8   com.microsoft.visual-studio-preview 0x00000001065442a4 mono_metadata_signature_equal + 84 (metadata.c:5880)
9   com.microsoft.visual-studio-preview 0x00000001064b3fd0 mono_class_setup_vtable_general + 3872 (class-init.c:3235)
10  com.microsoft.visual-studio-preview 0x00000001064b3077 mono_class_setup_vtable_full + 343 (class-init.c:2513)
11  com.microsoft.visual-studio-preview 0x00000001064ae5a3 mono_class_init_internal + 1939 (class-init.c:4484)
12  com.microsoft.visual-studio-preview 0x00000001064adf9a mono_class_init_internal + 394
13  com.microsoft.visual-studio-preview 0x00000001064bd667 mono_class_is_subclass_of_internal + 23 (class.c:3387)
14  com.microsoft.visual-studio-preview 0x00000001064e4a53 ves_icall_RuntimeTypeHandle_is_subclass_of + 163
15  ???                             0x0000000108794b5d 0 + 4437134173
16  ???                             0x0000000108794a9b 0 + 4437133979
17  ???                             0x00000001087949cb 0 + 4437133771
18  ???                             0x00000001302e9d39 0 + 5103328569
19  ???                             0x00000001302e82d3 0 + 5103321811
20  ???                             0x00000001302e87bc 0 + 5103323068
21  ???                             0x00000001302e5ac2 0 + 5103311554
22  ???                             0x00000001302e4d1b 0 + 5103308059
23  ???                             0x00000001302de303 0 + 5103280899
24  ???                             0x00000001302dc6bb 0 + 5103273659
25  ???                             0x000000011da20562 0 + 4792124770
26  ???                             0x00000001302db663 0 + 5103269475
27  ???                             0x00000001302db11b 0 + 5103268123
28  ???                             0x00000001302614d3 0 + 5102769363
29  ???                             0x0000000130254ecb 0 + 5102718667
30  ???                             0x00000001302510ab 0 + 5102702763
31  ???                             0x00000001302507f3 0 + 5102700531
32  ???                             0x000000013024e045 0 + 5102690373
33  ???                             0x000000013024c23b 0 + 5102682683
34  ???                             0x000000013024be9b 0 + 5102681755
35  ???                             0x000000013024b32b 0 + 5102678827
36  ???                             0x00000001155c4d76 0 + 4653337974
37  ???                             0x00000001150e20e3 0 + 4648214755
38  ???                             0x00000001150e2093 0 + 4648214675
39  ???                             0x00000001150e1a16 0 + 4648213014
40  ???                             0x00000001150e0ffb 0 + 4648210427
41  ???                             0x00000001150e0e33 0 + 4648209971
42  ???                             0x00000001150e0753 0 + 4648208211
43  ???                             0x00000001150c7fb3 0 + 4648107955
44  ???                             0x00000001150c5dca 0 + 4648099274
45  ???                             0x00000001150c55c3 0 + 4648097219
46  ???                             0x00000001150c5786 0 + 4648097670
47  com.microsoft.visual-studio-preview 0x0000000106424cc3 mono_jit_runtime_invoke + 1603
48  com.microsoft.visual-studio-preview 0x000000010655ad5f mono_runtime_try_invoke + 143 (object.c:3161)
49  com.microsoft.visual-studio-preview 0x00000001065a7efa worker_callback + 938 (threadpool.c:386)
50  com.microsoft.visual-studio-preview 0x00000001065a5b51 worker_thread + 369 (threadpool-worker-default.c:502)
51  com.microsoft.visual-studio-preview 0x00000001065b1f13 start_wrapper_internal + 403 (threads.c:1289)
52  com.microsoft.visual-studio-preview 0x00000001065b1d5e start_wrapper + 62 (threads.c:1310)
53  libsystem_pthread.dylib         0x00007fff6f985109 _pthread_start + 148
54  libsystem_pthread.dylib         0x00007fff6f980b8b thread_start + 15
dtchepak commented 2 years ago

17.0.0.4729 also affected.