Skip Menu |
Report information
Id: 49472
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: mz [at] webdev07.wirtschaftsblatt.lan
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: (no value)
Fixed In: 5.10.1



Subject: Attributes + Unkown Error
Date: Mon, 7 Jan 2008 14:42:09 +0100 (CET)
To: perlbug [...] perl.org
From: mz [...] localhost
Download (untitled) / with headers
text/plain 3.3k
This is a bug report for perl from mz@webdev07, generated with the help of perlbug 1.36 running under perl 5.10.0. trying to compile the below module with perl5.10 yields a fuzzy error message -------------->8------------------------------------ mz@webdev07:tmp$ perl5.10.0 -MUnknownError -I/tmp Unknown error Compilation failed in require. BEGIN failed--compilation aborted. mz@webdev07:tmp$ -------------->8------------------------------------ in contrast to 5.8.8 where the linenumber and the reason are given -------------->8------------------------------------ mz@webdev07:tmp$ perl5.8.8 -MUnknownError -I/tmp Global symbol "$asd" requires explicit package name at /tmp/UnknownError.pm line 8. BEGIN not safe after errors--compilation aborted at /tmp/UnknownError.pm line 9. Compilation failed in require. BEGIN failed--compilation aborted. mz@webdev07:tmp$ -------------->8------------------------------------ -------------->8------------------------------------ package UnknownError; use strict; sub MODIFY_CODE_ATTRIBUTES {} sub asd : Blah { $asd; } 1; -------------->8------------------------------------ --- Flags: category=core severity=medium --- Site configuration information for perl 5.10.0: Configured by mz at Wed Jan 2 10:30:04 CET 2008. Summary of my perl5 (revision 5 version 10 subversion 0) configuration: Platform: osname=linux, osvers=2.6.22-14-generic, archname=i686-linux uname='linux webdev07 2.6.22-14-generic #1 smp tue dec 18 08:02:57 utc 2007 i686 gnulinux ' config_args='-des -Dprefix=/home/mz/perl5.10.0' hint=recommended, useposix=true, d_sigaction=define useithreads=undef, usemultiplicity=undef useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=undef, use64bitall=undef, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='cc', ccflags ='-fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2', cppflags='-fno-strict-aliasing -pipe -I/usr/local/include' ccversion='', gccversion='4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)', gccosandvers='' intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=4, prototype=define Linker and Libraries: ld='cc', ldflags =' -L/usr/local/lib' libpth=/usr/local/lib /lib /usr/lib /usr/lib64 libs=-lnsl -ldl -lm -lcrypt -lutil -lc perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a gnulibc_version='2.6.1' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E' cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib' Locally applied patches: --- @INC for perl 5.10.0: /home/mz/perl5.10.0/lib/5.10.0/i686-linux /home/mz/perl5.10.0/lib/5.10.0 /home/mz/perl5.10.0/lib/site_perl/5.10.0/i686-linux /home/mz/perl5.10.0/lib/site_perl/5.10.0 . --- Environment for perl 5.10.0: HOME=/home/mz LANG=en_US.UTF-8 LANGUAGE (unset) LD_LIBRARY_PATH (unset) LOGDIR (unset) PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/home/mz/bin:/usr/local/mysql/bin:/usr/local/j2re/bin PERL_BADLANG (unset) SHELL=/bin/bash
CC: frank.wiegand [...] gmail.com, Dave Mitchell <davem [...] iabyn.com>
Subject: Re: [perl #49472] Attributes + Unkown Error
Date: Sat, 09 Feb 2008 06:35:11 +0100
To: perl5-porters [...] perl.org
From: andreas.koenig.7os6VVqR [...] franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Mon, 07 Jan 2008 05:42:51 -0800, "mz@webdev07.wirtschaftsblatt.lan (via RT)" <perlbug-followup@perl.org> said:
Show quoted text
> trying to compile the below module with perl5.10 yields a fuzzy error message
--------------> 8------------------------------------ Show quoted text
> mz@webdev07:tmp$ perl5.10.0 -MUnknownError -I/tmp > Unknown error > Compilation failed in require. > BEGIN failed--compilation aborted. > mz@webdev07:tmp$
--------------> 8------------------------------------ Show quoted text
> in contrast to 5.8.8 where the linenumber and the reason are given
--------------> 8------------------------------------ Show quoted text
> mz@webdev07:tmp$ perl5.8.8 -MUnknownError -I/tmp > Global symbol "$asd" requires explicit package name at /tmp/UnknownError.pm line 8. > BEGIN not safe after errors--compilation aborted at /tmp/UnknownError.pm line 9. > Compilation failed in require. > BEGIN failed--compilation aborted. > mz@webdev07:tmp$
--------------> 8------------------------------------ Binary search reveals the reduced errormessage started with 31255. -- andreas
CC: perl5-porters [...] perl.org, frank.wiegand [...] gmail.com, Dave Mitchell <davem [...] iabyn.com>
Subject: Re: [perl #49472] Attributes + Unkown Error
Date: Sat, 9 Feb 2008 11:26:13 +0000
To: "Andreas J. Koenig" <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
From: Nicholas Clark <nick [...] ccl4.org>
Download (untitled) / with headers
text/plain 8.4k
On Sat, Feb 09, 2008 at 06:35:11AM +0100, Andreas J. Koenig wrote: Show quoted text
> Binary search reveals the reduced errormessage started with 31255.
Feeling somewhat more "in your face" than Andreas, I've appended it all, as it doesn't look that complex. I wonder where the bug is hiding... Nicholas Clark Change 31255 by davem@davem-pigeon on 2007/05/21 22:35:15 move PL_error_count into the PL_parser struct Affected files ... ... //depot/perl/embedvar.h#253 edit ... //depot/perl/intrpvar.h#213 edit ... //depot/perl/op.c#942 edit ... //depot/perl/parser.h#19 edit ... //depot/perl/perl.c#812 edit ... //depot/perl/perlapi.h#175 edit ... //depot/perl/pp_ctl.c#618 edit ... //depot/perl/sv.c#1405 edit ... //depot/perl/toke.c#784 edit Differences ... ==== //depot/perl/embedvar.h#253 (text+w) ==== @@ -133,7 +133,6 @@ #define PL_endav (vTHX->Iendav) #define PL_envgv (vTHX->Ienvgv) #define PL_errgv (vTHX->Ierrgv) -#define PL_error_count (vTHX->Ierror_count) #define PL_errors (vTHX->Ierrors) #define PL_euid (vTHX->Ieuid) #define PL_eval_root (vTHX->Ieval_root) @@ -453,7 +452,6 @@ #define PL_Iendav PL_endav #define PL_Ienvgv PL_envgv #define PL_Ierrgv PL_errgv -#define PL_Ierror_count PL_error_count #define PL_Ierrors PL_errors #define PL_Ieuid PL_euid #define PL_Ieval_root PL_eval_root ==== //depot/perl/intrpvar.h#213 (text) ==== @@ -357,7 +357,6 @@ PERLVAR(Iors_sv, SV *) /* output record separator $\ */ /* statics moved here for shared library purposes */ PERLVARI(Igensym, I32, 0) /* next symbol for getsym() to define */ -PERLVAR(Ierror_count, U8) /* how many errors so far, max 10 */ PERLVARI(Icv_has_eval, bool, FALSE) /* PL_compcv includes an entereval or similar */ PERLVARI(Ilaststype, U16, OP_STAT) PERLVARI(Ilaststatval, int, -1) ==== //depot/perl/op.c#942 (text) ==== @@ -799,7 +799,8 @@ OP *kid; /* assumes no premature commitment */ - if (!o || PL_error_count || (o->op_flags & OPf_WANT) + if (!o || (PL_parser && PL_parser->error_count) + || (o->op_flags & OPf_WANT) || o->op_type == OP_RETURN) { return o; @@ -897,7 +898,8 @@ /* assumes no premature commitment */ want = o->op_flags & OPf_WANT; - if ((want && want != OPf_WANT_SCALAR) || PL_error_count + if ((want && want != OPf_WANT_SCALAR) + || (PL_parser && PL_parser->error_count) || o->op_type == OP_RETURN) { return o; @@ -1142,7 +1144,8 @@ OP *kid; /* assumes no premature commitment */ - if (!o || (o->op_flags & OPf_WANT) || PL_error_count + if (!o || (o->op_flags & OPf_WANT) + || (PL_parser && PL_parser->error_count) || o->op_type == OP_RETURN) { return o; @@ -1268,7 +1271,7 @@ /* -1 = error on localize, 0 = ignore localize, 1 = ok to localize */ int localize = -1; - if (!o || PL_error_count) + if (!o || (PL_parser && PL_parser->error_count)) return o; if ((o->op_private & OPpTARGET_MY) @@ -1697,7 +1700,7 @@ dVAR; OP *kid; - if (!o || PL_error_count) + if (!o || (PL_parser && PL_parser->error_count)) return o; switch (o->op_type) { @@ -1945,7 +1948,7 @@ dVAR; I32 type; - if (!o || PL_error_count) + if (!o || (PL_parser && PL_parser->error_count)) return o; type = o->op_type; @@ -2373,7 +2376,7 @@ goto nope; } - if (PL_error_count) + if (PL_parser && PL_parser->error_count) goto nope; /* Don't try to run w/ errors */ for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) { @@ -2459,7 +2462,7 @@ const I32 oldtmps_floor = PL_tmps_floor; list(o); - if (PL_error_count) + if (PL_parser && PL_parser->error_count) return o; /* Don't attempt to run with errors */ PL_op = curop = LINKLIST(o); @@ -5455,7 +5458,7 @@ if (ps) sv_setpvn((SV*)cv, ps, ps_len); - if (PL_error_count) { + if (PL_parser && PL_parser->error_count) { op_free(block); block = NULL; if (name) { @@ -5540,7 +5543,7 @@ } } - if (name && !PL_error_count) + if (name && ! (PL_parser && PL_parser->error_count)) process_special_blocks(name, gv, cv); } @@ -6243,7 +6246,8 @@ OP * const kid = cUNOPo->op_first; if (kid->op_type == OP_ENTERSUB) { (void) ref(kid, o->op_type); - if (kid->op_type != OP_RV2CV && !PL_error_count) + if (kid->op_type != OP_RV2CV + && !(PL_parser && PL_parser->error_count)) Perl_croak(aTHX_ "%s argument is not a subroutine name", OP_DESC(o)); o->op_private |= OPpEXISTS_SUB; @@ -6759,7 +6763,7 @@ PADOFFSET offset; o->op_ppaddr = PL_ppaddr[OP_GREPSTART]; - /* don't allocate gwop here, as we may leak it if PL_error_count > 0 */ + /* don't allocate gwop here, as we may leak it if PL_parser->error_count > 0 */ if (o->op_flags & OPf_STACKED) { OP* k; @@ -6780,7 +6784,7 @@ else scalar(kid); o = ck_fun(o); - if (PL_error_count) + if (PL_parser && PL_parser->error_count) return o; kid = cLISTOPo->op_first->op_sibling; if (kid->op_type != OP_NULL) ==== //depot/perl/parser.h#19 (text) ==== @@ -77,6 +77,7 @@ HV *in_my_stash; /* declared class of this "my" declaration */ PerlIO *rsfp; /* current source file pointer */ AV *rsfp_filters; /* holds chain of active source filters */ + U8 error_count; /* how many compile errors so far, max 10 */ #ifdef PERL_MAD SV *endwhite; ==== //depot/perl/perl.c#812 (text) ==== @@ -2267,9 +2267,8 @@ /* now parse the script */ SETERRNO(0,SS_NORMAL); - PL_error_count = 0; #ifdef MACOS_TRADITIONAL - if (gMacPerl_SyntaxError = (yyparse() || PL_error_count)) { + if (gMacPerl_SyntaxError = (yyparse() || PL_parser->error_count)) { if (PL_minus_c) Perl_croak(aTHX_ "%s had compilation errors.\n", MacPerl_MPWFileName(PL_origfilename)); else { @@ -2278,7 +2277,7 @@ } } #else - if (yyparse() || PL_error_count) { + if (yyparse() || PL_parser->error_count) { if (PL_minus_c) Perl_croak(aTHX_ "%s had compilation errors.\n", PL_origfilename); else { ==== //depot/perl/perlapi.h#175 (text+w) ==== @@ -302,8 +302,6 @@ #define PL_envgv (*Perl_Ienvgv_ptr(aTHX)) #undef PL_errgv #define PL_errgv (*Perl_Ierrgv_ptr(aTHX)) -#undef PL_error_count -#define PL_error_count (*Perl_Ierror_count_ptr(aTHX)) #undef PL_errors #define PL_errors (*Perl_Ierrors_ptr(aTHX)) #undef PL_euid ==== //depot/perl/pp_ctl.c#618 (text) ==== @@ -1459,7 +1459,8 @@ sv_catsv(PL_errors, err); else Perl_warn(aTHX_ "%"SVf, SVfARG(err)); - ++PL_error_count; + if (PL_parser) + ++PL_parser->error_count; } OP * @@ -2908,7 +2909,6 @@ SAVESPTR(PL_unitcheckav); PL_unitcheckav = newAV(); SAVEFREESV(PL_unitcheckav); - SAVEI8(PL_error_count); #ifdef PERL_MAD SAVEBOOL(PL_madskills); @@ -2918,14 +2918,13 @@ /* try to compile it */ PL_eval_root = NULL; - PL_error_count = 0; PL_curcop = &PL_compiling; CopARYBASE_set(PL_curcop, 0); if (saveop && (saveop->op_type != OP_REQUIRE) && (saveop->op_flags & OPf_SPECIAL)) PL_in_eval |= EVAL_KEEPERR; else sv_setpvn(ERRSV,"",0); - if (yyparse() || PL_error_count || !PL_eval_root) { + if (yyparse() || PL_parser->error_count || !PL_eval_root) { SV **newsp; /* Used by POPBLOCK. */ PERL_CONTEXT *cx = &cxstack[cxstack_ix]; I32 optype = 0; /* Might be reset by POPEVAL. */ @@ -4516,7 +4515,7 @@ /* I was having segfault trouble under Linux 2.2.5 after a parse error occured. (Had to hack around it with a test - for PL_error_count == 0.) Solaris doesn't segfault -- + for PL_parser->error_count == 0.) Solaris doesn't segfault -- not sure where the trouble is yet. XXX */ if (IoFMT_GV(datasv)) { ==== //depot/perl/sv.c#1405 (text) ==== @@ -9586,6 +9586,7 @@ parser->rsfp_filters= av_dup_inc(proto->rsfp_filters, param); parser->in_my = proto->in_my; parser->in_my_stash = hv_dup(proto->in_my_stash, param); + parser->error_count = proto->error_count; parser->linestr = sv_dup_inc(proto->linestr, param); @@ -11267,7 +11268,6 @@ PL_parser = parser_dup(proto_perl->Iparser, param); - PL_error_count = proto_perl->Ierror_count; PL_subline = proto_perl->Isubline; PL_subname = sv_dup_inc(proto_perl->Isubname, param); ==== //depot/perl/toke.c#784 (text) ==== @@ -67,6 +67,7 @@ #define PL_in_my_stash (PL_parser->in_my_stash) #define PL_tokenbuf (PL_parser->tokenbuf) #define PL_multi_end (PL_parser->multi_end) +#define PL_error_count (PL_parser->error_count) #ifdef PERL_MAD # define PL_endwhite (PL_parser->endwhite)
Subject: Re: [perl #49472] Attributes + Unkown Error
Date: Sat, 9 Feb 2008 14:54:10 +0000
To: "Andreas J. Koenig" <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>, perl5-porters [...] perl.org, frank.wiegand [...] gmail.com
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 446b
On Sat, Feb 09, 2008 at 11:26:13AM +0000, Nicholas Clark wrote: Show quoted text
> On Sat, Feb 09, 2008 at 06:35:11AM +0100, Andreas J. Koenig wrote: >
> > Binary search reveals the reduced errormessage started with 31255.
> > Feeling somewhat more "in your face" than Andreas, I've appended it all, > as it doesn't look that complex. I wonder where the bug is hiding...
Fixed by change 33265. -- Fire extinguisher (n) a device for holding open fire doors.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org