记录Pycharm只有Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)报错的可参考解决方法

使用gdb

我遇到的情况是复现代码的时候没有任何报错只有一个code139.
gdb --args python

此时进入gdb调试模式,在该模式下运行train_net.py

(gdb) run train_net.py --config-file=xxx.yaml

结果

Thread 1 "python" received signal SIGSEGV, Segmentation fault.
0x00007fffcc0f61dd in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) () from /lib/x86_64-linux-gnu/libstdc++.so.6

看不懂。输入bt查看堆栈,得到以下代码:

#0  0x00007fffcc0f61dd in std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::string const&) ()
   from /lib/x86_64-linux-gnu/libstdc++.so.6
#1  0x00007fffb3268f77 in c10::RegisterOperators::registerOp_(c10::RegisterOperators::Options&&) ()
   from /xxx/miniconda3/envs/sim/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so
#2  0x00007fffb326b2d0 in c10::RegisterOperators::checkSchemaAndRegisterOp_(c10::RegisterOperators::Options&&) ()
   from //miniconda3/envs/sim/lib/python3.10/site-packages/torch/lib/libtorch_cpu.so
#3  0x00007fff68973b49 in ?? () from /xxx/miniconda3/envs/sim/lib/python3.10/site-packages/torch_scatter/_version_cuda.so
#4  0x00007ffff7fc947e in call_init (l=<optimized out>, argc=argc@entry=7, argv=argv@entry=0x7fffffffda98, env=env@entry=0x555558dfd770) at ./elf/dl-init.c:70
#5  0x00007ffff7fc9568 in call_init (env=0x555558dfd770, argv=0x7fffffffda98, argc=7, l=<optimized out>) at ./elf/dl-init.c:33
#6  _dl_init (main_map=0x55555bdc6c80, argc=7, argv=0x7fffffffda98, env=0x555558dfd770) at ./elf/dl-init.c:117
#7  0x00007ffff7d74af5 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:182
#8  0x00007ffff7fd0ff6 in dl_open_worker (a=0x7fffffff5220) at ./elf/dl-open.c:808
#9  dl_open_worker (a=a@entry=0x7fffffff5220) at ./elf/dl-open.c:771
#10 0x00007ffff7d74a98 in __GI__dl_catch_exception (exception=<optimized out>, operate=<optimized out>, args=<optimized out>) at ./elf/dl-error-skeleton.c:208
#11 0x00007ffff7fd134e in _dl_open (file=<optimized out>, mode=-2147483646, caller_dlopen=0x7ffff7af435c <py_dl_open+140>, nsid=-2, argc=7, 
    argv=<optimized out>, env=0x555558dfd770) at ./elf/dl-open.c:883

唯一能看懂的只有torch_scatter,推测是版本问题,尝试更改其版本后没有该错误了

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值