Issue #2921862 by alexpott, vaplas, tacituseu: Segfault on PHP5.5 and PostgreSQL

8.5.x
Nathaniel Catchpole 2017-11-13 22:15:42 +00:00
parent 431e90f8cc
commit dbc01628d1
1 changed files with 14 additions and 0 deletions

View File

@ -446,6 +446,15 @@ abstract class BrowserTestBase extends TestCase {
* {@inheritdoc} * {@inheritdoc}
*/ */
protected function setUp() { protected function setUp() {
// Installing Drupal creates 1000s of objects. Garbage collection of these
// objects is expensive. This appears to be causing random segmentation
// faults in PHP 5.x due to https://bugs.php.net/bug.php?id=72286. Once
// Drupal is installed is rebuilt, garbage collection is re-enabled.
$disable_gc = version_compare(PHP_VERSION, '7', '<') && gc_enabled();
if ($disable_gc) {
gc_collect_cycles();
gc_disable();
}
parent::setUp(); parent::setUp();
$this->setupBaseUrl(); $this->setupBaseUrl();
@ -466,6 +475,11 @@ abstract class BrowserTestBase extends TestCase {
// Set up the browser test output file. // Set up the browser test output file.
$this->initBrowserOutputFile(); $this->initBrowserOutputFile();
// If garbage collection was disabled prior to rebuilding container,
// re-enable it.
if ($disable_gc) {
gc_enable();
}
} }
/** /**