pylint segfault
Labels: module: lint, triaged

### 🐛 Describe the bug

On my setup, `pylint` segfault with `pytorch>1.8.1`. `gdb` is giving me the following backtrace:
```
#0  0x00007f999e8dcf70 in ?? ()
#1  0x00007f997cbf87c9 in ?? () from /root/.local/lib/python3.8/site-packages/google/protobuf/pyext/_message.cpython-38-x86_64-linux-gnu.so
#2  0x00007f999ead647f in __pthread_once_slow (once_control=0x7f99663bedf0 <mutex_init_flag>, init_routine=0x7f997efdcc20 <__once_proxy>) at pthread_once.c:116
#3  0x00007f9953d9a1a6 in void std::call_once<void (&)()>(std::once_flag&, void (&)()) () from /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cpu.so
#4  0x00007f9953d9a220 in llvm::ManagedStaticBase::RegisterManagedStatic(void* (*)(), void (*)(void*)) const () from /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cpu.so
#5  0x00007f9953dc11ed in llvm::ManagedStatic<(anonymous namespace)::CommandLineParser, llvm::object_creator<(anonymous namespace)::CommandLineParser>, llvm::object_deleter<(anonymous namespace)::Command
LineParser> >::operator*() [clone .constprop.395] () from /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cpu.so
#6  0x00007f9953dc74ab in llvm::cl::Option::addArgument() () from /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cpu.so
#7  0x00007f9950eb4259 in _GLOBAL__sub_I_Debug.cpp () from /usr/local/lib/python3.8/dist-packages/torch/lib/libtorch_cpu.so
#8  0x00007f999ecf6b8a in ?? () from /lib64/ld-linux-x86-64.so.2
#9  0x00007f999ecf6c91 in ?? () from /lib64/ld-linux-x86-64.so.2
#10 0x00007f999ec48895 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:182
#11 0x00007f999ecfb0bf in ?? () from /lib64/ld-linux-x86-64.so.2
#12 0x00007f999ec48838 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:208
#13 0x00007f999ecfa5fa in ?? () from /lib64/ld-linux-x86-64.so.2
#14 0x00007f999eac034c in dlopen_doit (a=a@entry=0x7ffece0a7f70) at dlopen.c:66
#15 0x00007f999ec48838 in __GI__dl_catch_exception (exception=exception@entry=0x7ffece0a7f10, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:208
#16 0x00007f999ec48903 in __GI__dl_catch_error (objname=0x15fb430, errstring=0x15fb438, mallocedp=0x15fb428, operate=<optimized out>, args=<optimized out>) at dl-error-skeleton.c:227
#17 0x00007f999eac0b59 in _dlerror_run (operate=operate@entry=0x7f999eac02f0 <dlopen_doit>, args=args@entry=0x7ffece0a7f70) at dlerror.c:170
#18 0x00007f999eac03da in __dlopen (file=<optimized out>, mode=<optimized out>) at dlopen.c:87
#19 0x000000000067376f in _PyImport_FindSharedFuncptr ()
#20 0x00000000006842cb in _PyImport_LoadDynamicModuleWithSpec ()
#21 0x0000000000684e61 in ?? ()
#22 0x00000000005c4a40 in ?? ()
#23 0x00000000005f2f5d in PyVectorcall_Call ()
#24 0x000000000057126d in _PyEval_EvalFrameDefault ()
#25 0x000000000056939a in _PyEval_EvalCodeWithName ()
#26 0x00000000005f6a13 in _PyFunction_Vectorcall ()
#27 0x0000000000570035 in _PyEval_EvalFrameDefault ()
#28 0x00000000005f6836 in _PyFunction_Vectorcall ()
#29 0x000000000056b1da in _PyEval_EvalFrameDefault ()
#30 0x00000000005f6836 in _PyFunction_Vectorcall ()
#31 0x000000000056b0ae in _PyEval_EvalFrameDefault ()
#32 0x00000000005f6836 in _PyFunction_Vectorcall ()
#33 0x000000000056b0ae in _PyEval_EvalFrameDefault ()
#34 0x00000000005f6836 in _PyFunction_Vectorcall ()
#35 0x000000000056b0ae in _PyEval_EvalFrameDefault ()
#36 0x00000000005f6836 in _PyFunction_Vectorcall ()
#37 0x00000000005f4401 in ?? ()
#38 0x00000000005f4868 in _PyObject_CallMethodIdObjArgs ()
#39 0x00000000005528d2 in PyImport_ImportModuleLevelObject ()
#40 0x000000000056d514 in _PyEval_EvalFrameDefault ()
#41 0x000000000056939a in _PyEval_EvalCodeWithName ()
#42 0x000000000068d047 in PyEval_EvalCode ()
#43 0x00000000006003a4 in ?? ()
#44 0x00000000005c4a40 in ?? ()
#45 0x00000000005f2f5d in PyVectorcall_Call ()
#46 0x000000000057126d in _PyEval_EvalFrameDefault ()
#47 0x000000000056939a in _PyEval_EvalCodeWithName ()
#48 0x00000000005f6a13 in _PyFunction_Vectorcall ()
#49 0x0000000000570035 in _PyEval_EvalFrameDefault ()
#50 0x00000000005f6836 in _PyFunction_Vectorcall ()
```

### Versions

PyTorch version: 1.10.0+cpu
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.3 LTS (x86_64)
GCC version: (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
Clang version: Could not collect
CMake version: version 3.16.3
Libc version: glibc-2.31

Python version: 3.8.10 (default, Mar 15 2022, 12:22:08)  [GCC 9.4.0] (64-bit runtime)
Python platform: Linux-5.15.0-27-generic-x86_64-with-glibc2.29
Is CUDA available: False
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

Versions of relevant libraries:
[pip3] mypy==0.950
[pip3] mypy-extensions==0.4.3
[pip3] numpy==1.21.6
[pip3] torch==1.10.0+cpu
[conda] Could not collect