FAQ
# New Ticket Created by Andreas Koenig
# Please include the string: [perl #39090]
# in the subject line of all future correspondence about this issue.
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=39090 >


(Sorry if this comes as a duplicate. From my perspective perlbug does
not seem to have succeeded in delivering this bugreport.)


package Regexp;
use overload qq{""} => "stringify";
sub stringify { "$_[0]" }
my $qr = qr{foo};
print $qr;
__END__

The above program gives a SEGV. Sure, it is an endless recursion, but
still it should not segfault.

Tested with 5.8.7 and bleedperl@28101. With the latter I saw this backtrace:

#0 0xa7dcc22f in free () from /lib/tls/libc.so.6
#1 0xa7dcddfc in malloc () from /lib/tls/libc.so.6
#2 0x080a22ad in Perl_safesysmalloc ()
#3 0x080aef3a in Perl_av_extend ()
#4 0x080af38d in Perl_av_store ()
#5 0x08093565 in Perl_pad_push ()
#6 0x080b831a in Perl_pp_entersub ()
#7 0x08068c5c in Perl_amagic_call ()
#8 0x080bcbb2 in Perl_sv_2pv_flags ()
#9 0x080bd128 in Perl_sv_copypv ()
#10 0x080b1480 in Perl_pp_stringify ()
#11 0x080b1258 in Perl_runops_standard ()
#12 0x08068efd in Perl_amagic_call ()
#13 0x080bcbb2 in Perl_sv_2pv_flags ()
#14 0x080bd128 in Perl_sv_copypv ()
#15 0x080b1480 in Perl_pp_stringify ()
#16 0x080b1258 in Perl_runops_standard ()

etc. ad libitum

#87261 0x080b1258 in Perl_runops_standard ()
#87262 0x08068efd in Perl_amagic_call ()
#87263 0x080bcbb2 in Perl_sv_2pv_flags ()
#87264 0x080f4681 in Perl_do_print ()
#87265 0x080b2a51 in Perl_pp_print ()
#87266 0x080b1258 in Perl_runops_standard ()
#87267 0x08061664 in S_run_body ()
#87268 0x080614be in perl_run ()
#87269 0x0805e6bd in main ()

--
andreas

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 6, '06 at 6:20a
activeMay 6, '06 at 9:16a
posts2
users2
websiteperl.org

2 users in discussion

Dave Mitchell: 1 post Andreas Koenig: 1 post

People

Translate

site design / logo © 2022 Grokbase