Skip to content

Segmentation fault with ITIMER_REAL #57185

@sternj

Description

@sternj

🐛 Bug

PyTorch throws SIGSEGV when running alongside timer on MacOS x86

To Reproduce

Steps to reproduce the behavior:

  1. Run code located here on Mac x86

Here is the stack trace from the crashed thread:

Thread 6 Crashed:
0   ???                           	0x00007ffeee6d7138 0 + 140732898570552
1   libtorch_cpu.dylib            	0x000000010392478c at::TensorIteratorBase::serial_for_each(c10::function_ref<void (char**, long long const*, long long, long long)>, at::Range) const + 588
2   libtorch_cpu.dylib            	0x000000010390cdf2 std::__1::__function::__func<at::internal::_parallel_run(long long, long long, long long, std::__1::function<void (long long, long long, unsigned long)> const&)::$_1, std::__1::allocator<at::internal::_parallel_run(long long, long long, long long, std::__1::function<void (long long, long long, unsigned long)> const&)::$_1>, void (int, unsigned long)>::operator()(int&&, unsigned long&&) + 114
3   libtorch_cpu.dylib            	0x000000010390b7ca std::__1::__function::__func<at::(anonymous namespace)::_run_with_pool(std::__1::function<void (int, unsigned long)> const&, unsigned long)::$_3, std::__1::allocator<at::(anonymous namespace)::_run_with_pool(std::__1::function<void (int, unsigned long)> const&, unsigned long)::$_3>, void ()>::operator()() + 42
4   libc10.dylib                  	0x00000001020996c9 c10::ThreadPool::main_loop(unsigned long) + 569
5   libc10.dylib                  	0x0000000102099d43 void* std::__1::__thread_proxy<std::__1::tuple<std::__1::unique_ptr<std::__1::__thread_struct, std::__1::default_delete<std::__1::__thread_struct> >, c10::ThreadPool::ThreadPool(int, int, std::__1::function<void ()>)::$_0> >(void*) + 67
6   libsystem_pthread.dylib       	0x00007fff5a16a2eb _pthread_body + 126
7   libsystem_pthread.dylib       	0x00007fff5a16d249 _pthread_start + 66
8   libsystem_pthread.dylib       	0x00007fff5a16940d thread_start + 13

Expected behavior

Either the program should run without issue or should pass up the SIGALRM.

Environment

Collecting environment information...
PyTorch version: 1.8.1
Is debug build: False
CUDA used to build PyTorch: None
ROCM used to build PyTorch: N/A

OS: macOS 10.14.6 (x86_64)
GCC version: Could not collect
Clang version: 11.0.0 (clang-1100.0.33.12)
CMake version: Could not collect

Python version: 3.9 (64-bit runtime)
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

Versions of relevant libraries:
[pip3] numpy==1.20.1
[pip3] torch==1.8.1
[conda] Could not collect

Metadata

Metadata

Assignees

No one assigned

    Labels

    module: macosMac OS related issuestriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions