php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45422 Creation of new xmlwriter using memory fails
Submitted: 2008-07-02 23:00 UTC Modified: 2008-07-11 01:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: ales dot loncar at internet-solutions dot si Assigned:
Status: No Feedback Package: XML Writer
PHP Version: 5.2.6 OS: Mac OS X 10.5.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
46 + 26 = ?
Subscribe to this entry?

 
 [2008-07-02 23:00 UTC] ales dot loncar at internet-solutions dot si
Description:
------------
Creation of new xmlwriter using memory fails. Script stops at same line. In Apache error log notice is writen:
[notice] child pid 363 exit signal Bus error (10)

Reproduce code:
---------------
$data = array(
    "foo" => 456,
    "bar" => 789,
    "aaa" => array(
        "abc" => 111
    )
);

$xml = new XmlWriter();
$xml->openMemory(); // script stopes in this line
$xml->startDocument('1.0', 'UTF-8');
$xml->startElement('root');

function write(XMLWriter $xml, $data){
    foreach($data as $key => $value){
        if(is_array($value)){
            $xml->startElement($key);
            write($xml, $value);
            $xml->endElement();
            continue;
        }
        $xml->writeElement($key, $value);
    }
}
write($xml, $data);

$xml->endElement();
echo $xml->outputMemory(true);

Expected result:
----------------
<?xml version="1.0" encoding="UTF-8"?>
<root><foo>456</foo><bar>789</bar><aaa><abc>111</abc></aaa></root>

Actual result:
--------------
Blank Screen

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-07-02 23:05 UTC] scottmac@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2008-07-03 08:13 UTC] pajoye@php.net
For the information, works like a charm on windows and linux.

Scott, have you tried the script?
 [2008-07-11 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 00:01:29 2024 UTC