New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bleadperl v5.19.3-296-gffdb8b1 breaks BAREFOOT/Test-File-1.34.tar.gz #13224
Comments
From @andkgit bisect commit ffdb8b1 Fix two line numbers bugs involving quote-like ops diagnostics Also affected: FERRENCY/Text-MicroMason-2.13.tar.gz Sample fails not yet arrived at cpantesters. This is from Text::MicroMason: # Failed test 'first line of $@ describes the error location' perl -V Summary of my perl5 (revision 5 version 19 subversion 4) configuration: Characteristics of this binary (from libperl): -- |
From @cpansproutOn Tue Sep 03 19:58:33 2013, andreas.koenig.7os6VVqR@franz.ak.mind.de wrote:
The Test::File failure can be reduced to: foo( The line number returned by caller() (and used by warn) is a single "@{[]}" used to reset the line number for the surrounding statement to The reason this happens is that PL_copline is now localised and Test::File’s test suite is sensitive to that, as it uses As long as we are limited to one line number per statement, which line If necessary, though, I could allow changes to PL_copline inside the (For those who have no idea what I am talking about, PL_copline is set
So now perl reports 9 instead of 8.
And the syntax error is on line 9. So that looks like a bug fix, too. -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @cpansproutOn Sat Sep 07 01:20:26 2013, sprout wrote:
Maybe the best solution here is to allow entersub ops to store a line Maybe all ops should store a line number.... (I’m not the first to -- Father Chrysostomos |
From @cpansproutOn Sat Sep 07 18:47:34 2013, sprout wrote:
Could someone else familiar with ops review my suggestions? Should I -- Father Chrysostomos |
From @bulk88On Sat Dec 21 18:07:08 2013, sprout wrote:
I suggest won't fix. IMO line numbers are on a statement, not expression/substatement basis. None of the suggestions sound like the increase in memory or CPU will justify a bug about undocumented and subject to change behavior. -- |
From zefram@fysh.orgFather Chrysostomos via RT wrote:
None of the above. The current behaviour is not a bug; there is not -zefram |
From @bulk88On Sat Dec 21 20:25:13 2013, bulk88 wrote:
I did think of something, what if a single bit in the op struct indicated if this op is on a new line, or previous line. The line number of the current op * is determined by walking from the COP along the the linked list to the current op * and counting the number of newline bits. The algorithm for computing the line number is very overhead intensive/slow, but takes very very little memory, just 1 bit per op struct. -- |
From zefram@fysh.orgbulk88 via RT wrote:
Unworkable. With conditionals, multiple paths can be taken through the -zefram |
From perl5-porters@perl.orgZefram wrote:
When does *that* occur? |
From zefram@fysh.orgFather Chrysostomos wrote:
#line can trivially make a statement notionally split between files. -zefram |
From @jkeenanBuddy Burden has released dev version 1.35_01 of Test-File, which appears to address the problem. Once he promotes that to a full version, we'll be able to close this ticket. Thank you very much. |
From @rurbanOn Mon, Dec 23, 2013 at 6:59 AM, Zefram <zefram@fysh.org> wrote:
So you have no idea about my oplines branch from 2008, which moves the It it not ready, as I did just to test the optimization idea. -- |
From @rjbsOn Wed Dec 25 18:25:51 2013, jkeenan wrote:
Jim: Test-File 1.36 is out: https://metacpan.org/release/Test-File Are we done? -- |
From @jkeenanOn Mon Jan 20 19:47:17 2014, rjbs wrote:
I will take the ticket for the purpose of investigating and confirming. |
From @jkeenanOn Tue Jan 21 04:55:37 2014, jkeenan wrote:
Test-File v1.36 does pass all its tests at: However, reviewing the ticket, I see that it was originally filed against CPAN distro Text-MicroMason. Some of this distro's tests are still failing: ##### At the moment, I'm not able to diagnose this further. Suggestions? Thank you very much. |
From @tonycozOn Tue Jan 21 10:22:35 2014, jkeenan wrote:
Bisected down to: commit ffdb8b1 Fix two line numbers bugs involving quote-like ops I was going to try and fix #line directives in quote-like operators, Before this commit, the #line directive would last until the end of qq{${ with: perl ../bisect.pl --start v5.12.0 -e '$code = `cat /home/tonyc/foo.compiled.pl`; eval where foo.compiled.pl contains the code generated from the template. This appears to be the result of a bug fix, if I expand the Hello world string in the by a few more lines the error message on 5.14.2 stays on line 8, but increases correctly in blead. I've reported this to the Text-MicroMason queue as https://rt.cpan.org/Ticket/Display.html?id=92771 Tony |
From @jkeenanOn Wed Feb 05 16:34:26 2014, tonyc wrote:
Tony, if I understand you correctly, Text-MicroMason was inadvertently relying on buggy behavior in Perl 5 -- behavior which we have now corrected. If so, given that you have notified Text-MicroMason of this problem, we can close this ticket and remove a blocker for 5.20. I will close this ticket within 7 days unless someone convinces me otherwise. Thank you very much. |
From @tonycozOn Wed Feb 05 19:31:15 2014, jkeenan wrote:
Exactly that.
I've closed it. Tony |
@tonycoz - Status changed from 'open' to 'resolved' |
From @andk"Father Chrysostomos via RT" <perlbug-followup@perl.org> writes:
Also affected: IKEGAMI/Syntax-Feature-QwComments-v1.12.0.tar.gz -- |
From @ikegamiOn Sun Dec 22 04:08:19 2013, zefram@fysh.org wrote:
What do you mean by "current behaviour"? Currently, blead is issuing error messages with no line numbers, and I'd consider that a bug. |
From @ikegamiOn Fri May 02 06:28:45 2014, ikegami@adaelis.com wrote:
Or maybe that wasn't mentioned? The commit also removes " at -e line 1" from the following: $ ./perl -e'qw' |
@ikegami - Status changed from 'resolved' to 'open' |
From @tonycozOn Fri May 02 06:41:33 2014, ikegami@adaelis.com wrote:
Please try the attached patch. Tony |
From @tonycoz0001-perl-119593-ensure-qw-q-and-report-line-on-a-missing.patchFrom f1e03a55e00886d916008377fb3adc2913e35288 Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 6 May 2014 16:27:14 +1000
Subject: [perl #119593] ensure qw//, q'' and '' report line on a missing
terminator
---
t/lib/croak/toke | 15 +++++++++++++++
toke.c | 8 ++++----
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/t/lib/croak/toke b/t/lib/croak/toke
index d6026d2..0572094 100644
--- a/t/lib/croak/toke
+++ b/t/lib/croak/toke
@@ -134,3 +134,18 @@ Execution of - aborted due to compilation errors.
<<"foo
EXPECT
Unterminated delimiter for here document at - line 1.
+########
+# NAME Unterminated qw//
+qw/
+EXPECT
+Can't find string terminator "/" anywhere before EOF at - line 1.
+########
+# NAME Unterminated q//
+qw/
+EXPECT
+Can't find string terminator "/" anywhere before EOF at - line 1.
+########
+# NAME Unterminated ''
+'
+EXPECT
+Can't find string terminator "'" anywhere before EOF at - line 1.
diff --git a/toke.c b/toke.c
index 3d992f6..ea88183 100644
--- a/toke.c
+++ b/toke.c
@@ -6848,6 +6848,8 @@ Perl_yylex(pTHX)
case '\'':
s = scan_str(s,!!PL_madskills,FALSE,FALSE,FALSE,NULL);
+ if (!s)
+ missingterm(NULL);
COPLINE_SET_FROM_MULTI_END;
DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
if (PL_expect == XOPERATOR) {
@@ -6857,8 +6859,6 @@ Perl_yylex(pTHX)
else
no_op("String",s);
}
- if (!s)
- missingterm(NULL);
pl_yylval.ival = OP_CONST;
TERM(sublex_start());
@@ -8385,9 +8385,9 @@ Perl_yylex(pTHX)
case KEY_q:
s = scan_str(s,!!PL_madskills,FALSE,FALSE,FALSE,NULL);
- COPLINE_SET_FROM_MULTI_END;
if (!s)
missingterm(NULL);
+ COPLINE_SET_FROM_MULTI_END;
pl_yylval.ival = OP_CONST;
TERM(sublex_start());
@@ -8397,9 +8397,9 @@ Perl_yylex(pTHX)
case KEY_qw: {
OP *words = NULL;
s = scan_str(s,!!PL_madskills,FALSE,FALSE,FALSE,NULL);
- COPLINE_SET_FROM_MULTI_END;
if (!s)
missingterm(NULL);
+ COPLINE_SET_FROM_MULTI_END;
PL_expect = XOPERATOR;
if (SvCUR(PL_lex_stuff)) {
int warned_comma = !ckWARN(WARN_QW);
--
1.7.10.4
|
From @tonycozOn Mon May 05 23:28:08 2014, tonyc wrote:
New patch with explanation added. Tony |
From @tonycoz0001-perl-119593-ensure-qw-q-and-report-line-on-a-missing.patchFrom bf65bd5366e6c89587d7f8f75c8ec3cdc37ac7ab Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 7 May 2014 09:33:03 +1000
Subject: [perl #119593] ensure qw//, q'' and '' report line on a missing
terminator
scan_str() only sets PL_multi_end on success, but the qw, q amd '' cases
were calling the COPLINE_SET_FROM_MULTI_END; macro before reporting
failure, overwriting the line used for reporting errors.
For the simplest case, as in the ticket and the tests, PL_multi_end is
zero, so the error is reported without a line number.
---
t/lib/croak/toke | 15 +++++++++++++++
toke.c | 8 ++++----
2 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/t/lib/croak/toke b/t/lib/croak/toke
index d6026d2..0572094 100644
--- a/t/lib/croak/toke
+++ b/t/lib/croak/toke
@@ -134,3 +134,18 @@ Execution of - aborted due to compilation errors.
<<"foo
EXPECT
Unterminated delimiter for here document at - line 1.
+########
+# NAME Unterminated qw//
+qw/
+EXPECT
+Can't find string terminator "/" anywhere before EOF at - line 1.
+########
+# NAME Unterminated q//
+qw/
+EXPECT
+Can't find string terminator "/" anywhere before EOF at - line 1.
+########
+# NAME Unterminated ''
+'
+EXPECT
+Can't find string terminator "'" anywhere before EOF at - line 1.
diff --git a/toke.c b/toke.c
index 3d992f6..ea88183 100644
--- a/toke.c
+++ b/toke.c
@@ -6848,6 +6848,8 @@ Perl_yylex(pTHX)
case '\'':
s = scan_str(s,!!PL_madskills,FALSE,FALSE,FALSE,NULL);
+ if (!s)
+ missingterm(NULL);
COPLINE_SET_FROM_MULTI_END;
DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
if (PL_expect == XOPERATOR) {
@@ -6857,8 +6859,6 @@ Perl_yylex(pTHX)
else
no_op("String",s);
}
- if (!s)
- missingterm(NULL);
pl_yylval.ival = OP_CONST;
TERM(sublex_start());
@@ -8385,9 +8385,9 @@ Perl_yylex(pTHX)
case KEY_q:
s = scan_str(s,!!PL_madskills,FALSE,FALSE,FALSE,NULL);
- COPLINE_SET_FROM_MULTI_END;
if (!s)
missingterm(NULL);
+ COPLINE_SET_FROM_MULTI_END;
pl_yylval.ival = OP_CONST;
TERM(sublex_start());
@@ -8397,9 +8397,9 @@ Perl_yylex(pTHX)
case KEY_qw: {
OP *words = NULL;
s = scan_str(s,!!PL_madskills,FALSE,FALSE,FALSE,NULL);
- COPLINE_SET_FROM_MULTI_END;
if (!s)
missingterm(NULL);
+ COPLINE_SET_FROM_MULTI_END;
PL_expect = XOPERATOR;
if (SvCUR(PL_lex_stuff)) {
int warned_comma = !ckWARN(WARN_QW);
--
1.7.10.4
|
From @khwilliamsonI spent an hour or so familiarizing myself with the code and the patch, and it looks good to me. So with rjbs' approval, I've pushed it as commit 9612f77 |
@khwilliamson - Status changed from 'open' to 'resolved' |
From @ikegamiI had problems with my linux box that kept me from testing it until today. On Mon, May 12, 2014 at 3:07 PM, Karl Williamson via RT <
|
Migrated from rt.perl.org#119593 (status was 'resolved')
Searchable as RT119593$
The text was updated successfully, but these errors were encountered: