MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0001526XdebugCode Coveragepublic2018-02-14 08:192018-03-08 07:33
Reporterlucasvanlierop 
Assigned Toderick 
PrioritynormalSeveritycrashReproducibilitysometimes
StatusconfirmedResolutionopen 
PlatformLinuxOSAlpineOS Version3.4
Product Version2.6.0 
Target Version2.6.1Fixed in Version 
Summary0001526: Segfaults occur when generating code coverage with PHP-FPM in Docker on Travis
DescriptionOccasionally generating code coverage fails with a segfault 'core dumped' but only when running on Travis.

Steps To ReproduceI have not not yet been able to isolate the issue.
Additional InformationI'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
Attached Files

- Relationships

-  Notes
(0004595)
derick (administrator)
2018-02-18 15:42

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
(0004596)
lucasvanlierop (reporter)
2018-02-19 13:30

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
(0004608)
derick (administrator)
2018-03-03 13:13

I can reproduce the segfault from the last script, but I can't see why and how this happens yet!
(0004612)
lucasvanlierop (reporter)
2018-03-08 07:33

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

- 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


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker