-
Notifications
You must be signed in to change notification settings - Fork 560
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
[PATCH] attributes: fix memEQs shared #14072
Comments
From @rurbanThis is a bug report for perl from rurban@cpanel.net, attributes: fix memEQs shared This bug blocks sv_grow and future string comparison improvements. Flags: Site configuration information for perl 5.21.4: Configured by rurban at Mon Sep 1 04:59:49 CDT 2014. Summary of my perl5 (revision 5 version 21 subversion 4) configuration: Locally applied patches: @INC for perl 5.21.4: Environment for perl 5.21.4: |
From @rurban0001-attributes-fix-memEQs-shared.patchFrom 776476c29f4b1a645837d5e6193c1c42710d0c2d Mon Sep 17 00:00:00 2001
From: Reini Urban <rurban@x-ray.at>
Date: Thu, 4 Sep 2014 09:49:15 -0500
Subject: [PATCH] attributes: fix memEQs shared
Do not access memory buffers shorter than 6, and also check for
longer buffers starting with "shared". This bug caused an ASAN error with
my sv_grow performance improvement on short strings (commit 880c169,
reverted with 3c239be),
and went undetected because the shortest strings are 10 byte long.
---
ext/attributes/attributes.xs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git ext/attributes/attributes.xs ext/attributes/attributes.xs
index dbb644d..2238050 100644
--- ext/attributes/attributes.xs
+++ ext/attributes/attributes.xs
@@ -97,11 +97,11 @@ modify_SV_attributes(pTHX_ SV *sv, SV **retlist, SV **attrlist, int numattrs)
}
break;
default:
- if (memEQs(name, 6, "shared")) {
- if (negated)
- Perl_croak(aTHX_ "A variable may not be unshared");
- SvSHARE(sv);
- continue;
+ if (len == 6 && memEQs(name, 6, "shared")) {
+ if (negated)
+ Perl_croak(aTHX_ "A variable may not be unshared");
+ SvSHARE(sv);
+ continue;
}
break;
}
--
2.1.0
|
From @doughera88On Thu, Sep 04, 2014 at 07:57:21AM -0700, rurban @ cpanel . net wrote:
Thanks for the quick and accurate diagnosis and fix. I've applied Thanks, -- |
The RT System itself - Status changed from 'new' to 'open' |
From @rurbanOn 09/04/2014 11:47 AM, Andy Dougherty via RT wrote:
I see. Thanks! In a subsequent patch I want to change min. SvLEN to wordsize (4|8) with Should be much faster I hope. It was much faster in my tests because we |
From @bulk88On Thu Sep 04 09:47:40 2014, doughera wrote:
gdd36996 isnt a known commit -- |
From @TuxOn Mon, 8 Sep 2014 06:33:34 -0700, "bulk88 via RT"
Drop the leading g $ git show dd36996 Correct usage of memEQs in attributes.xs [perl #122701] Reported and diagnosed by Reini Urban <rurban@cpanel.net>. The call to -- |
From @rurbanOn 09/08/2014 08:33 AM, bulk88 via RT wrote:
It is known. The first char specifies the version control software (g for git, s for $ git describe |
@cpansprout - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#122701 (status was 'resolved')
Searchable as RT122701$
The text was updated successfully, but these errors were encountered: