Bug #77284 [Com]: base64 broken on FreeBSD

From: Date: Fri, 14 Dec 2018 23:33:26 +0000
Subject: Bug #77284 [Com]: base64 broken on FreeBSD
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-218460@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77284&edit=1

 ID:                 77284
 Comment by:         anubas at hotmail dot com
 Reported by:        anubas at hotmail dot com
 Summary:            base64 broken on FreeBSD
 Status:             Verified
 Type:               Bug
 Package:            *URL Functions
 Operating System:   FreeBSD 11.2-RELEASE-p5
 PHP Version:        7.3.0
 Assigned To:        laruence
 Block user comment: N
 Private report:     N

 New Comment:

Possible work-around: Upgrade to FreeBSD 12.0.

I used freebsd-update to upgrade the same server to FreeBSD 12.0 and re-installed the same PHP73
package. Everything works as expected.


Previous Comments:
------------------------------------------------------------------------
[2018-12-14 14:28:24] cmb@php.net

Might be relevant:

    $ cc -v
    FreeBSD clang version 6.0.0 (tags/RELEASE_600/final 326565) (based on LLVM 6.0.0)

------------------------------------------------------------------------
[2018-12-14 13:00:24] cmb@php.net

I can reproduce this issue on an AMD 64 supporting SSSE3, but not
AVX2, running a Vagrant bento/freebsd-11.2[1].
resolve_base64_encode() returns php_base64_encode_ssse3()[2], but
setting a breakpoint for this function is somehow ignored.

[1] <https://app.vagrantup.com/bento/boxes/freebsd-11.2>
[2] <https://github.com/php/php-src/blob/php-7.3.0/ext/standard/base64.c#L431>

------------------------------------------------------------------------
[2018-12-12 09:52:05] sjon at hortensius dot net

This can be reproduced pretty quickly in a qemu-vm - I downloaded http://ftp.nl.freebsd.org/releases/VM-IMAGES/11.2-RELEASE/amd64/Latest/FreeBSD-11.2-RELEASE-amd64.qcow2.xz,
uncompressed and logged in with root and ran:

# portsnap fetch extract && cd /usr/ports/lang/php73 && make install
 (select debug build, accept defaults for the rest

This will get you a debug php73 build which shows the same behavior

------------------------------------------------------------------------
[2018-12-11 22:12:28] nikic@php.net

Also bug #77279 looks very related. In both cases we have a SIMD optimized function with FreeBSD as
the operating system. Likely the same root cause.

------------------------------------------------------------------------
[2018-12-11 22:11:21] nikic@php.net

Thanks, that should put you on the SSSE3 implementation. I just tried to force it locally, and
it's working fine for me.

Not sure what could be the issue here, maybe laruence has an idea?

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=77284


--
Edit this bug report at https://bugs.php.net/bug.php?id=77284&edit=1


Thread (13 messages)

« previous php.bugs (#218460) next »