Page MenuHomePhabricator

php-segfaultTag
ActivePublic

Details

Description

Used to flag any tasks involving a Zend PHP segmentation fault.

Recent Activity

Thu, Feb 5

Aklapper added a comment to T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood.

@tstarling: This task has been assigned to you a while ago. Is this still a valid (open) task which requires more work, or do you assume this got fixed by T389734?

Thu, Feb 5, 10:30 AM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error

Apr 4 2025

tstarling added a comment to T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood.

All Excimer segfault bugs are now suspected duplicates of T389734, i.e. glibc timer aliasing, glibc#32833.

Apr 4 2025, 5:21 AM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error

Sep 14 2024

Krinkle edited projects for T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood, added: MediaWiki-Platform-Team (Radar); removed MediaWiki-Platform-Team.
Sep 14 2024, 10:10 PM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error
Restricted Application added a project to T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood: MediaWiki-Platform-Team.
Sep 14 2024, 10:09 PM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error

Feb 29 2024

DAlangi_WMF closed T358757: Gerrit failing on some patches with CalledProcessError as Resolved.

Found the issue and resolved it. I ran composer run --timeout=0 phpunit:entrypoint -- --group Database --exclude-group Broken,ParserFuzz,Stub,Standalone --debug (with --debug) to see which test causes this which narrowed things down.

Test 'ObjectCacheTest::testNewAnythingAccel' started
Segmentation fault
Script phpunit handling the phpunit event returned with error code 139
Script @phpunit was called via phpunit:entrypoint
``
Feb 29 2024, 7:10 PM · php-segfault, ci-test-error
DAlangi_WMF added a comment to T358757: Gerrit failing on some patches with CalledProcessError.
root@cf3df63ff3fa:/var/www/html/w# composer run --timeout=0 phpunit:entrypoint -- --group Database --exclude-group Broken,ParserFuzz,Stub,Standalone
Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port).
> phpunit '--group' 'Database' '--exclude-group' 'Broken,ParserFuzz,Stub,Standalone'
Xdebug: [Step Debug] Could not connect to debugging client. Tried: host.docker.internal:9000 (through xdebug.client_host/xdebug.client_port).
Using PHP 8.1.20
Running with MediaWiki settings because there might be integration tests
PHPUnit 9.6.16 by Sebastian Bergmann and contributors.
Feb 29 2024, 5:50 PM · php-segfault, ci-test-error
Jdforrester-WMF edited projects for T358757: Gerrit failing on some patches with CalledProcessError, added: php-segfault; removed Gerrit.

From the logs, your code triggers a segfault when running PHP, which is probably an upstream bug in PHP rather than a bug in your code per se.

Feb 29 2024, 1:41 PM · php-segfault, ci-test-error

Jan 31 2024

hashar added a project to T228346: PHP 7.2 garbage collector segfault: php-segfault.
Jan 31 2024, 8:58 PM · php-segfault, Patch-For-Review, MW-1.35-notes (1.35.0-wmf.22; 2020-03-03), Release-Engineering-Team-TODO, MW-1.35-release, Upstream, MediaWiki-General, PHP 7.2 support

Dec 14 2023

MSantos removed a project from T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood: Parsoid.
Dec 14 2023, 3:22 PM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error

Nov 13 2023

hashar closed T321980: Segfault in refreshLinks job as Declined.

You would the Linux Kernel to generate a core dump when php crashes. Running the jobs with ulimit -c unlimited should enable that and once a core file has been acquired, remove the setting to avoid filing disk.

Nov 13 2023, 10:05 AM · php-segfault, MW-1.38-release, PHP 7.4 support, Upstream, MediaWiki-General

Nov 9 2023

Pppery added a project to T321980: Segfault in refreshLinks job: php-segfault.
Nov 9 2023, 3:20 AM · php-segfault, MW-1.38-release, PHP 7.4 support, Upstream, MediaWiki-General

Oct 2 2023

Maintenance_bot removed a project from T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1: Patch-For-Review.
Oct 2 2023, 3:11 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
CodeReviewBot added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

jforrester closed https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/29

Oct 2 2023, 2:51 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure

Aug 30 2023

hashar added a comment to T338208: xdebug causes segmentation fault in PHP when hitting a breakpoint in a phpunit test.

docker-registry.discovery.wmnet/dev/buster-swift53 failed cause of an outdated gpg key.

Aug 30 2023, 4:23 PM · MW-1.41-notes (1.41.0-wmf.17; 2023-07-11), php-segfault

Aug 29 2023

hashar updated the post content for Blog Post: Investigate a PHP segmentation fault.
Aug 29 2023, 8:51 AM · php-segfault, Release-Engineering-Team
hashar edited Description on php-segfault.
Aug 29 2023, 8:45 AM

Aug 25 2023

tstarling renamed T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood from PHP Warning: DOMElement::setAttributeNS() expects parameter 3 to be string, object given to Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood.
Aug 25 2023, 2:01 AM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error
tstarling added a project to T342304: Request timeout in LuaError::getScriptTraceHtml() leads to shared memory corruption, segfault flood: php-segfault.

