-
Notifications
You must be signed in to change notification settings - Fork 537
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
Assertion failure in Perl_leave_adjust_stacks (pp_hot.c:4653) #16929
Comments
From @dur-randirCreated by @dur-randirWhile fuzzing perl v5.29.9-63-g2496d8f3f7 built with afl and run E{0;readline@0} to cause an assertion failure perl: pp_hot.c:4653: void Perl_leave_adjust_stacks(SV **, SV **, U8, GDB stack trace is following #0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 This is a regression between 5.22 and 5.24, bisect points to commit 75bc488 replace leave_common() with leave_adjust_stacks() Make the remaining callers of S_leave_common() use leave_adjust_stacks() This brings the benefits of freeing TEMPS on all scope exists that Perl Info
|
From @tonycozOn Fri, 05 Apr 2019 09:26:20 -0700, randir wrote:
Patch attached. Tony |
From @tonycoz0001-perl-133989-scalar-the-argument-to-readline-if-any.patchFrom faa0ed849cf1bfe77c4cb9857dc3e8a0db0bfa7a Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Wed, 12 Jun 2019 15:21:47 +1000
Subject: (perl #133989) scalar() the argument to readline, if any
C< readline @foo > would treat @foo as array. If the array was empty
this would push zero items and readline() would then pop one item,
possibly underflowing the stack.
---
op.c | 1 +
t/lib/croak/pp_sys | 6 ++++++
2 files changed, 7 insertions(+)
diff --git a/op.c b/op.c
index 6ad192307f..7aa002cadd 100644
--- a/op.c
+++ b/op.c
@@ -12142,6 +12142,7 @@ Perl_ck_readline(pTHX_ OP *o)
if (o->op_flags & OPf_KIDS) {
OP *kid = cLISTOPo->op_first;
if (kid->op_type == OP_RV2GV) kid->op_private |= OPpALLOW_FAKE;
+ scalar(kid);
}
else {
OP * const newop
diff --git a/t/lib/croak/pp_sys b/t/lib/croak/pp_sys
index be100da27a..cf9e4ef0ed 100644
--- a/t/lib/croak/pp_sys
+++ b/t/lib/croak/pp_sys
@@ -93,3 +93,9 @@ close $fh;
END { unlink $file; }
EXPECT
syswrite() isn't allowed on :utf8 handles at - line 5.
+########
+# NAME readline() didn't scalar() its argument
+# this would assert rather than failing on the method call
+E{0;readline@0}
+EXPECT
+Can't call method "E" without a package or object reference at - line 2.
--
2.11.0
|
The RT System itself - Status changed from 'new' to 'open' |
From @tonycozOn Tue, 11 Jun 2019 22:22:45 -0700, tonyc wrote:
Applied as a8e0c1f. Tony |
@tonycoz - Status changed from 'open' to 'pending release' |
Migrated from rt.perl.org#133989 (status was 'pending release')
Searchable as RT133989$
The text was updated successfully, but these errors were encountered: