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

同名变量多次调用 Tensor.detach_ 能稳定引发段错误 #57303

Closed
RedContritio opened this issue Sep 13, 2023 · 3 comments
Closed

同名变量多次调用 Tensor.detach_ 能稳定引发段错误 #57303

RedContritio opened this issue Sep 13, 2023 · 3 comments
Assignees
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/reviewing 需求review中 type/bug-report 报bug

Comments

@RedContritio
Copy link
Contributor

bug描述 Describe the Bug

重新创建同名变量并调用 detach_,将导致段错误

最小可复现代码:

import paddle
x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
x.detach_()
x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
x.detach_()

错误信息

Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
, 1.0]], stop_gradient=False)
x.detach_()
x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
x.detach_()
>>> x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
>>> x.detach_()
Tensor(shape=[1, 3], dtype=float32, place=Place(cpu), stop_gradient=True,
       [[1., 1., 1.]])
>>> x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
>>> x.detach_()


--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
No stack trace in paddle, may be caused by external reasons.

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

Segmentation fault (core dumped)

其他补充信息 Additional Supplementary Information

No response

@RedContritio RedContritio changed the title 同名变量多次调用 Tensor.detach_ 引发段错误 同名变量多次调用 Tensor.detach_ 能稳定引发段错误 Sep 13, 2023
@kangguangli
Copy link
Contributor

感谢同学的反馈和给出的用例,已反馈给同事,后续我们会及时修复,进展会在issue中同步。

@paddle-bot paddle-bot bot added the PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc label Sep 14, 2023
@wanghuancoder
Copy link
Contributor

bug描述 Describe the Bug

重新创建同名变量并调用 detach_,将导致段错误

最小可复现代码:

import paddle
x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
x.detach_()
x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
x.detach_()

错误信息

Python 3.8.10 (default, Nov 14 2022, 12:59:47) 
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import paddle
, 1.0]], stop_gradient=False)
x.detach_()
x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
x.detach_()
>>> x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
>>> x.detach_()
Tensor(shape=[1, 3], dtype=float32, place=Place(cpu), stop_gradient=True,
       [[1., 1., 1.]])
>>> x = paddle.to_tensor(data=[[1.0, 1.0, 1.0]], stop_gradient=False)
>>> x.detach_()


--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
No stack trace in paddle, may be caused by external reasons.

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

Segmentation fault (core dumped)

其他补充信息 Additional Supplementary Information

No response

反写反馈,这个PR可以修复这个问题。#57394

Copy link

paddle-bot bot commented Sep 17, 2024

Since you haven't replied for more than a year, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
由于您超过一年未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PFCC Paddle Framework Contributor Club,https://github.com/PaddlePaddle/community/tree/master/pfcc status/reviewing 需求review中 type/bug-report 报bug
Projects
None yet
Development

No branches or pull requests

4 participants