Repository: pytorch
Issue: Aborted (core dumped) after Run Pytorch2.0.0, which I compiled by myself
Labels: needs reproduction,module: build,triaged

### 🐛 Describe the bug

When I compiled pytorch2.0.0, it goes some warnings (Problem1-5), But it compiles successfully.

But once I use it, it gets `Aborted (core dumped)` at the end of all calls.

```
(pytorchcov) root@Zay6b1:~/miniconda3/envs/pytorchcov/pytorch# python
Python 3.9.18 (main, Sep 11 2023, 13:41:44) 
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> print(torch.cuda.is_available())
True
>>> quit()
Aborted (core dumped)
```

I want to know how to solve this problem. 

### Error logs



###### Problem 1

```
[5331/6949] Building C object caffe2/CMakeFiles/torch_cpu.dir/__/third_party/miniz-2.1.0/miniz.c.o
/root/miniconda3/envs/pytorchcov/pytorch/third_party/miniz-2.1.0/miniz.c:3157:9: note: #pragma message: Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.
 3157 | #pragma message("Using fopen, ftello, fseeko, stat() etc. path for file I/O - this path may not support large files.")
      |         ^~~~~~~
[5356/6949] Building CXX object caffe2/CMakeFiles/torch_cpu.dir/__/torch/csrc/jit/codegen/onednn/interface.cpp.o
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/interface.cpp: In function ‘torch::jit::Operation torch::jit::createLlgaKernel(const torch::jit::Node*)’:
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/interface.cpp:106:3: warning: ‘torch::jit::Operation::Operation(F&&) [with F = torch::jit::createLlgaKernel(const torch::jit::Node*)::<lambda(torch::jit::Stack*)>; typename std::enable_if<std::is_constructible<std::function<void(std::vector<c10::IValue>*)>, F&&>::value, int>::type <anonymous> = 0]’ is deprecated: Please use void(Stack&) to register operator instead. [-Wdeprecated-declarations]
  106 |   };
      |   ^
In file included from /root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/core/boxing/KernelFunction.h:5,
                 from /root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:4,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/runtime/operator.h:6,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/ir/ir.h:7,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/decompose_silu.h:3,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/interface.cpp:2:
/root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/core/stack.h:25:3: note: declared here
   25 |   Operation(F&& raw): op_([raw = std::forward<F>(raw)](Stack& stack) {
      |   ^~~~~~~~~
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/interface.cpp: In function ‘torch::jit::Operation torch::jit::createLlgaGuardKernel(const torch::jit::Node*)’:
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/interface.cpp:171:3: warning: ‘torch::jit::Operation::Operation(F&&) [with F = torch::jit::createLlgaGuardKernel(const torch::jit::Node*)::<lambda(torch::jit::Stack*)>; typename std::enable_if<std::is_constructible<std::function<void(std::vector<c10::IValue>*)>, F&&>::value, int>::type <anonymous> = 0]’ is deprecated: Please use void(Stack&) to register operator instead. [-Wdeprecated-declarations]
  171 |   };
      |   ^
In file included from /root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/core/boxing/KernelFunction.h:5,
                 from /root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/core/dispatch/Dispatcher.h:4,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/runtime/operator.h:6,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/ir/ir.h:7,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/decompose_silu.h:3,
                 from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/jit/codegen/onednn/interface.cpp:2:
/root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/core/stack.h:25:3: note: declared here
   25 |   Operation(F&& raw): op_([raw = std::forward<F>(raw)](Stack& stack) {
      |   ^~~~~~~~~
```

###### Problem 2

```
[4599/6949] Building CXX object third_party/kineto/libkineto/CMakeFiles/kineto_base.dir/src/DaemonConfigLoader.cpp.o
In file included from /root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/FabricManager.h:12,
                 from /root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/src/IpcFabricConfigClient.h:21,
                 from /root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/src/DaemonConfigLoader.cpp:16:
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h: In instantiation of ‘bool dynolog::ipcfabric::EndPoint<kMaxNumFds>::tryPeekMsg(dynolog::ipcfabric::EndPoint<kMaxNumFds>::TCtxt&) [with long unsigned int kMaxNumFds = 0; dynolog::ipcfabric::EndPoint<kMaxNumFds>::TCtxt = dynolog::ipcfabric::EndPointCtxt<0>]’:
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/FabricManager.h:155:44:   required from here
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h:174:50: warning: throw will always call terminate() [-Wterminate]
  174 |     throw std::runtime_error(std::strerror(errno));
      |                                                  ^
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h: In instantiation of ‘const char* dynolog::ipcfabric::EndPoint<kMaxNumFds>::getName(const TCtxt&) const [with long unsigned int kMaxNumFds = 0; dynolog::ipcfabric::EndPoint<kMaxNumFds>::TCtxt = dynolog::ipcfabric::EndPointCtxt<0>]’:
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/FabricManager.h:170:54:   required from here
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h:187:66: warning: throw will always call terminate() [-Wterminate]
  187 |             ". Expected to start with " + std::string(socket_dir));
      |                                                                  ^
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h:194:48: warning: throw will always call terminate() [-Wterminate]
  194 |             std::string(ctxt.msg_name.sun_path));
      |                                                ^
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h: In instantiation of ‘bool dynolog::ipcfabric::EndPoint<kMaxNumFds>::tryRcvMsg(dynolog::ipcfabric::EndPoint<kMaxNumFds>::TCtxt&) [with long unsigned int kMaxNumFds = 0; dynolog::ipcfabric::EndPoint<kMaxNumFds>::TCtxt = dynolog::ipcfabric::EndPointCtxt<0>]’:
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/FabricManager.h:178:45:   required from here
/root/miniconda3/envs/pytorchcov/pytorch/third_party/kineto/libkineto/third_party/dynolog/dynolog/src/ipcfabric/Endpoint.h:160:50: warning: throw will always call terminate() [-Wterminate]
  160 |     throw std::runtime_error(std::strerror(errno));
```

###### Problem 3

```
[6274/6949] Building CXX object caffe2/CMakeFiles/torch_cuda.dir/__/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_api.cpp.o
/root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_api.cpp: In function ‘void fmha::set_params_fprop(FMHA_fprop_params&, size_t, size_t, size_t, size_t, size_t, at::Tensor, at::Tensor, at::Tensor, at::Tensor, void*, void*, void*, void*, void*, float, float, bool, int)’:
/root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_api.cpp:72:38: warning: ‘void* memset(void*, int, size_t)’ clearing an object of non-trivial type ‘struct FMHA_fprop_params’; use assignment or value-initialization instead [-Wclass-memaccess]
   72 |     memset(&params, 0, sizeof(params));
      |                                      ^
In file included from /root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/native/transformers/cuda/flash_attn/fmha_api.cpp:38:
/root/miniconda3/envs/pytorchcov/pytorch/aten/src/ATen/native/transformers/cuda/flash_attn/fmha.h:75:8: note: ‘struct FMHA_fprop_params’ declared here
   75 | struct FMHA_fprop_params : public Qkv_params {
      | 
```

###### Problem 4

```
torch::jit::Operation::Operation(F&&) 
[with F = torch::jit::createLlgaGuardKernel(const torch::jit::Node*)::<lambda(torch::jit::Stack*)>;  
typename std::enable_if<std::is_constructible<std::function<void(std::vector<c10::IValue>*)>, F&&>::value, int>::type <anonymous>  = 0]
```

###### Problem 5

