Skip to content

Instantly share code, notes, and snippets.

@jmcausing
Created October 8, 2019 09:15
Show Gist options
  • Save jmcausing/fa8d4db905b2b5468300987fa5184f4e to your computer and use it in GitHub Desktop.
Save jmcausing/fa8d4db905b2b5468300987fa5184f4e to your computer and use it in GitHub Desktop.
SIGSEGV / 502 or 503 bad gateway solution
"get ID of the php fpm
ps -faux | grep -I $(pwd | awk -F/ '{print $4}' | cut -c -7 ) | grep php-fpm
get the ID of the php fpm child
make sure to login as root: btool su
strace command:
strace -s 1024 -P CHILD_ID -e trace=file
example:
strace -s 1024 -p 14950 -e trace=file
Then refresh the web page.
Example error:
stat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/core/lib/Drupal/Core/Site/Settings.php"", {st_mode=S_IFREG|0644, st_size=6092, ...}) = 0
access(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/settings.php"", R_OK) = 0
lstat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/settings.php"", {st_mode=S_IFREG|0644, st_size=1051, ...}) = 0
lstat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default"", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0
lstat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites"", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/settings.php"", {st_mode=S_IFREG|0644, st_size=1051, ...}) = 0
lstat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/settings.pantheon.php"", {st_mode=S_IFREG|0644, st_size=7018, ...}) = 0
stat(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/settings.pantheon.php"", {st_mode=S_IFREG|0644, st_size=7018, ...}) = 0
access(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/services.pantheon.preproduction.yml"", F_OK) = -1 ENOENT (No such file or directory)
access(""/srv/bindings/67b1ecb3101c452eadc68b5c40f83ed0/code/web/sites/default/settings.local.php"", F_OK) = -1 ENOENT (No such file or directory)
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7ffdbfeb0ff8} ---
+++ killed by SIGSEGV +++
So above error is linked to php files like settings.php
Turns out that settings.php is looping and clonning the functions and it kills nginx like these codes:
<?php
class c
{
public function __clone()
{
clone $this;
}
}
clone new c();
More info here: https://docs.google.com/presentation/d/1A4WcNIYoZJHBK7YtZZGjsIg6RcBHkxWDORvv5zw15EU/edit#slide=id.g3ca5761700_0_0
"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment