Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 677012

Summary: dev-lang/perl-5.28.0 on musl: invocations of memmem(3) return invalid data
Product: Gentoo Linux Reporter: eroen <erikdenstore+gbugs>
Component: Current packagesAssignee: Gentoo Perl team <perl>
Status: RESOLVED FIXED    
Severity: normal CC: kfm, musl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://rt.perl.org/Public/Bug/Display.html?id=133760
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 681720    
Bug Blocks:    

Description eroen 2019-01-31 22:20:12 UTC
Upstream bug:
https://rt.perl.org/Public/Bug/Display.html?id=133760

Example program showing the bug on perl versions 5.26 and 5.28 on musl systems:

    $x = "1_1";
    $y = "1_1";
    print index($x, $y);

This should print 0, on affected setups it typically prints a large negative number.

Among other things, this breaks the openssl build system:
https://github.com/openssl/openssl/issues/8032

Upstream has a series of 5 patches that seem to resolve this issue:
https://perl5.git.perl.org/perl.git/commit/ca152fd8207cf53816b1407d5f54f6ea160a3ef8
https://perl5.git.perl.org/perl.git/commit/63c1fa6a98bc60234a21de83dd191cd581a5d073
https://perl5.git.perl.org/perl.git/commit/f8d82a1010426d0eb49c33cb903413b882c85c3e
https://perl5.git.perl.org/perl.git/commit/ba73a4cb8f472480a2d630613d1e9e1172d518d3
https://perl5.git.perl.org/perl.git/commit/04db542212fdad3a62f13afe741c99028f4bf799

Unfortunately, it disables the memmem optimizations for gentoo musl users (the ldd test doesn't work). This is still superior to the current breakage.
Comment 1 Anthony Basile gentoo-dev 2019-02-01 13:03:34 UTC
I am aware of the issue, see [1].  I was waiting for the perl team to come up with a fix --- thanks for bringing it to my attention.

I'd urge the perl team to add those patches since they are from upstream and they fix a serious issue with gentoo/musl.


Ref. [1] https://github.com/gentoo/musl/pull/205
Comment 2 Andreas K. Hüttel archtester gentoo-dev 2019-04-07 14:32:33 UTC
This will be fixed in 5.28.2 (out soon and in preparation).
Comment 3 Larry the Git Cow gentoo-dev 2019-04-19 16:54:35 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f7a94dc3f57dc784e88c85516c7bfcc4e3bf5f9

commit 2f7a94dc3f57dc784e88c85516c7bfcc4e3bf5f9
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2019-04-19 15:57:12 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2019-04-19 16:52:03 +0000

    package.mask: Unmask Perl 5.28.2
    
    Bug: https://bugs.gentoo.org/610384
    Bug: https://bugs.gentoo.org/670190
    Bug: https://bugs.gentoo.org/677012
    Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>

 profiles/package.mask | 7 -------
 1 file changed, 7 deletions(-)
Comment 4 Andreas K. Hüttel archtester gentoo-dev 2019-05-11 17:35:14 UTC
Fixed in 5.28.2