if you haven't yet seen previous BBC articles, the intent is to bring
the bleeding edge perl people together with those whose modules on
CPAN suffer from expected changes in the next version of perl. You may
not be amused by the fact that your module has an issue with
bleadperl, but chances are good that the problem can be resolved
before 5.10 comes out if only somebody chimes in to explain what's the
issue.
See the facts. Somehow your code triggers a different behaviour of
perl since patch 26487
(http://public.activestate.com/cgi-bin/perlbrowse/p/26487)
Change 26487 by nicholas@nicholas-saigo on 2005/12/26 12:31:01
Rework constant.pm to take advantage of the space savings of proxy
constant subroutines whenever it can.
which leads to a test failure:
t/37-translator-graph......Can't locate object method "is_trivial_link" via package "GLOB" at /home/sand/.cpan/build/SQL-Translator-0.08001-oWjySe/blib/lib/SQL/Translator/Schema/Graph.pm line 46.
# Looks like you planned 3 tests but only ran 2.
# Looks like your test died just after 2.
dubious
Test returned status 255 (wstat 65280, 0xff00)
DIED. FAILED test 3
Failed 1/3 tests, 66.67% okay
I had no success when I tried to reduce the bug to a small testcase,
sorry.
Maybe Nicholas will follow up with an explanation what is happening?
Hope this helps,
--
andreas
(hoping that this is the last BBC article before 5.10 comes out)
> See the facts. Somehow your code triggers a different behaviour of
> perl since patch 26487
> (http://public.activestate.com/cgi-bin/perlbrowse/p/26487)
> Change 26487 by nicholas@nicholas-saigo on 2005/12/26 12:31:01
> Rework constant.pm to take advantage of the space savings of proxy
> constant subroutines whenever it can.
> which leads to a test failure:
> t/37-translator-graph......Can't locate object method "is_trivial_link" via package "GLOB" at /home/sand/.cpan/build/SQL-Translator-0.08001-oWjySe/blib/lib/SQL/Translator/Schema/Graph.pm line 46.
Yesterday on IRC I observed:
23:51:48 <@rjbs> Hm. Rose::HTML::Object::Messages breaks on 5.10
23:51:48 <@rjbs> next unless(defined *{$fq_sub}{'CODE'} && $name =~
/^[A-Z0-9_]+$/);
23:52:05 <@rjbs> $fq_sub is a string (symbolic ref)
23:52:05 <@rjbs> Not a GLOB reference at lib/Rose/HTML/Object/Messages.pm line
168.
and a binary search confirms, this belongs into the same BBC drawer.
HTH,
--
andreas
Easily fixed, too:
I didn't easily reproduce this in a small test case, but I didn't try for very
long, since the fix for RHO was obvious.
--
rjbs
Um, this wasn't fun to track down. In fact, mid way I cleaned the bathroom in
preference. But I think I killed it dead dead dead.
Nicholas Clark
Change 32172 by nicholas@nicholas-saigo on 2007/10/22 20:19:55
SQL::Translator triggered a subtle piece of wrongness, whereby it
managed to cause a proxy constant subroutine in the symbol table to
be upgraded to a GV at precisely the point where it was being
considered as a possible IO handle name. The core's user-space visible
behaviour certainly was buggy - I believe this patch to be the correct
fix. However, it seems to be very hard to write a test for it.
Affected files ...
... //depot/perl/gv.c#385 edit
Differences ...
==== //depot/perl/gv.c#385 (text) ====
@@ -875,6 +875,7 @@
const I32 add = flags & ~GV_NOADD_MASK;
const char *const name_end = nambeg + full_len;
const char *const name_em1 = name_end - 1;
+ U32 faking_it;
if (flags & GV_NOTQUAL) {
/* Caller promised that there is no stash, so we can skip the check. */
@@ -1071,12 +1072,19 @@
return gv;
}
- /* Adding a new symbol */
+ /* Adding a new symbol.
+ Unless of course there was already something non-GV here, in which case
+ we want to behave as if there was always a GV here, containing some sort
+ of subroutine.
+ Otherwise we run the risk of creating things like GvIO, which can cause
+ subtle bugs. eg the one that tripped up SQL::Translator */
+
+ faking_it = SvOK(gv);
if (add & GV_ADDWARN && ckWARN_d(WARN_INTERNAL))
Perl_warner(aTHX_ packWARN(WARN_INTERNAL), "Had to create %s unexpectedly", nambeg);
gv_init(gv, stash, name, len, add & GV_ADDMULTI);
- gv_init_sv(gv, sv_type);
+ gv_init_sv(gv, faking_it ? SVt_PVCV : sv_type);
if (isALPHA(name[0]) && ! (isLEXWARN_on ? ckWARN(WARN_ONCE)
: (PL_dowarn & G_WARN_ON ) ) )
> Um, this wasn't fun to track down. In fact, mid way I cleaned the
> bathroom in preference. But I think I killed it dead dead dead.
Well, I need some hygiene routine too now.
--
Affijn, Ruud
"Gewoon is een tijger."