Home > concrete5 for advanced users > concrete5 and core dump files

concrete5 and core dump files

September 26th, 2009 Leave a comment Go to comments

We wrote about concrete5 generating core dump files on some hostings before, we’ve did a thorough investigation of this problem, but still couldn’t find the exact reason for the core dump files being generated. But most likely it happens when concrete5 tries to allocate more resources than the system allows the php process to get.
If the solution we described (increasing memory limit) doesn’t help you, you can try this workaround which makes concrete5 delete core dump files after the script is run. Our investigations show that usually nothing really bad happens when a core dump file appears, but it might be very bad if you collect numerouse core dump files and exhaust your account limit.

So, try this:

Open ‘concrete/startup/shutdown.php‘ file.

And modify it in the following way:

<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$db = Loader::db();
if (is_object($db)) {
	$db->disconnect();
}

$dp = @opendir(DIR_BASE);
if ($dp) {
	while(false !== ($file = @readdir($dp))) {
		if (strpos($file, 'core.') === 0)
			@unlink(DIR_BASE."/".$file);
	}
	@closedir($dp);
}
exit;
Categories: concrete5 for advanced users Tags:
  1. September 28th, 2009 at 01:13 | #1

    Thanks for the write-up. Obviously, this is treating a symptom and not the source of the problem. We try to be resource-conscious, but certain aspects of concrete5 are memory intensive. I haven’t seen this error on our particular hosting, or any of the third party hosts we refer people to. It’s really odd.

  2. September 28th, 2009 at 01:39 | #2

    Yes, that’s really odd.

    I’ve done some benchmarking and concrete5 indeed seems to use not much resources. It’s a really strange issue and it’s hard to investigate it – it happens randomly at different stages (even if you just refresh the page) or doesn’t happen at all – sometimes it happens on outputAutoHeaderItems, sometimes on block render, but not always on the same block.

    And the most strange thing is that script doesn’t die or break, it just creates a core dump file, but works a normal way.

  1. No trackbacks yet.