develooper Front page | perl.perl5.porters | Postings from January 2008

[perl #49366] SEGFAULT with with tie and STDOUT

Thread Next
From:
Steve Peters
Date:
January 3, 2008 20:32
Subject:
[perl #49366] SEGFAULT with with tie and STDOUT
Message ID:
rt-3.6.HEAD-21319-1199421124-1418.49366-75-0@perl.org
# New Ticket Created by  Steve Peters 
# Please include the string:  [perl #49366]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=49366 >


The code below SEGFAULTS with Perls back to at least 5.8.1-RC3 through
up to date bleadperls.

use strict;

package TestHandle;
require Tie::Handle;

use base qw(Tie::Handle);

sub TIEHANDLE { print "<TestHandle>\n"; my $i; bless \$i, shift }
sub PRINT { print $self "<TestHandle>:  ", shift }

package main;
tie *STDOUT, "TestHandle";
print "Hello";

The actual output is...

<TestHandle>
Deep recursion on subroutine "TestHandle::PRINT" at Foo2.pl line 12.
Segmentation fault (core dumped)

I'm certainly doing something wrong, but a SEGV is probably not the
right feedback to give the users.


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About