Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Perl: porters

[perl #70910] wrong line number in syntax error message

 

 

Perl porters RSS feed   Index | Next | Previous | View Threaded


perlbug-followup at perl

Nov 28, 2009, 1:22 PM

Post #1 of 4 (258 views)
Permalink
[perl #70910] wrong line number in syntax error message

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


This is a bug report for perl from frank.wiegand [at] gmail,
generated with the help of perlbug 1.39 running under perl 5.11.2.


-----------------------------------------------------------------

$ bleadperl -e '+'
syntax error at -e line 2, at EOF
Execution of -e aborted due to compilation errors.

This broke between 5.11.0 and 5.11.2, git bisect reports:

f0e67a1d29102aa9905aecf2b0f98449697d5af3 is the first bad commit
commit f0e67a1d29102aa9905aecf2b0f98449697d5af3
Author: Zefram <zefram [at] fysh>
Date: Sun Nov 15 14:25:50 2009 +0100

lexer API

Attached is a patch that adds a public API for the lowest layers of
lexing. This is meant to provide a solid foundation for the parsing that
Devel::Declare and similar modules do, and it complements the pluggable
keyword mechanism. The API consists of some existing variables combined
with some new functions, all marked as experimental (which making them
public certainly is).

:100644 100644 22db6a3c9011829aff5176a7bacd4373f9c1d354 b8073eb771a2c615c876970bc1883bd4316cc88c M MANIFEST
:100644 100644 7522055a288adf11291c654a30726bd618c11f25 f17f7ada0a8c023af12e8aa9b7800f9ccf643df5 M embed.fnc
:100644 100644 52e40c6fa2f68c4c009a83d7669522543a9baad1 17bf11a5139254f0a5f6a46473bb136d1c145259 M embed.h
:040000 040000 23226494a6184590278d718527f383b69fff2cf3 6ebec696e22c1a6f7b1b4043db5a090006e9f1b1 M ext
:100644 100644 6000af755912fcd939cbe94d4662c54dd42acd5b 6a44049c4e4262b09ae4c5a0d2fd2d9749f12189 M global.sym
:100644 100644 74d8ef2197b15a99ce10a233a2f829c286043022 462dcfdef806826927c7e9c5261e46e57033960c M parser.h
:100644 100644 3639bd6ac0f26afd8537e3e9722382c2ba5beea2 3d378917c94e26aa9a550c181fdd824d6aad2e60 M perlvars.h
:040000 040000 79cfd550ba3c1ee290da3a30115bcade3d31effb 4de6df320a87c92b6db4c4df6a5b3cbace2d96bb M pod
:100644 100644 f1ab3d022e76840708a2367ea74a652b299bd6f1 fd2eb36cd42cecae815240f00f301038d0aba9fc M proto.h
:100644 100644 b8abbd854f001057679312ed03b534e0853cf490 6793f7b8669efb9df31731d9eff7507d6672c9b6 M toke.c


Frank

-----------------------------------------------------------------
---
Flags:
category=core
severity=low
---
Site configuration information for perl 5.11.2:

Configured by fw at Sat Nov 28 22:03:13 CET 2009.

Summary of my perl5 (revision 5 version 11 subversion 2) configuration:
Commit id: 17c59fdf7540adaf656e96fe6d48b58dab391dc0
Platform:
osname=linux, osvers=2.6.30-2-amd64, archname=x86_64-linux
uname='linux hal2 2.6.30-2-amd64 #1 smp fri sep 25 22:16:56 utc 2009 x86_64 gnulinux '
config_args='-des -Dusedevel -Doptimize=-g -Dcc=ccache gcc -Dld=gcc'
hint=recommended, useposix=true, d_sigaction=define
useithreads=undef, usemultiplicity=undef
useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
use64bitint=define, use64bitall=define, uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='ccache gcc', ccflags ='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
optimize='-g',
cppflags='-DDEBUGGING -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include'
ccversion='', gccversion='4.3.4', gccosandvers=''
intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=8, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -fstack-protector -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib /lib64 /usr/lib64
libs=-lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc -lgdbm_compat
perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.10.1.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.10.1'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
cccdlflags='-fPIC', lddlflags='-shared -g -L/usr/local/lib -fstack-protector'

Locally applied patches:


---
@INC for perl 5.11.2:
lib
/usr/local/lib/perl5/site_perl/5.11.2/x86_64-linux
/usr/local/lib/perl5/site_perl/5.11.2
/usr/local/lib/perl5/5.11.2/x86_64-linux
/usr/local/lib/perl5/5.11.2
.

---
Environment for perl 5.11.2:
HOME=/home/cpan
LANG=C
LANGUAGE=
LC_ALL=C
LD_LIBRARY_PATH (unset)
LOGDIR (unset)
PATH=~/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PERL_AUTOINSTALL=--defaultdeps
PERL_BADLANG (unset)
PERL_EXTUTILS_AUTOINSTALL=--defaultdeps
PERL_MM_USE_DEFAULT=1
SHELL=/bin/bash


zefram at fysh

Nov 30, 2009, 5:39 AM

Post #2 of 4 (239 views)
Permalink
Re: [perl #70910] wrong line number in syntax error message [In reply to]

Frank Wiegand wrote:
> $ bleadperl -e '+'
> syntax error at -e line 2, at EOF

Bah, that's another area where I tested a bunch of variations while
developing the patch, but apparently missed some. I'll look into it.

-zefram


zefram at fysh

Dec 9, 2009, 2:08 PM

Post #3 of 4 (202 views)
Permalink
Re: [perl #70910] wrong line number in syntax error message [In reply to]

Frank Wiegand wrote:
> $ bleadperl -e '+'
> syntax error at -e line 2, at EOF

Fixed by the attached patch.

-zefram
Attachments: d0 (1.39 KB)


jesse at fsck

Dec 9, 2009, 2:41 PM

Post #4 of 4 (200 views)
Permalink
Re: [perl #70910] wrong line number in syntax error message [In reply to]

Thanks. Applied as 85613cabfd8d8a9b6b36082819bd6c38e1bb21c7


On Wed, Dec 09, 2009 at 10:08:33PM +0000, Zefram wrote:
> Frank Wiegand wrote:
> > $ bleadperl -e '+'
> > syntax error at -e line 2, at EOF
>
> Fixed by the attached patch.
>
> -zefram

> diff --git a/MANIFEST b/MANIFEST
> index a85d318..43e9a49 100644
> --- a/MANIFEST
> +++ b/MANIFEST
> @@ -4187,6 +4187,7 @@ t/comp/bproto.t See if builtins conform to their prototypes
> t/comp/cmdopt.t See if command optimization works
> t/comp/colon.t See if colons are parsed correctly
> t/comp/decl.t See if declarations work
> +t/comp/final_line_num.t See if line numbers are correct at EOF
> t/comp/fold.t See if constant folding works
> t/comp/hints.aux Auxillary file for %^H test
> t/comp/hints.t See if %^H works
> diff --git a/t/comp/final_line_num.t b/t/comp/final_line_num.t
> new file mode 100644
> index 0000000..bb06847
> --- /dev/null
> +++ b/t/comp/final_line_num.t
> @@ -0,0 +1,13 @@
> +#!./perl
> +
> +BEGIN { print "1..1\n"; }
> +
> +BEGIN { $SIG{__DIE__} = sub {
> + $_[0] =~ /\Asyntax error at [^ ]+ line ([0-9]+), at EOF/ or exit 1;
> + my $error_line_num = $1;
> + print $error_line_num == $last_line_num ? "ok 1\n" : "not ok 1\n";
> + exit 0;
> +}; }
> +
> +# the next line causes a syntax error at end of file, to be caught above
> +BEGIN { $last_line_num = __LINE__; } print 1+
> diff --git a/toke.c b/toke.c
> index d498a34..2ec5f2d 100644
> --- a/toke.c
> +++ b/toke.c
> @@ -4363,7 +4363,8 @@ Perl_yylex(pTHX)
> PL_doextract = FALSE;
> }
> }
> - incline(s);
> + if (PL_rsfp)
> + incline(s);
> } while (PL_doextract);
> PL_oldoldbufptr = PL_oldbufptr = PL_bufptr = PL_linestart = s;
> PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);


--

Perl porters RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.