-
Notifications
You must be signed in to change notification settings - Fork 559
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
null ptr deref, segfault Perl_mess_sv (util.c:1534) #15637
Comments
From @geeknikTriggered in Perl v5.25.6 (v5.25.5-42-g850e14d). ./perl -e '0,$^=0==0,0==0,$0=S$^$^D=S'
|
From @geeknikv5.25.6 (v5.25.5-76-g91dca83) valgrind -q perl -e 'k$ ### 1:LEX_NORMAL/XTERM "q" ### 1:LEX_NORMAL/XOPERATOR "\n;" allocating op at 5f85258, slab 5f850d0 at (eval 1) line 1. allocating op at 5f85170, slab 5f850d0 at (eval 1) line 1. |
From @hvdsOn Wed, 12 Oct 2016 15:46:18 -0700, brian.carpenter@gmail.com wrote:
The trigger here is enabling -DS; we end up attempting to report the freeing of an op when PL_curcop == NULL. I believe that's a legitimate situation, so I propose the patch below to cater for PL_curcop==NULL in mess_sv(). With that in place, we see: allocating op at 177e9d8, slab 177e810 at (eval 1) line 1. Hugo commit db4872386066192185409657dcd15f5c114dae9f [perl #129770] Allow for PL_curcop == NULL in mess_sv() Inline Patchdiff --git a/util.c b/util.c
index 02c84c8..0917747 100644
--- a/util.c
+++ b/util.c
@@ -1518,14 +1518,15 @@ Perl_mess_sv(pTHX_ SV *basemsg, bool consume)
* from the sibling of PL_curcop.
*/
- const COP *cop =
- closest_cop(PL_curcop, OpSIBLING(PL_curcop), PL_op, FALSE);
+ const COP *cop = PL_curcop
+ ? closest_cop(PL_curcop, OpSIBLING(PL_curcop), PL_op, FALSE)
+ : NULL;
if (!cop)
cop = PL_curcop;
-
- if (CopLINE(cop))
+ if (cop && CopLINE(cop))
Perl_sv_catpvf(aTHX_ sv, " at %s line %" IVdf,
- OutCopFILE(cop), (IV)CopLINE(cop));
+ OutCopFILE(cop), (IV)CopLINE(cop));
+
/* Seems that GvIO() can be untrustworthy during global destruction. */
if (GvIO(PL_last_in_gv) && (SvTYPE(GvIOp(PL_last_in_gv)) == SVt_PVIO)
&& IoLINES(GvIOp(PL_last_in_gv))) |
The RT System itself - Status changed from 'new' to 'open' |
From @hvdsI should clarify that I proposed rather than applied this patch only because mess_sv() seems quite a critical function, so I'd like a second opinion on the sanity of this change. Hugo On Tue, 06 Dec 2016 04:59:14 -0800, hv wrote:
|
From @hvdsOn Mon, 12 Dec 2016 08:42:03 -0800, hv wrote:
I guess Dave never saw this, since he has just committed a functionally identical change in f4c6177 for [perl #130621]. Marking as fixed pending release. Hugo |
@hvds - Status changed from 'open' to 'pending release' |
From @iabynOn Mon, Jan 23, 2017 at 11:19:26AM -0800, Hugo van der Sanden via RT wrote:
Oh yeah. Sorry! -- |
From @khwilliamsonThank you for filing this report. You have helped make Perl better. With the release today of Perl 5.26.0, this and 210 other issues have been Perl 5.26.0 may be downloaded via: If you find that the problem persists, feel free to reopen this ticket. |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#129770 (status was 'resolved')
Searchable as RT129770$
The text was updated successfully, but these errors were encountered: