[oe-commits] [openembedded-core] 02/05: perl: fix race issues for MakeMaker

git at git.openembedded.org git at git.openembedded.org
Tue Sep 25 10:17:52 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit eb8dd177d53d521a48c8e0f2fd70763b977e3d02
Author: Robert Yang <liezhi.yang at windriver.com>
AuthorDate: Tue Sep 25 16:23:57 2018 +0800

    perl: fix race issues for MakeMaker
    
    Fixed a race issue when compile libhtml-parser-perl and others who use MakeMaker:
    [snip]
    chmod 755 blib/arch/auto/HTML/Parser/Parser.so
    chmod 644 "Parser.bs"
    [snip]
    
    The rule INST_DYNAMIC removes '.bs' file which are generated by BOOTSTRAP, but
    the have no dependencies, so there is a race issue:
    
    BOOTSTRAP:
        touch foo.bs
        chmod 755 foo.bs
    
    INST_DYNAMIC:
        rm -fr foo.bs
    
    The error would happen when INST_DYNAMIC removes foo.bs after BOOTSTRAP touched
    it but before chmod on it.
    
    Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/recipes-devtools/perl/perl-native_5.24.4.bb   |  1 +
 .../0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch | 52 ++++++++++++++++++++++
 meta/recipes-devtools/perl/perl_5.24.4.bb          |  1 +
 3 files changed, 54 insertions(+)

diff --git a/meta/recipes-devtools/perl/perl-native_5.24.4.bb b/meta/recipes-devtools/perl/perl-native_5.24.4.bb
index affc9d5..81d3fd4 100644
--- a/meta/recipes-devtools/perl/perl-native_5.24.4.bb
+++ b/meta/recipes-devtools/perl/perl-native_5.24.4.bb
@@ -16,6 +16,7 @@ SRC_URI += "\
            file://perl-PathTools-don-t-filter-out-blib-from-INC.patch \
            file://0001-Configure-Remove-fstack-protector-strong-for-native-.patch \
            file://perl-5.26.1-guard_old_libcrypt_fix.patch \
+           file://0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch \
           "
 
 SRC_URI[md5sum] = "04622bc4d3941dc7eb571c52b7c02993"
diff --git a/meta/recipes-devtools/perl/perl/0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch b/meta/recipes-devtools/perl/perl/0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch
new file mode 100644
index 0000000..a43fbba
--- /dev/null
+++ b/meta/recipes-devtools/perl/perl/0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch
@@ -0,0 +1,52 @@
+From 40702abf3156fa92ef70ee5d445fe52dd6cfbc7d Mon Sep 17 00:00:00 2001
+From: Robert Yang <liezhi.yang at windriver.com>
+Date: Thu, 20 Sep 2018 18:48:48 +0800
+Subject: [PATCH] ExtUtils/MM_Unix.pm: fix race issues
+
+Fixed a race issue when compile libhtml-parser-perl and others who use MakeMaker:
+[snip]
+chmod 755 blib/arch/auto/HTML/Parser/Parser.so 
+chmod 644 "Parser.bs"
+[snip]
+
+The rule INST_DYNAMIC removes '.bs' file which are generated by BOOTSTRAP, but
+the have no dependencies, so there is a race issue:
+
+BOOTSTRAP:
+    touch foo.bs
+    chmod 755 foo.bs
+
+INST_DYNAMIC:
+    rm -fr foo.bs
+
+The error would happen when INST_DYNAMIC removes foo.bs after BOOTSTRAP touched
+it but before chmod on it.
+
+Upstream-Status: Backport [https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/commit/44e95e717372abe2b0a6ee55de4b686760b65360]
+
+Note, This is not a real backport, upstream has totally refactored it in one
+patch, please see the link above, it's not a good idea to backport such a big
+patch, I just referred it to fix the problem in a simple way. I mark it as
+backport is because we can drop the patch after upgrade perl to 5.26 or 5.28.
+
+Signed-off-by: Robert Yang <liezhi.yang at windriver.com>
+---
+ cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+index 95d9761..9cabe2d 100644
+--- a/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
++++ b/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MM_Unix.pm
+@@ -933,7 +933,7 @@ OTHERLDFLAGS = '.$ld_opt.$otherldflags.'
+ INST_DYNAMIC_DEP = '.$inst_dynamic_dep.'
+ INST_DYNAMIC_FIX = '.$ld_fix.'
+ 
+-$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
++$(INST_DYNAMIC): $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP) $(BOOTSTRAP)
+ ');
+     if ($armaybe ne ':'){
+ 	$ldfrom = 'tmp$(LIB_EXT)';
+-- 
+2.7.4
+
diff --git a/meta/recipes-devtools/perl/perl_5.24.4.bb b/meta/recipes-devtools/perl/perl_5.24.4.bb
index 28f1c24..cc5aae9 100644
--- a/meta/recipes-devtools/perl/perl_5.24.4.bb
+++ b/meta/recipes-devtools/perl/perl_5.24.4.bb
@@ -65,6 +65,7 @@ SRC_URI += " \
         file://perl-test-customized.patch \
         file://perl-5.26.1-guard_old_libcrypt_fix.patch \
         file://CVE-2018-12015.patch \
+        file://0001-ExtUtils-MM_Unix.pm-fix-race-issues.patch \
 "
 
 # Fix test case issues

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list