Forums / Developer / httpd crash on inserting content

httpd crash on inserting content

Author Message

Michael de Vries

Thursday 19 February 2009 1:21:30 am

Hi all!

I'm trying to write a soap plugin for eZ Publish, so I can publish content to eZ from another content system.
Except for not finding a lot of documentation about how to do this it is coming along fine.

So, what I have done until now:
I wrote a plugin which uses soap, this is working fine, I can talk to eZ, fetch objects and even put some stuff in.
But now I am at the point where I want to add an article to the system. If I try this with the code below, my httpd process crashes, no errors are written to the system or eZ publish log.

The code I use is the following:

initialize.php

<?php
// in extensions/my_soap_extension/soap/initialize.php

$server->registerFunction("createObject", array("title" => "string", "short_title" => "string", "intro" => "string", "body" => "string", "enable_comments" => "boolean", "username" => "string", "password" => "string"));

function createObject($title, $short_title, $intro, $body, $enable_comments, $username, $password){
	$user = checkUser($username, $password);

	if(!$user){
		return new eZSOAPFault("1", "Access denied, check username and password");
	}

	// Fetch parent node
	$parentNodeId = 2; //Main eZ Publish Node
	$parentNode =& eZContentObjectTreeNode::fetch($parentNodeId); //make a copy of the parent node
	
	if(!is_object($parentNode)){
		//if we come here, then parent node is a fake!
		return new eZSOAPFault("1", "Parent node doesn't exist!");
	}

	//fetch some useful variables
	$parentContentObject =& $parentNode->attribute("object");
	$sectionId = $parentContentObject->attribute("section_id");
	$userId =& $user->attribute("contentobject_id");
	
	//fetch class (article)
	$contentClass =& eZContentClass::fetchByIdentifier("Article");
	if(!is_object($contentClass)){
		//the contentclass doesn't exist, abort mission
		return new eZSOAPFault("1", "Article ContentClass doesn't exist!");
	}
	
	//create new ContentObject of this ContentClass
	$contentObject =& $contentClass->instantiate($userId, $sectionId);
}
?>

So, when I run this code, the httpd process crashes and after some investigation it seems to come from the following statement:

$contentClass->instantiate($userId, $sectionId);

This functions calls the following function:

$object->setName( ezi18n( "kernel/contentclass", "New %1", null, array( $this->name( $languageCode ) ) ), false, $languageCode );

And in this setName function there is the following line:

$backtrace = debug_backtrace();

When I remove that line, everything goes fine, no error or crashes occur. Zend Studio says the line is useless, because the $backtrace variable is never used, so why is this line there and why does it crash on that line?

Ole Marius Smestad

Thursday 19 February 2009 2:28:38 am

Hi,

that backtrace should not be there, it is removed for the upcoming versions.

http://issues.ez.no/14499


--
Ole Marius Smestad
Lead Engineer eZ Publish
Member of the Community Project Board

eZ debug

Timing: Jan 29 2025 13:36:07
Script start
Timing: Jan 29 2025 13:36:07
Module start 'content'
Timing: Jan 29 2025 13:36:07
Module end 'content'
Timing: Jan 29 2025 13:36:07
Script end

Main resources:

Total runtime0.1530 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0052 587.9375180.8281
Module start 'content' 0.00520.0079 768.765693.8984
Module end 'content' 0.01310.1399 862.6641529.2969
Script end 0.1529  1,391.9609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00342.2012200.0002
Check MTime0.00130.8267200.0001
Mysql Total
Database connection0.00070.437210.0007
Mysqli_queries0.103167.36461410.0007
Looping result0.00120.76561390.0000
Template Total0.139491.110.1394
Template load0.00070.467910.0007
Template processing0.138790.670210.1387
Override
Cache load0.00050.326810.0005
Sytem overhead
Fetch class attribute can translate value0.00080.530110.0008
XML
Image XML parsing0.00030.167410.0003
General
dbfile0.01036.7487200.0005
String conversion0.00000.002830.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0002 secs