Trying to help a Magento store owner (Pro 1.11.0.0) track down php segfaults from their store. We are seeing a few segfaults per minute. All the backtraces are:
#0 match (eptr=0x9ab0213 "') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
ecode=0x154bd7b "\035\\\035'q",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=18) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:500
#1 0x000000000047972a in match (eptr=0x9ab0213 "') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
ecode=0x154bd76 "\177",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
offset_top=<value optimized out>, md=0x7fff88cb88a0, eptrb=0x2, rdepth=17)
at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:973
#2 0x000000000048523c in match (eptr=0x9ab0213 "') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
ecode=0x154bd8b "s",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=16) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:2039
#3 0x000000000047972a in match (eptr=0x9ab0212 "y') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
ecode=0x154bd86 "q",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
offset_top=<value optimized out>, md=0x7fff88cb88a0, eptrb=0x2, rdepth=15)
at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:973
#4 0x000000000048523c in match (eptr=0x9ab0212 "y') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
ecode=0x154bd8b "s",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=14) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:2039
#5 0x000000000047972a in match (
eptr=0x9ab0211 "ry') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd86 "q",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
offset_top=<value optimized out>, md=0x7fff88cb88a0, eptrb=0x2, rdepth=13)
at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:973
#6 0x000000000048523c in match (
eptr=0x9ab0211 "ry') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd8b "s",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=12) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:2039
#7 0x000000000047972a in match (
eptr=0x9ab0210 "ory') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd86 "q",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
offset_top=<value optimized out>, md=0x7fff88cb88a0, eptrb=0x2, rdepth=11)
at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:973
#8 0x000000000048523c in match (
eptr=0x9ab0210 "ory') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd8b "s",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=10) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:2039
#9 0x000000000047972a in match (
eptr=0x9ab020f "gory') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd86 "q",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
offset_top=<value optimized out>, md=0x7fff88cb88a0, eptrb=0x2, rdepth=9)
at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:973
#10 0x000000000048523c in match (
eptr=0x9ab020f "gory') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd8b "s",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=8) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:2039
#11 0x000000000047972a in match (
eptr=0x9ab020e "egory') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd86 "q",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1",
offset_top=<value optimized out>, md=0x7fff88cb88a0, eptrb=0x2, rdepth=7)
at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:973
#12 0x000000000048523c in match (
eptr=0x9ab020e "egory') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", ecode=0x154bd8b "s",
mstart=0x9ab020a "'category') AND (t_def.store_id IN (0, '2')) ORDER BY `t_def`.`store_id` DESC LIMIT 1", offset_top=4,
md=0x7fff88cb88a0, eptrb=0x0, rdepth=6) at /home/admin/php-5.4.32/ext/pcre/pcrelib/pcre_exec.c:2039
#13 0x000000000047972a in match (
The SQL query shown above appears to be from the file: code/core/Mage/GoogleOptimizer/Model/Resource/Code.php
public function loadbyEntityType($object, $storeId) { $adapter = $this->_getReadAdapter();
$codeIdExpr = $adapter->getCheckSql(
't_store.code_id IS NOT NULL',
't_store.code_id',
't_def.code_id');
$storeIdExpr = $adapter->getCheckSql(
't_store.store_id IS NOT NULL',
't_store.store_id',
't_def.store_id');
$controlScriptExpr = $adapter->getCheckSql(
't_store.control_script IS NOT NULL',
't_store.control_script',
't_def.control_script');
$trackingScriptExpr = $adapter->getCheckSql(
't_store.tracking_script IS NOT NULL',
't_store.tracking_script',
't_def.tracking_script');
$conversionScriptExpr = $adapter->getCheckSql(
't_store.conversion_script IS NOT NULL',
't_store.conversion_script',
't_def.conversion_script');
$conversionPageExpr = $adapter->getCheckSql(
't_store.conversion_page IS NOT NULL',
't_store.conversion_page',
't_def.conversion_page');
$additionalDataExpr = $adapter->getCheckSql(
't_store.additional_data IS NOT NULL',
't_store.additional_data',
't_def.additional_data');
$select = $adapter->select()
->from(
array('t_def' => $this->getMainTable()),
array('entity_id', 'entity_type'))
->joinLeft(
array('t_store' => $this->getMainTable()),
't_store.entity_id = t_def.entity_id AND t_store.entity_type = t_def.entity_type AND '
. $adapter->quoteInto('t_store.store_id = ?', $storeId),
array(
'code_id' => $codeIdExpr,
'store_id' => $storeIdExpr,
'control_script' => $controlScriptExpr,
'tracking_script' => $trackingScriptExpr,
'conversion_script' => $conversionScriptExpr,
'conversion_page' => $conversionPageExpr,
'additional_data' => $additionalDataExpr))
->where('t_def.entity_id=?', $object->getEntity()->getId())
->where('t_def.entity_type=?', $object->getEntityType())
->where('t_def.store_id IN (0, ?)', $storeId)
->order('t_def.store_id DESC')
->limit(1);
$data = $adapter->fetchRow($select);
if ($data) {
$object->setData($data);
}
$this->_afterLoad($object);
return $this;
}
Any thoughts / pointers as to what may be causing this issue? They do have the Google Optimizer enabled.
ecode
is not properly null terminated and going out of bounds. This isn't something php code can do on its own. Do you know how the PCRE extension for php was installed?