Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

segmentation fault when returning from a function #22394

Closed
Blade6570 opened this issue Jul 1, 2019 · 5 comments
Closed

segmentation fault when returning from a function #22394

Blade6570 opened this issue Jul 1, 2019 · 5 comments
Labels
module: autograd Related to torch.autograd, and the autograd engine in general triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@Blade6570
Copy link

Blade6570 commented Jul 1, 2019

❓ Questions and Help

Please note that this issue tracker is not a help form and this issue will be closed.

We have a set of listed resources available on the website. Our primary means of support is our discussion forum:

  • Discussion Forum
    Ubuntu: 18.04
    Pytorch:0.3.0
    cuda:9.0
    python3
    ............................
    I have run the code with gdb and the stack-trace is as follows
##0  0x00007ffff7a7b956 in __GI___libc_free (mem=0x8f8a0030) at malloc.c:3086
#1  0x00007fffbd456863 in __gnu_cxx::new_allocator<long>::deallocate (this=<optimized out>, 
    __p=<optimized out>) at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/ext/new_allocator.h:110
#2  std::_Vector_base<long, std::allocator<long> >::_M_deallocate (this=<optimized out>, 
    __n=<optimized out>, __p=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_vector.h:174
#3  std::_Vector_base<long, std::allocator<long> >::~_Vector_base (this=0x8f8a8038, 
    __in_chrg=<optimized out>) at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_vector.h:160
#4  std::vector<long, std::allocator<long> >::~vector (this=0x8f8a8038, __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_vector.h:416
#5  torch::autograd::generated::CatBackward::~CatBackward (this=0x8f8a7fb8, __in_chrg=<optimized out>)
    at torch/csrc/autograd/generated/Functions.h:220
#6  0x00007fffbd389c68 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x8f8a7fa0)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr_base.h:144
#7  std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x8f89c3b8, 
    __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr_base.h:546
#8  std::__shared_ptr<torch::autograd::Function, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (
    this=0x8f89c3b0, __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr_base.h:781
#9  std::shared_ptr<torch::autograd::Function>::~shared_ptr (this=0x8f89c3b0, __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr.h:93
#10 std::pair<std::shared_ptr<torch::autograd::Function>, int>::~pair (this=0x8f89c3b0, 
    __in_chrg=<optimized out>) at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_pair.h:96
#11 std::_Destroy<std::pair<std::shared_ptr<torch::autograd::Function>, int> > (__pointer=0x8f89c3b0)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_construct.h:93
#12 std::_Destroy_aux<false>::__destroy<std::pair<std::shared_ptr<torch::autograd::Function>, int>*> (
    __last=<optimized out>, __first=0x8f89c3b0)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_construct.h:103
#13 std::_Destroy<std::pair<std::shared_ptr<torch::autograd::Function>, int>*> (__last=<optimized out>, 
    __first=<optimized out>) at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_construct.h:126
#14 std::_Destroy<std::pair<std::shared_ptr<torch::autograd::Function>, int>*, std::pair<std::shared_ptr<torch::autograd::Function>, int> > (__last=0x8f89c3e0, __first=0x8f89c3b0)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_construct.h:151
#15 std::vector<std::pair<std::shared_ptr<torch::autograd::Function>, int>, std::allocator<std::pair<std::shared_ptr<torch::autograd::Function>, int> > >::~vector (this=0x8f8a1308, __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_vector.h:415
#16 torch::autograd::Function::~Function (this=0x8f8a12e8, __in_chrg=<optimized out>)
    at /pytorch/torch/csrc/autograd/function.h:77
#17 0x00007fffbd389c68 in std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release (this=0x8f8a12d0)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr_base.h:144
#18 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::~__shared_count (this=0x8f8a37a8, 
    __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr_base.h:546
#19 std::__shared_ptr<torch::autograd::Function, (__gnu_cxx::_Lock_policy)2>::~__shared_ptr (
    this=0x8f8a37a0, __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr_base.h:781
#20 std::shared_ptr<torch::autograd::Function>::~shared_ptr (this=0x8f8a37a0, __in_chrg=<optimized out>)
    at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/shared_ptr.h:93
#21 std::pair<std::shared_ptr<torch::autograd::Function>, int>::~pair (this=0x8f8a37a0, 
    __in_chrg=<optimized out>) at /opt/rh/devtoolset-2/root/usr/include/c++/4.8.2/bits/stl_pair.h:96
#22 std::_Destroy<std::pair<std::shared_ptr<torch::autograd::Function>, int> > (__pointer=0x8f8a37a0)
#
@zou3519
Copy link
Contributor

zou3519 commented Jul 1, 2019

How deep does the stack trace go?

@Blade6570
Copy link
Author

Blade6570 commented Jul 1, 2019

@zou3519 I used "where" in gdb when segfault occurred.

@zou3519
Copy link
Contributor

zou3519 commented Jul 1, 2019

I think the problem is that you are running into a known and fixed bug of crashing on deletion of a deep computation graph. We fixed that issue in v0.4.1. Could you please upgrade your PyTorch and see if that solves the problem for you?

@zhangguanheng66 zhangguanheng66 added module: autograd Related to torch.autograd, and the autograd engine in general triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module labels Jul 1, 2019
@zhangguanheng66
Copy link
Contributor

@zou3519 feel free to close the issue after the user confirm pytorch version. Thanks

@Blade6570
Copy link
Author

@zou3519, I think you are right and v0.4.1 solves the problem. Thanks a lot. closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: autograd Related to torch.autograd, and the autograd engine in general triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

3 participants