Segmentation fault in paddle.multiplex.

wbrvyc0a  于 2个月前  发布在  其他
关注(0)|答案(2)|浏览(24)

bug描述 Describe the Bug

您好,以下是我的报告内容。
paddle.multiplex 缺少对输入参数 inputs 的深入类型判断。

当输入的 inputs 为list,但列表元素不是多维Tensor时,空指针导致程序进程崩溃,出现Segmentation fault (core dumped)。

这段简单的代码可以复现这个错误。

import paddle

img1 = [[1, 2], [3, 4]]
img2 = [[5, 6], [7, 8]]
inputs = [img1, img2]
index = paddle.to_tensor([[1], [1]], dtype=paddle.int32)
res = paddle.multiplex(inputs, index)
print(res)

报错信息:

WARNING: OMP_NUM_THREADS set to 12, not 1. The computation speed will not be optimized if you use data parallel. It will fail if this PaddlePaddle binary is compiled with OpenBlas since OpenBlas does not support multi-threads.
PLEASE USE OMP_NUM_THREADS WISELY.
--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   paddle::pybind::eager_api_multiplex(_object*, _object*, _object*)
1   paddle::pybind::GetTensorListFromArgs(std::string const&, std::string const&, _object*, long, bool, phi::distributed::ProcessMesh const*)
2   phi::TypeInfoTraits<phi::TensorBase, phi::distributed::DistTensor>::classof(phi::TensorBase const*)
----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1714811988 (unix time) try "date -d @1714811988" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0xa) received by PID 30576 (TID 0x7fa958823280) from PID 10 ***]

Segmentation fault (core dumped)

其他补充信息 Additional Supplementary Information

版本:paddlepaddle 2.6 (cpu)

jm81lzqq

jm81lzqq1#

好的,谢谢反馈。我们内部看一下

ghhaqwfi

ghhaqwfi2#

您好,这是我补充的测试用例:

import paddle

inputs=[0.4182267863762318, 0.5395831069848569, 0.39240171609240226]
index=paddle.randint(low=0, high=100, shape=(2,), dtype=paddle.int32)
paddle.multiplex(inputs=inputs,index=index)

输出内容:

--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   paddle::pybind::eager_api_multiplex(_object*, _object*, _object*)
1   paddle::pybind::GetTensorListFromArgs(std::string const&, std::string const&, _object*, long, bool, phi::distributed::ProcessMesh const*)
2   phi::TypeInfoTraits<phi::TensorBase, phi::distributed::DistTensor>::classof(phi::TensorBase const*)

----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
  [TimeInfo: *** Aborted at 1715238912 (unix time) try "date -d @1715238912" if you are using GNU date ***]
  [SignalInfo: *** SIGSEGV (@0x0) received by PID 527163 (TID 0x7f3943c9a280) from PID 0 ***]

Segmentation fault (core dumped)

相关问题