Skip to content

Seg fault using as_strided #39281

@jraman

Description

@jraman

🐛 Bug

The following code seg faults:

import torch
torch.tensor(4.).as_strided((1, ), ())
# Segmentation fault: 11

To Reproduce

See above.

Expected behavior

Expected an error message. Not a segmentation fault (which also kills the python interpreter).

Environment

Able to reproduce on colab and on Mac OSX. The following env is from colab. The Mac OSX env is also with torch 1.5.0, but without cuda.

Collecting environment information...
PyTorch version: 1.5.0+cu101
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
CMake version: version 3.12.0

Python version: 3.6
Is CUDA available: No
CUDA runtime version: 10.1.243
GPU models and configuration: Could not collect
Nvidia driver version: Could not collect
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.5

Versions of relevant libraries:
[pip3] numpy==1.18.4
[pip3] torch==1.5.0+cu101
[pip3] torchsummary==1.5.1
[pip3] torchtext==0.3.1
[pip3] torchvision==0.6.0+cu101
[conda] Could not collect

cc @ezyang @gchanan @zou3519

Metadata

Metadata

Assignees

No one assigned

    Labels

    high prioritymodule: crashProblem manifests as a hard crash, as opposed to a RuntimeErrortriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions