Segmentation fault when shutting down the PHP when running in Gitlab CI (not locally)
Summary
Segfault in PHP using docker runner on debian machine, but not when running job locally, using gitlab-runner exec
Steps to reproduce
This does not happen during running PHPUnit globally, but only when testing my application in dome particular case. I have problem to reproduced this locally, because it seemd like problem is only when running job from Gitlab CI, not locally.
Actual behavior
When running tests normally, in Gitalb CI, using docker runner installed on my server, at the end of tests, segmentation fault is thrown.
$ ./vendor/bin/phpunit --configuration ./phpunit.xml.gitlab --testsuite Functional_tests
PHPUnit 6.2.4 by Sebastian Bergmann and contributors.
............................................ 44 / 44 (100%)
Time: 41.64 seconds, Memory: 140.00MB
OK (44 tests, 761 assertions)
Remaining deprecation notices (16)
/bin/bash: line 71: 31 Segmentation fault (core dumped) ./vendor/bin/phpunit --configuration ./phpunit.xml.gitlab --testsuite Functional_tests
Uploading artifacts...
var/logs: found 4 matching files
Uploading artifacts to coordinator... ok id=45343199 responseStatus=201 Created token=Lz2qHyJ7
ERROR: Job failed: exit code 1
The backtrack in the dumped core is:
#0 0x000055bbd5294492 in destroy_op_array ()
#1 0x000055bbd52b269c in zend_hash_destroy ()
#2 0x000055bbd52a0d58 in ?? ()
#3 0x000055bbd523d37b in php_module_shutdown ()
#4 0x000055bbd4f7a02d in ?? ()
#5 0x00007ff8374e6b45 in __libc_start_main (main=0x55bbd4f79ba0, argc=6, argv=0x7ffe29b19bf8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffe29b19be8)
at libc-start.c:287
#6 0x000055bbd4f7a14d in _start ()
So it is not caused in my codebase which is tested, but during shutting down of PHP.
But When I run it locally on the machine where gitlab-runner is installed, using gitlab-runner exec docker test, the job succedes without any problems.
$ ./vendor/bin/phpunit --configuration ./phpunit.xml.gitlab --testsuite Functional_tests
PHPUnit 6.2.4 by Sebastian Bergmann and contributors.
............................................ 44 / 44 (100%)
Time: 41.54 seconds, Memory: 140.00MB
OK (44 tests, 761 assertions)
Remaining deprecation notices (16)
Running after script...
Creating cache test/testing-segfault...
vendor: found 25375 matching files
Created cache
Job succeeded
Expected behavior
I expect that it would not segfault after running tests.
Relevant logs and/or screenshots
Currently I have no idea which other logs should be useful, but I'll add any other logs that come to your mind.
Environment description
Are you using shared Runners on GitLab.com? Or is it a custom installation? Which executors are used? Please also provide the versions of related tools like
docker infoif you are using the Docker executor. I use custom installarion, docker executor. This is my config.toml:
concurrent = 1
check_interval = 0
log_level = "debug"
[[runners]]
name = "debian-runner-janud"
url = "https://gitlab.com/"
token = "####"
executor = "docker"
[runners.docker]
tls_verify = false
image = "docker:latest"
privileged = true
disable_cache = false
cache_dir = "cache"
volumes = ["/var/run/docker.sock:/var/run/docker.sock", "/cache"]
[runners.cache]
This is info about machine where itlab runner is installed: Linux debian 3.16.0-4-amd64 #1 (closed) SMP Debian 3.16.43-2+deb8u5 (2017-09-19) x86_64 GNU/Linux
Used GitLab Runner version
Version: 9.5.1 Git revision: 96b34ccf Git branch: 9-5-stable GO version: go1.8.3 Built: Wed, 04 Oct 2017 16:26:27 +0000 OS/Arch: linux/amd64