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>
Severity: normal CC: into-the-trash-it-goes, musl
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also:
Package list:
Runtime testing required: ---
Bug Depends on: 681720    
Bug Blocks:    

Description eroen 2019-01-31 22:20:12 UTC
Upstream bug:

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:

Upstream has a series of 5 patches that seem to resolve this issue:

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]
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):

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

    package.mask: Unmask Perl 5.28.2
    Signed-off-by: Andreas K. Hüttel <>

 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