How to reproduce :
- install Domain Access 3.x prior to commit a719dcd (for example, use commit f5d241d)
- work with it (create a second domain, for example)
- update Domain Access code to last 3.x-dev (as of today, it is commit ddc960e, but I can also reproduce from commit a719dcd)
- Drupal segfaults on every pages (no possible updgrade path : update.php segfaults, drush segfaults, home page too...)

I guess the problem comes from something in commit a719dcd (see diff here).

I'm using Apache 2.2.19, PHP 5.3.6, and MySQL Community Server 5.5.15.

Regards,

David

Comments

David Stosik’s picture

Title: Broken upgrade path from 3.x-dev: segmentation fault » Segmentation fault

That's even worse. Domain Access also segfaults on a clean install.
How to reproduce :
- install Drupal minimal profile
- download Domain Access 3.x-dev (drush command: drush dl domain-3.x-dev )
- enable Domain Access module (drush command: drush en domain )
- copy "include_once DRUPAL_ROOT . '/sites/all/modules/domain/settings.inc';" to site settings.php file
- Drupal segfaults ! (index.php, update.php, drush...)

Still using those versions (on MacOS X Lion): Apache 2.2.19, PHP 5.3.6, and MySQL Community Server 5.5.15.

David

David Stosik’s picture

Status: Active » Needs review
StatusFileSize
new447 bytes

First problem: there is a double "passing by reference", in call and in function signature, for domain_update_messages().
I'm experiencing other problems on a clean install, I think I'd better open other issues when I found more.

David Stosik’s picture

Priority: Normal » Critical

As it kills a clean install, I set priority to critical.

agentrickard’s picture

Status: Needs review » Reviewed & tested by the community

Nice catch on the reference. Is that really enough to cause a segfault, though?

This obviously doesn't happen for me.

Running:

* PHP 5.3.2
* MySQL 5.1.44-log
* Apache/2.0.63 (Unix) PHP/5.3.2 DAV/2

(using MAMP on OS X Snow Leopard)

I'm curious if PHP 5.3.6 is different enough to explain the difference.

Does this patch stop the segfaults for you? (Committing anyway, but need to know).

agentrickard’s picture

Status: Reviewed & tested by the community » Fixed

Marking this one fixed, but would love more details here.

Note that the offending patch/commit passed the provided tests, so I wonder just what the variance is that causes the problem for you.

David Stosik’s picture

Yeah, the patch I provided stops the segfault.
Are you sure your tests execute this piece of code ?
As long as it's not executed, I only get a notice telling me that call-time pass-by-reference is deprecated.
I only get a segfault when the call is done.

agentrickard’s picture

Status: Fixed » Needs work

Well, even with the code, my system never throws a segfault -- not even when I was debugging the original code. So even a test wouldn't catch the segfault.

Adding a test here is a good idea. We can check if the drupal_set_message() fires as expected.

Setting to needs work to add that test.

David Stosik’s picture

Status: Needs work » Fixed

Not the first time the deprecated "call-time pass-by-reference" generates segfaults : #832108: Call-time pass-by-reference error / segmentation fault

agentrickard’s picture

Status: Fixed » Needs work

Setting back to needs work for the test.

jonabh’s picture

cant find this domain.module you mention. where is it located ?

MPeli’s picture

I applied the patch. Unfortunately, it did not help. I get following error:

Deprecated function: Call-time pass-by-reference has been deprecated in drupal_load() (line 1114 of /home/users/MyUser/example.com/web/includes/bootstrap.inc).

agentrickard’s picture

That error is unrelated too this issue, sorry.

agentrickard’s picture

Status: Needs work » Closed (fixed)
Marvine’s picture

Hi,

I reopen the issue because I have the same problem.

First I have the following error message :

PHP Fatal error: include_once(): Cannot redeclare class insertquery_mysql

Even if I wrap my function with if (!class_exists('InsertQuery_mysql')) {

cf. http://help.getpantheon.com/pantheon/topics/fatal_error_require_once_cannot_redeclare_class_insertquery_mysql_in_srv_bindings_e00a4bcbe3264dbc99e16a53cf85d78b_code_includes_database_database_inc_on_line

Next, i have crash with (in /var/log/httpd/error_log) :
[Tue Oct 30 10:59:33 2012] [error] [client 10.26.176.74] PHP Fatal error: include_once(): Cannot redeclare class insertquery_mysql in /home/project1/trunk/includes/bootstrap.inc on line 1128, referer: http://site1.dev.domain.com/
[Tue Oct 30 10:59:34 2012] [notice] child pid 3250 exit signal Segmentation fault (11)

Any ideas ?

carn1x’s picture

@#14, I believe that error can be attributed to APC (possibly other caching software like eAccelerator / XCache). Caching has also been known to cause segfaults. Try turning your caching off or changing to another one.