develooper Front page | perl.perl5.porters | Postings from September 2010

Re: [perl #76138] perl inadvertently destroys signal handlers as of f746176000

Thread Previous | Thread Next
From:
Father Chrysostomos
Date:
September 5, 2010 12:48
Subject:
Re: [perl #76138] perl inadvertently destroys signal handlers as of f746176000
Message ID:
917BACCE-1D53-4A97-8B6C-D51D64CEA0F6@cpan.org

On Aug 31, 2010, at 10:24 AM, Florian Ragwitz wrote:

> Father Chrysostomos <sprout@cpan.org> writes:
>> Here’s a patch. All tests pass, except for cpan/CGI/t/http.t, which
>> always fails. Attached also is a file with perldelta entries.
> 
> Thank you! I very much appreciate you writing perldelta entries for your
> changes.
> 
>> The diff may be a bit confusing. I moved the cases for ISA and
>> OVERLOAD up into a new switch block that only applies to packages
>> other than main. diff found a different way of looking at it.
> 
> This part of the diff has me a little confused:
> 
> +	    case 'I':
> +		goto magicalise_isa;
> +	    case 'O':
> +		goto magicalise_overload;
> 	    case 'S':
> 		if (strEQ(name2, "IG")) {
> 		    HV *hv;
> 
> That's a chunk in the second switch, for symbols in PL_defstash. Why
> does ISA and OVERLOAD need special handling there?

Because main is a package just like any other, except that it’s not like any other.

> And they do, why is
> it enough to check only for the first character before jumping to the
> relevant code in tie first switch for symbols in main::?

That was a mistake. Thank you for catching it!

> Without those 4 lines, all the tests still pass.

That’s because there are not enough tests. I’ve attached a test for @main::ISA. I managed to get ‘use overload’ from main to produce warnings, but I can’t reproduce it in a test script without fresh_perl. Is there any reason we couldn’t switch lib/overload.t over to test.pl?

$ ./perl -Ilib -lwe 'use overload q\""\ => sub {"ning"}; print bless []'
Name "main::OVERLOAD" used only once: possible typo at lib/overload.pm line 11.
ning

> 
>> For posterity, every test in leaky-magic.t fails without the gv.c
>> changes, except for qw< %! %+ %- $/ $: $0 >, which seem to be
>> unaffected by this bug.
> 
> In that test, you do
> 
> +sub tests'VERSION { $tests += pop };
> 
> Is using ' instead of :: there actually relevant to the test? It seems
> like there's a pretty broad consensus on not doing that anymore for new
> code within the core.

OK, I’ve changed it. That was copied and pasted from elsewhere. But doesn’t it make it less likely that we’ll catch buggy interactions between features if we try to keep the tests too standardised?

Attached is a new patch.


Thread Previous | 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