Most likely opcache corruption. Errors started only 1ms after the request timeout at 12:36:03.013, and then there was a flood of segfaults over the next few hundred milliseconds, finishing with "[WARNING] failed processes threshold (40 in 60 sec) is reached, initiating reload" at 12:36:03.800.

Aug 25 2023, 1:41 AM · MediaWiki-Platform-Team (Radar), php-segfault, Excimer, RemexHtml, Wikimedia-production-error

Jul 31 2023

tstarling closed T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown as Resolved.

This is fixed and released in LuaSandbox 4.1.1.

Jul 31 2023, 4:54 AM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox

Jul 28 2023

thcipriani updated the post content for Blog Post: Investigate a PHP segmentation fault.
Jul 28 2023, 8:46 PM · php-segfault, Release-Engineering-Team
hashar added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

I have published the result of this debugging as Blog Post: Investigate a PHP segmentation fault

Jul 28 2023, 12:07 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
hashar published Blog Post: Investigate a PHP segmentation fault.
Jul 28 2023, 12:06 PM · php-segfault, Release-Engineering-Team

Jul 27 2023

hashar updated the task description for T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.
Jul 27 2023, 7:39 AM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure

Jul 26 2023

hashar added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

And eventually it is fixed:

16:30:26 <wmf-insecte> Project beta-update-databases-eqiad build #69029: FIXED in 10 min: https://integration.wikimedia.org/ci/job/beta-update-databases-eqiad/69029/
Jul 26 2023, 4:31 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
Stashbot added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

Mentioned in SAL (#wikimedia-releng) [2023-07-26T15:29:52Z] <jnuche> reenabled https://integration.wikimedia.org/ci/view/Beta/job/beta-update-databases-eqiad/ Should be fixed now! https://phabricator.wikimedia.org/T342769

Jul 26 2023, 3:30 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
Jdforrester-WMF closed T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1 as Resolved.

Possibly caused by errant user input that wasn't stopped.

Jul 26 2023, 3:18 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
Stashbot added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

Mentioned in SAL (#wikimedia-releng) [2023-07-26T15:04:22Z] <jnuche> disabled https://integration.wikimedia.org/ci/view/Beta/job/beta-update-databases-eqiad/ after debugging is done. See https://phabricator.wikimedia.org/T342769

Jul 26 2023, 3:04 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
hashar added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

After I have remembered PHP provides some gdb helpers ( .gdbinit in php-7.4.30 branch), I have added it to my home dir and loaded it with gdb> source /home/hashar/gdbinit.

Jul 26 2023, 3:02 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
Jdforrester-WMF added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.
[10:41:48]  <+hashar> [0x7fffcb44b710] preg_match("\7^Z[1-9]\d*$\7u", "Z1002") [internal function]
[10:41:48]  <+hashar> [0x7fffcb44aba0] Opis\JsonSchema\Validator->validateString(reference, reference, array(0)[0x7fffcb44ac10], array(7)[0x7fffcb44ac20], object[0x7fffcb44ac30], object[0x7fffcb44ac40], object[0x7fffcb44ac50]) /srv/mediawiki-staging/php-master/vendor/opis/json-schema/src/Validator.php:1219 
[10:41:48]  <+hashar> [0x7fffcb44a760] Opis\JsonSchema\Validator->validateProperties(reference, reference, array(0)[0x7fffcb44a7d0], array(7)[0x7fffcb44a7e0], object[0x7fffcb44a7f0], object[0x7fffcb44a800], object[0x7fffcb44a810], NULL) /srv/mediawiki-staging/php-master/vendor/opis/json-schema/src/Validator.php:943 
[10:42:00]  <+hashar> I will paste the details and the first few lines on the task
[10:43:05]  <+hashar> I guess the regex does an infinite loop
[10:43:20]  <+hashar> or whatever really I don't know
[10:46:18]  <James_F> hashar: OK, so that's probably coming from extensions/WikiLambda/function-schemata/data/CANONICAL/Z9.yaml
Jul 26 2023, 2:55 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
CodeReviewBot added a project to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1: Patch-For-Review.

jforrester opened https://gitlab.wikimedia.org/repos/abstract-wiki/wikifunctions/function-schemata/-/merge_requests/29

Jul 26 2023, 2:53 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
hashar added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

So Instead of messing up with systemd / coredump / ulimit I went to invoke the php command under GDB based on a previous issue T296539#7531235

Jul 26 2023, 2:35 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
Jdforrester-WMF added a project to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1: Abstract Wikipedia team.
Jul 26 2023, 2:24 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
Stashbot added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

Mentioned in SAL (#wikimedia-releng) [2023-07-26T14:02:48Z] <hashar> deployment-prep: on deployment-deploy03, installed php / libpcre debugging symbols for T342769: sudo apt-get install php7.4-common-dbgsym php7.4-cli-dbgsym libpcre2-dbg

Jul 26 2023, 2:02 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
hashar added a comment to T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.

I have changed /etc/systemd/coredump.conf:

- KeepFree=20%
+ KeepFree=4G

But that comes from Puppet. I have thus disabled the Puppet agent for now and have set the value to 4G. The core file should then be stored under /var/lib/systemd/coredump.

Jul 26 2023, 1:57 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure
hashar created T342769: Beta update.php fails due to PHP segfault in libpcre2-8.so.0.7.1.
Jul 26 2023, 1:47 PM · Abstract Wikipedia team, WikiLambda, Wikifunctions, Release-Engineering-Team, php-segfault, Beta-Cluster-reproducible, Beta-Cluster-Infrastructure

Jul 25 2023

sbassett changed the visibility for T290831: Loading a particular diff on ckbwiki causes PHP to segfault.
Jul 25 2023, 1:24 PM · php-segfault, MediaWiki-Parser, Performance-Team (Radar), SecTeam-Processed, Vuln-DoS, Security-Team, Security, Platform Engineering, Wikimedia-production-error

Jul 18 2023

TK-999 added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

Thanks, this is great!

Jul 18 2023, 2:10 AM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
tstarling added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

I filed https://github.com/php/php-src/issues/11734

Jul 18 2023, 12:33 AM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
Maintenance_bot removed a project from T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown: Patch-For-Review.
Jul 18 2023, 12:10 AM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox

Jul 17 2023

tstarling added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

It would seem that there's a critical section between zend_object_std_init() and the assignment of handlers, during which time it's unsafe to call emalloc().

Jul 17 2023, 11:42 PM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
gerritbot added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

Change 938925 merged by jenkins-bot:

[mediawiki/php/luasandbox@master] Fix segmentation fault when memory limit is exceeded in LuaSandbox init

https://gerrit.wikimedia.org/r/938925

Jul 17 2023, 11:31 PM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
gerritbot added a project to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown: Patch-For-Review.
Jul 17 2023, 8:37 PM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
gerritbot added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

Change 938925 had a related patch set uploaded (by TK-999; author: TK-999):

[mediawiki/php/luasandbox@master] Fix segmentation fault when memory limit is exceeded in LuaSandbox init

https://gerrit.wikimedia.org/r/938925

Jul 17 2023, 8:37 PM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
TK-999 added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

I think this is not a PHP 8.0 specific issue, it'd likely happen on earlier versions as well. We just happened to notice it because we were on the lookout for core dumps while investigating unrelated JIT issues.

Jul 17 2023, 8:31 PM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox
TK-999 added a comment to T322748: LuaSandbox segmentation fault on PHP 8 during request shutdown.

Thanks a lot, Tim :)- using your advice, I inspected a more recent dump and found that it was a request where PHP was exceeding its configured memory limit while it was parsing a rather complex page. Going by that, I managed to narrow it down to a consistent reproducer:

--TEST--
Memory limit exceeded during sandbox init
--INI--
memory_limit=2M
--FILE--
<?php
$buf = str_repeat('a', 1000000);
$sandboxes = [];
for ($i = 0; $i < 100; $i++) {
    $sandboxes[] = new LuaSandbox();
}
?>
--EXPECTF--
Fatal error: Allowed memory size of 2097152 bytes exhausted%s(tried to allocate %d bytes) in %s on line %d
Jul 17 2023, 8:30 PM · Upstream, php-segfault, PHP 8.0 support, LuaSandbox

Jul 12 2023

Aklapper changed the edit policy for php-segfault.
Jul 12 2023, 11:09 AM

Jul 11 2023

sbassett moved T290831: Loading a particular diff on ckbwiki causes PHP to segfault from Watching to Our Part Is Done on the Security-Team board.

Given the previous comment, is there any reason to keep this task protected at this point? I'm not seeing one.

Jul 11 2023, 7:03 PM · php-segfault, MediaWiki-Parser, Performance-Team (Radar), SecTeam-Processed, Vuln-DoS, Security-Team, Security, Platform Engineering, Wikimedia-production-error

Jul 10 2023

Maintenance_bot removed a project from T338208: xdebug causes segmentation fault in PHP when hitting a breakpoint in a phpunit test: Patch-For-Review.
Jul 10 2023, 3:10 PM · MW-1.41-notes (1.41.0-wmf.17; 2023-07-11), php-segfault
ReleaseTaggerBot added a project to T338208: xdebug causes segmentation fault in PHP when hitting a breakpoint in a phpunit test: MW-1.41-notes (1.41.0-wmf.17; 2023-07-11).
Jul 10 2023, 3:01 PM · MW-1.41-notes (1.41.0-wmf.17; 2023-07-11), php-segfault
gerritbot added a comment to T338208: xdebug causes segmentation fault in PHP when hitting a breakpoint in a phpunit test.

Change 936327 merged by jenkins-bot:

[mediawiki/core@master] docker: update to latest published images

https://gerrit.wikimedia.org/r/936327

Jul 10 2023, 2:50 PM · MW-1.41-notes (1.41.0-wmf.17; 2023-07-11), php-segfault