```
[6808/6949] Building CXX object caffe2/torch/CMakeFiles/torch_python.dir/csrc/cuda/shared/cudart.cpp.o
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/cuda/shared/cudart.cpp: In function ‘void torch::cuda::shared::initCudartBindings(PyObject*)’:
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/cuda/shared/cudart.cpp:103:7: warning: ‘cudaError_t cudaProfilerInitialize(const char*, const char*, cudaOutputMode_t)’ is deprecated [-Wdeprecated-declarations]
  103 |       cudaProfilerInitialize);
      |       ^~~~~~~~~~~~~~~~~~~~~~
In file included from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/cuda/shared/cudart.cpp:5:
/usr/local/cuda/include/cuda_profiler_api.h:134:57: note: declared here
  134 | extern __CUDA_DEPRECATED __host__ cudaError_t CUDARTAPI cudaProfilerInitialize(const char *configFile,
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~
/root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/cuda/shared/cudart.cpp:103:29: warning: ‘cudaError_t cudaProfilerInitialize(const char*, const char*, cudaOutputMode_t)’ is deprecated [-Wdeprecated-declarations]
  103 |       cudaProfilerInitialize);
      |                             ^
In file included from /root/miniconda3/envs/pytorchcov/pytorch/torch/csrc/cuda/shared/cudart.cpp:5:
/usr/local/cuda/include/cuda_profiler_api.h:134:57: note: declared here
  134 | extern __CUDA_DEPRECATED __host__ cudaError_t CUDARTAPI cudaProfilerInitialize(const char *configFile,
      |                                                         ^~~~~~~~~~~~~~~~~~~~~~
```


### Minified repro

_No response_

### Versions

Here is my env:

```
(pytorchcov) root@Zay6b1:~/miniconda3/envs/pytorchcov/pytorch/torch/utils# python collect_env.py
Collecting environment information...
PyTorch version: 2.0.0a0+gitc263bd4
Is debug build: True
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A

OS: Ubuntu 20.04.5 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.26.4
Libc version: glibc-2.31

Python version: 3.9.18 (main, Sep 11 2023, 13:41:44)  [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-4.19.0-14-amd64-x86_64-with-glibc2.31
Is CUDA available: True
CUDA runtime version: 11.7.99
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA GeForce RTX 2080 Ti
Nvidia driver version: 510.54
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.5.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.5.0
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          48
On-line CPU(s) list:             0-47
Thread(s) per core:              2
Core(s) per socket:              12
Socket(s):                       2
NUMA node(s):                    2
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           63
Model name:                      Intel(R) Xeon(R) CPU E5-2678 v3 @ 2.50GHz
Stepping:                        2
CPU MHz:                         1650.720
CPU max MHz:                     3300.0000
CPU min MHz:                     1200.0000
BogoMIPS:                        4999.95
Virtualization:                  VT-x
L1d cache:                       768 KiB
L1i cache:                       768 KiB
L2 cache:                        6 MiB
L3 cache:                        60 MiB
NUMA node0 CPU(s):               0-11,24-35
NUMA node1 CPU(s):               12-23,36-47
Vulnerability Itlb multihit:     KVM: Mitigation: Split huge pages
Vulnerability L1tf:              Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:               Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:          Mitigation; PTI
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Full generic retpoline, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm ida arat pln pts md_clear flush_l1d

Versions of relevant libraries:
[pip3] numpy==1.26.1
[pip3] torch==2.0.0a0+gitc263bd4
[conda] magma-cuda110             2.5.2                         1    pytorch
[conda] mkl                       2023.1.0         h213fc3f_46343    defaults
[conda] mkl-include               2023.1.0         h06a4308_46343    defaults
[conda] numpy                     1.26.1                   pypi_0    pypi
[conda] torch                     2.0.0a0+gitc263bd4           dev_0    <develop>
Aborted (core dumped)
```

As you can see, after the `collect_env.py` call, there is also `Aborted (core dumped)`. 
I think it was a problem in my compilation process. When I used torch2.0.0, she could output normally, but there was an `Aborted (core dumped)` after the program ended.

cc @malfet @seemethere @ezyang @msaroufim @wconstab @bdhirsh @anijain2305 @zou3519