beetboxvm / beetbox

Pre-provisioned L*MP stack
http://beetbox.rtfd.org
92 stars 19 forks source link

Segmentation faults, possibly due to xhprof #469

Closed danepowell closed 6 years ago

danepowell commented 6 years ago

Problem/Motivation

Multiple people on our project team have started getting segfaults when running certain Drush commands against a beetbox-based DrupalVM via SSH.

The segfaults look like this in syslog:

vagrant kernel: [ 510.193496] php[17945]: segfault at 7fbcd1a00000 ip 00007fbce5a6584e sp 00007ffdc66766c8 error 4 in libc-2.23.so[7fbce59c6000+1c0000]

local kernel: [1043068.013040] php[574]: segfault at 7f83cea00000 ip 00007f83e4bda84e sp 00007ffc2072a958 error 4 in libc-2.23.so[7f83e4b3b000+1c0000]

The coredump backtrace looks like this: https://pastebin.com/4iVHND1G

Steps to reproduce

I'm not sure of a reliable way to reproduce this from scratch, but for those of us that have started to experience it it is very repeatable. The same Drush command will produce the same segfault every single time.

For all of us, the problem is solved by disabling xhprof. I don't necessarily know that xhprof causes the bug (it is present in the backtrace): it's possible that this is some sort of exotic memory corruption and xhprof just happens to be the extension that breaks the camel's back. I opened an upstream issue to try to rule this out: https://github.com/phacility/xhprof/issues/102

I've also never experienced this segfault on Jeff Geerling's Ubuntu base box, only on Beetbox. Possibly because xhprof isn't enabled by default on the Ubuntu box.

Proposed changes

Disable xhprof by default, just to be safe. It might or might not be a permanent fix, but it's probably not a bad idea all around. It appears that Beetbox has had problems with it in the past if you search the queue, there are better alternatives, and it appears to be marginally maintained (the maintainer claims to be supporting it but I see no commits in over 3 years): https://github.com/phacility/xhprof/issues/85, https://github.com/phacility/xhprof/issues/81

oxyc commented 6 years ago

I hit this with xhprof + php 7.1 as well. See https://github.com/geerlingguy/drupal-vm/pull/1406 and the issues I link to there too.

oxyc commented 6 years ago

Latest d8 HEAD version of the xhprof module supports the tideways rename as well: https://cgit.drupalcode.org/XHProf/commit/?id=dafb2bc6efeb8241a4bc8b9e1e4eedbf68c13a3a.

Still no d7 support though.

thom8 commented 6 years ago

Disabled xhprof by default in #470 -- should be removed in the latest release 8.14