Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[perl.git] branch blead, updated. v5.11.2-81-g162177c

0 views
Skip to first unread message

H. Merijn Brand

unread,
Nov 26, 2009, 11:54:11 AM11/26/09
to perl5-...@perl.org
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/162177c1aed1991639f7f0da64e918c034e1148a?hp=9735c8aa020a58992ffadba440014d200222da56>

- Log -----------------------------------------------------------------
commit 162177c1aed1991639f7f0da64e918c034e1148a
Author: Zefram <zef...@fysh.org>
Date: Thu Nov 26 16:41:22 2009 +0000

-Dmad minitest failure bisect

I wrote:
>In my tests with -Dmad, I'm still getting a test failure ("panic: input
>overflow") from t/op/incfilter.t. The underlying problem is the filter
>layer mishandling things when a filter function gives it a multiline
>string, so it generates an invalid SV state (strlen(SvPVX(PL_linestr))
>> SvCUR(PL_linestr)). This faulty state also occurs without -Dmad,
>and so doesn't appear to be Mad-related, it just doesn't in practice
>cause the test panic without -Dmad. I'm investigating this bug now.

It's fixed by the attached patch. Since the bug is an inconsistency
in the SV data structure, it can't be sensibly tested from Perl code,
so I'm at a loss for writing a test script. Hopefully that panic with
-Dmad is sufficient.

-zefram

Signed-off-by: H.Merijn Brand <h.m....@xs4all.nl>
-----------------------------------------------------------------------

Summary of changes:
pp_ctl.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/pp_ctl.c b/pp_ctl.c
index cd099c8..e69107e 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -4849,8 +4849,8 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
int status = 0;
SV *upstream;
STRLEN got_len;
- const char *got_p = NULL;
- const char *prune_from = NULL;
+ char *got_p = NULL;
+ char *prune_from = NULL;
bool read_from_cache = FALSE;
STRLEN umaxlen;

@@ -4953,8 +4953,7 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
prune_from = got_p + umaxlen;
}
} else {
- const char *const first_nl =
- (const char *)memchr(got_p, '\n', got_len);
+ char *const first_nl = (char *)memchr(got_p, '\n', got_len);
if (first_nl && first_nl + 1 < got_p + got_len) {
/* There's a second line here... */
prune_from = first_nl + 1;
@@ -4980,6 +4979,7 @@ S_run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen)
SvUTF8_on(cache);
}
SvCUR_set(upstream, got_len - cached_len);
+ *prune_from = 0;
/* Can't yet be EOF */
if (status == 0)
status = 1;

--
Perl5 Master Repository

0 new messages