Hi,

yesterday I was digging into the bug #76510:
https://bugs.php.net/bug.php?id=76510
A strange PHAR- and streams-related issue that only happens for some
users/binaries.

I was able to trace it down to a GCC optimization "optimize-strlen".
Here's when the bug does and does not reproduce:
gcc-8 with -O0 works
gcc-8 with -O1 works
gcc-8 with -O2 does not work
gcc-8 with -O3 does not work
gcc-8 with -Og works
gcc-8 with -Os works

With some further testing, I was able to find a workaround: -O2
-fno-optimize-strlen

I bisected this issue to the commit
513b0093c2b480bb752fb354012f42c446769486:
Refactor php_url struct to save memory dup in common cases
https://github.com/php/php-src/commit/513b0093c2b480bb752fb354012f42c446769486
(bisect log is in the bug report)

To confirm:
git checkout 513b0093c2b480bb752fb354012f42c446769486 + gcc-8 + -O2: Fatal
error
git checkout 513b0093c2b480bb752fb354012f42c446769486^ + gcc-8 + -O2: works

Unfortunately this is where my journey ends - my C/GCC knowledge is not
sufficient enough to analyse this further.

I'd like to ask someone to take over from here so we can see this issue
fixed in the next 7.3 pre-release.

Thank you,
M.

Reply via email to