Skip to content

paddle.full causes segmentation fault when passed array-like fill value #72709

@deepliao

Description

@deepliao

Summary

当向 paddle.full 函数传递一个数组(array-like)作为 fill_value 参数时,程序发生段错误(Segmentation Fault)。此行为属于用户误用,但框架抛出合适的异常信息是不是比直接崩溃更为合适。

Code to reproduce bug

import paddle
import numpy as np

np.random.seed(42)

# This line triggers the segfault
input_tensor = paddle.full([1, 1], np.random.randn(1, 1) + 1j, dtype='complex64')

Output:

--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0   paddle::pybind::eager_api_full(_object*, _object*, _object*)
1   paddle::pybind::CastPyArg2Scalar(_object*, std::string const&, long) 
2   paddle::pybind::CastNumpy2Scalar(_object*, std::string const&, long) 
3   paddle::pybind::PyObject_ToDouble(_object*)

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

Segmentation fault (core dumped)

System Information

OneFlow installation: pip
OS: Ubuntu 20.04
OneFlow version (run python3 -m oneflow --doctor):

path: ['/root/miniconda3/envs/myconda/lib/python3.8/site-packages/oneflow']
version: 0.9.0
git_commit: 381b12c
cmake_build_type: Release
rdma: True
mlir: True

Python version: 3.8
CUDA driver version: 11.6
GPU models: NVIDIA A16

其他补充信息 Additional Supplementary Information

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions