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
"Attempt to free unreferenced scalar" and segfault with tied handle #7175
Comments
From @jlokierCreated by @jlokierThe following code causes the error message "Attempt to free { local $handle = new (); undef; } Although that test looks contrived and silly, it is the result of The general problem appears to be that it the destructor, DESTROY, The obvious workaround is to not call anything much from DESTROY. But When the real program runs, there are several messages like that, plus Attempt to free unreferenced scalar at httpd.pl line 516. A short while after comes "Segmentation fault". Here is a test program which immediately triggers a segmentation fault: { local $handle = new (); undef; } Thanks, Perl Info
|
From @iabynOn Sun, Mar 14, 2004 at 03:11:25PM -0000, Jamie Lokier wrote:
Thanks for the report. The heart of the fault turns out to be the way that It can be triggered with the following even simpler code: sub X::DESTROY { $x=0 }; $ perl583 /tmp/p1 The fix is trivial, and I've applied the patch below to the development -- Change 22500 by davem@davem-percy on 2004/03/14 20:13:47 [perl #27638] scope exit could expose freed local() value Affected files ... ... //depot/perl/scope.c#119 edit Differences ... ==== //depot/perl/scope.c#119 (text) ==== @@ -782,8 +782,8 @@ ==== //depot/perl/t/op/localref.t#2 (text) ==== @@ -3,7 +3,7 @@ $aa = 1; |
The RT System itself - Status changed from 'new' to 'open' |
@iabyn - Status changed from 'open' to 'resolved' |
From @ysthOn Sun, Mar 14, 2004 at 08:38:21PM +0000, Dave Mitchell <davem@fdisolutions.com> wrote:
Is #27268 related to this? |
From @iabynOn Sun, Mar 14, 2004 at 03:41:35PM -0800, Yitzchak Scott-Thoennes wrote:
No :-( -- |
Migrated from rt.perl.org#27638 (status was 'resolved')
Searchable as RT27638$
The text was updated successfully, but these errors were encountered: