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 in paddle.multiplex. #64117

Open
Zoeeeeey opened this issue May 8, 2024 · 2 comments
Open

Segmentation fault in paddle.multiplex. #64117

Zoeeeeey opened this issue May 8, 2024 · 2 comments
Assignees

Comments

@Zoeeeeey
Copy link

Zoeeeeey commented May 8, 2024

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)

@minghaoBD
Copy link
Contributor

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

@Zoeeeeey
Copy link
Author

Zoeeeeey commented May 9, 2024

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

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants