View Issue Details

IDProjectCategoryView StatusLast Update
0001526XdebugCode Coveragepublic2021-11-10 15:44
Reporterlucasvanlierop Assigned Toderick  
PrioritynormalSeveritycrashReproducibilitysometimes
Status resolvedResolutionno change required 
PlatformLinuxOSAlpineOS Version3.4
Product Version2.6.0 
Target Version2.6.1 
Summary0001526: Segfaults occur when generating code coverage with PHP-FPM in Docker on Travis
Description

Occasionally generating code coverage fails with a segfault 'core dumped' but only when running on Travis.

Steps To Reproduce

I have not not yet been able to isolate the issue.

Additional Information

I'm not sure if it's related yet but we also often experience 'core dumped' when running node-sass in Docker Alpine on Travis and debugging this led to:

https://github.com/sass/node-sass/issues/2031

Which led to:

http://wiki.musl-libc.org/wiki/Functional_differences_from_glibc#Thread_stack_size

and

https://github.com/voidlinux/void-packages/issues/4147

There seems to be a workaround:

https://github.com/sass/node-sass/issues/2031#issuecomment-325182447

I also noticed an interesting remark which explains why the problem (in our case) only occurs on Travis:
https://github.com/sass/node-sass/issues/2031#issuecomment-364377066

"It only occurs if the docker host itself has a hardened linux kernel (alpine in my case)."

Note that 'Thread stack size' is beyond my knowledge so in case I wrote anything that doesn't make sense I apologize for that in advance

TagsNo tags attached.
Operating SystemAlpine 3.4
PHP Version7.1.10-7.1.14

Activities

derick

2018-02-18 15:42

administrator   ~0004595

How often does it do this? One out of every 3 runs? One out of every 100?

Code coverage hardly runs with PHP-FPM, and usually, through PHP Code Coverage and the PHP CLI. Are you sure PHP-FPM is involved?

As you get a "core dumped", it would be interesting to see what is in the core file. For the MongoDB driver, we use the following to dump the output of core files to see why something would crash:

https://github.com/derickr/mongo-php-driver/blob/master/.travis.yml#L41
and
https://github.com/derickr/mongo-php-driver/blob/master/.travis.scripts/debug-core.sh

Perhaps you can try that to find some more information.

cheers,
Derick

lucasvanlierop

2018-02-19 13:30

reporter   ~0004596

Regarding FPM vs CLI, we're using the FPM version of the offical Docker image (which also includes CLI) also we're generating code coverage with both unit tests in CLI and end to end tests via FPM.

However we found more reproducable case in a different project. Below the most simple version I could reduce it to:

<?php

class Bar
{
public static function baz()
{
return new static();
}
}

function foo(Bar $argumentThatGetsReAssigned)
{
$argumentThatGetsReAssigned = Bar::baz();
non_existing_function();
}

foo(Bar::baz());

This ran in PHP version:

PHP 7.0.27 (cli) (built: Jan 10 2018 03:57:49) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.27, Copyright (c) 1999-2017, by Zend Technologies
with Xdebug v2.6.0, Copyright (c) 2002-2018, by Derick Rethans

with the following modules:

[PHP Modules]
bcmath
Core
ctype
curl
date
dom
fileinfo
filter
ftp
gd
hash
iconv
imagick
intl
json
libxml
mbstring
mcrypt
mysqli
mysqlnd
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
soap
SPL
sqlite3
standard
tokenizer
xdebug
xml
xmlreader
xmlwriter
Zend OPcache
zip
zlib

[Zend Modules]
Xdebug
Zend OPcache

Unfortunately there's no debugging support in the container this code ran in so I can't provide a core file.

Please let me know if I can provide other info.

Thanks,
Lucas

derick

2018-03-03 13:13

administrator   ~0004608

I can reproduce the segfault from the last script, but I can't see why and how this happens yet!

lucasvanlierop

2018-03-08 07:33

reporter   ~0004612

Thanks for looking at it!, I'm curious if we ever find out why this happens :)

derick

2021-03-17 09:36

administrator   ~0005761

Is this issue still relevant to you?

lucasvanlierop

2021-03-29 12:12

reporter   ~0005818

No it isn't since I'm no longer working on this project. thanks for checking!

derick

2021-11-10 15:44

administrator   ~0006153

Let me close this out then. Thanks :-)

Issue History

Date Modified Username Field Change
2018-02-14 08:19 lucasvanlierop New Issue
2018-02-18 15:42 derick Note Added: 0004595
2018-02-18 15:42 derick Assigned To => derick
2018-02-18 15:42 derick Status new => feedback
2018-02-19 13:30 lucasvanlierop Note Added: 0004596
2018-02-19 13:30 lucasvanlierop Status feedback => assigned
2018-03-03 13:13 derick Note Added: 0004608
2018-03-03 13:13 derick Status assigned => acknowledged
2018-03-03 13:14 derick Status acknowledged => confirmed
2018-03-03 13:14 derick Target Version => 2.6.1
2018-03-08 07:33 lucasvanlierop Note Added: 0004612
2021-03-17 09:36 derick Status confirmed => feedback
2021-03-17 09:36 derick Note Added: 0005761
2021-03-29 12:12 lucasvanlierop Note Added: 0005818
2021-03-29 12:12 lucasvanlierop Status feedback => assigned
2021-11-10 15:44 derick Status assigned => resolved
2021-11-10 15:44 derick Resolution open => no change required
2021-11-10 15:44 derick Note Added: 0006153