Segmentation Fault (11) on installation - fixed
Permalink 1 user found helpful
Hi. I installed Concrete5 and hit the document root in my web browser and got a blank page. So I checked the server log and saw the following error message:
So I searched and found a number of forum and blog posts that said basically, try increasing the memory footprint of PHP, which didn't seem to work for anyone, including me. The developers that responded did not seem to think it was their problem or make any attempt to help troubleshoot (beyond suggesting to increase the memory--I've never seen a segfault from lack of memory). So, I located the problem myself.
For some reason, use of @include() as a method of including a file, seems to cause my PHP installation to segfault if the file is not found. Obviously this shouldn't happen, there is nothing technically wrong with the code, but I consider @include() and use of "@" in general as a method of error suppression to be a terrible practice for reasons like this. If I removed the @, at least I got an error message which put me right at the point in the code where the segfault happened. Otherwise, it was just a segfault in some large codebase, somewhere.
Anyway, here are my fixes. In concrete/dispatcher.php, change these lines:
To this:
And, at the end of concrete/startup/config_check.php, change this:
To this:
I don't know why the original code causes a segfault, but I do know that it only took me--a person wholly unfamiliar with the code--about 10 minutes to locate and fix the problem. I had to do it myself because the responses to all similar problems were met with shrugs because it "shouldn't happen". I agree that it shouldn't, and it's probably a PHP bug, or some other problem not related to Concrete. However, most people are not able to do the work that I did, and are likely to just figure your software is broken and move on to try something else.
child exit signal Segmentation fault (11)
So I searched and found a number of forum and blog posts that said basically, try increasing the memory footprint of PHP, which didn't seem to work for anyone, including me. The developers that responded did not seem to think it was their problem or make any attempt to help troubleshoot (beyond suggesting to increase the memory--I've never seen a segfault from lack of memory). So, I located the problem myself.
For some reason, use of @include() as a method of including a file, seems to cause my PHP installation to segfault if the file is not found. Obviously this shouldn't happen, there is nothing technically wrong with the code, but I consider @include() and use of "@" in general as a method of error suppression to be a terrible practice for reasons like this. If I removed the @, at least I got an error message which put me right at the point in the code where the segfault happened. Otherwise, it was just a segfault in some large codebase, somewhere.
Anyway, here are my fixes. In concrete/dispatcher.php, change these lines:
@include(DIR_CONFIG_SITE . '/site_theme_paths.php'); @include(DIR_CONFIG_SITE . '/site_file_types.php');
To this:
if (file_exists(DIR_CONFIG_SITE . '/site_theme_paths.php')) include(DIR_CONFIG_SITE . '/site_theme_paths.php'); if (file_exists(DIR_CONFIG_SITE . '/site_file_types.php')) include(DIR_CONFIG_SITE . '/site_file_types.php');
And, at the end of concrete/startup/config_check.php, change this:
if (!@include(CONFIG_FILE)) { $config_check_failed = true; }
To this:
if (!file_exists(CONFIG_FILE)) $config_check_failed = true; else include(CONFIG_FILE);
I don't know why the original code causes a segfault, but I do know that it only took me--a person wholly unfamiliar with the code--about 10 minutes to locate and fix the problem. I had to do it myself because the responses to all similar problems were met with shrugs because it "shouldn't happen". I agree that it shouldn't, and it's probably a PHP bug, or some other problem not related to Concrete. However, most people are not able to do the work that I did, and are likely to just figure your software is broken and move on to try something else.
Mad Love //de