ID: 6175
User Update by: [EMAIL PROTECTED]
Status: Open
Bug Type: *XML functions
Description: XML functions no longer work in objects
Yes. If these lines are used in an object's constructor:
$this->parser = xml_parser_create();
xml_set_object($this->parser, $this);
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, true);
xml_set_element_handler($this->parser, 'startElement', 'endElement');
xml_set_character_data_handler($this->parser, 'defaultHandler');
... Apache will segfault with the following backtrace:
#0 0x3 in ?? ()
#1 0x281e2391 in call_user_function_ex (function_table=0x80b9280,
object_pp=0x80ffcc0, function_name=0x8148dcc, retval_ptr_ptr=0xbfbfd14c,
param_count=2, params=0x81487ac, no_separation=1, symbol_table=0x0)
at zend_execute_API.c:397
#2 0x281e2111 in call_user_function (function_table=0x80b9280,
object_pp=0x80ffcc0, function_name=0x8148dcc, retval_ptr=0x80d570c,
param_count=2, params=0xbfbfd1e8) at zend_execute_API.c:325
#3 0x2828ad5c in xml_call_handler (parser=0x80ffc8c, handler=0x8148dcc,
argc=2, argv=0xbfbfd1e8) at xml.c:386
#4 0x2828b98d in _xml_characterDataHandler (userData=0x80ffc8c,
s=0xbfbfd257 "\n ^-(\f\020\022\b0\020\022\b\2059\025\b", len=1)
at xml.c:804
#5 0x2829cf38 in doContent (parser=0x8101400, startTagLevel=0,
enc=0x282d5e20,
s=0x8121046 "\n <title>Message Composition: Actions</title>\n
<heading>Actions</heading>\n <para>\n Send Message launches your email to the
intended recipient(s). Be sure you want to send before clicking h"...,
end=0x8123e29 "", nextPtr=0x0) at xmlparse.c:1383
#6 0x2829c37d in contentProcessor (parser=0x8101400,
start=0x8121022 "<help>\n\n<entry id=\"compose-buttons\">\n <title>Message
Composition: Actions</title>\n <heading>Actions</heading>\n <para>\n Send
Message launches your email to the intended recipient(s). Be sur"...,
end=0x8123e29 "", endPtr=0x0) at xmlparse.c:957
#7 0x2829e29d in prologProcessor (parser=0x8101400,
s=0x8121022 "<help>\n\n<entry id=\"compose-buttons\">\n <title>Message
Composition: Actions</title>\n <heading>Actions</heading>\n <para>\n Send
Message launches your email to the intended recipient(s). Be sur"...,
end=0x8123e29 "", nextPtr=0x0) at xmlparse.c:2036
#8 0x2829dfb2 in prologInitProcessor (parser=0x8101400,
s=0x812100c "<?xml version='1.0'?>\n<help>\n\n<entry id=\"compose-buttons\">\n
<title>Message Composition: Actions</title>\n <heading>Actions</heading>\n
<para>\n Send Message launches your email to the intende"...,
end=0x8123e29 "", nextPtr=0x0) at xmlparse.c:1967
#9 0x2829bef8 in php_XML_Parse (parser=0x8101400,
s=0x812100c "<?xml version='1.0'?>\n<help>\n\n<entry id=\"compose-buttons\">\n
<title>Message Composition: Actions</title>\n <heading>Actions</heading>\n
<para>\n Send Message launches your email to the intende"...,
len=11805, isFinal=1) at xmlparse.c:779
#10 0x2828c836 in php_if_xml_parse (ht=3, return_value=0x8148f0c,
this_ptr=0x0, return_value_used=0) at xml.c:1394
#11 0x281dbf01 in execute (op_array=0x8129d0c) at ./zend_execute.c:1494
#12 0x281dc154 in execute (op_array=0x80ff98c) at ./zend_execute.c:1534
#13 0x281e9e86 in zend_execute_scripts (type=8, file_count=3) at zend.c:743
#14 0x281fb6dc in php_execute_script (primary_file=0xbfbff7dc) at main.c:1194
#15 0x281f8006 in apache_php_module_main (r=0x8112034, display_source_mode=0)
at sapi_apache.c:89
#16 0x281f8996 in send_php (r=0x8112034, display_source_mode=0, filename=0x0)
at mod_php4.c:521
#17 0x281f89d2 in send_parsed_php (r=0x8112034) at mod_php4.c:532
#18 0x8053fa1 in ap_invoke_handler ()
#19 0x80686a8 in process_request_internal ()
#20 0x8068712 in ap_process_request ()
#21 0x805f6df in child_main ()
---Type <return> to continue, or q <return> to quit---
#22 0x805f89d in make_child ()
#23 0x805fa16 in startup_children ()
#24 0x8060024 in standalone_main ()
#25 0x806083c in main ()
#26 0x804eaa1 in _start ()
Previous Comments:
---------------------------------------------------------------------------
[2001-04-01 13:18:12] [EMAIL PROTECTED]
I believe it's still a problem, but I'll have to recreate my test case. I'll try and
get to it soon.
---------------------------------------------------------------------------
[2001-03-31 11:17:17] [EMAIL PROTECTED]
do you still experience this error?
---------------------------------------------------------------------------
[2000-08-31 15:00:35] [EMAIL PROTECTED]
With today's CVS, including Andrei's latest change to xml.c (rev. 1.61), I can
generate a backtrace for the segfault that occurs when calling the xml_* routines from
the constructor:
Starting program: /usr/local/src/apache_1.3.12/src/httpd -X
Program received signal SIGSEGV, Segmentation fault.
0x80e3a0e in _efree (ptr=0x5a5a5a5a,
__zend_filename=0x81bb1a9 "zend_variables.c", __zend_lineno=98,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at zend_alloc.c:196
196 CALCULATE_REAL_SIZE_AND_CACHE_INDEX(p->size);
(gdb) bt
#0 0x80e3a0e in _efree (ptr=0x5a5a5a5a,
__zend_filename=0x81bb1a9 "zend_variables.c", __zend_lineno=98,
__zend_orig_filename=0x0, __zend_orig_lineno=0) at zend_alloc.c:196
#1 0x80eea7e in zval_del_ref (p=0x8263b3c) at zend_variables.c:98
#2 0x80dc0cd in xml_parser_dtor (parser=0x8263b24) at xml.c:302
#3 0x80f3dc1 in list_entry_destructor (ptr=0x82d3be4) at zend_list.c:253
#4 0x80f2b1d in zend_hash_apply_deleter (ht=0x824b880, p=0x82b70a4)
at zend_hash.c:619
#5 0x80f2c3e in zend_hash_graceful_destroy (ht=0x824b880) at zend_hash.c:670
#6 0x80f3e97 in zend_destroy_rsrc_list () at zend_list.c:298
#7 0x80e9490 in shutdown_executor () at zend_execute_API.c:179
#8 0x80ef604 in zend_deactivate () at zend.c:520
#9 0x808070b in php_request_shutdown (dummy=0x0) at main.c:659
#10 0x807e887 in php_apache_request_shutdown (dummy=0x0) at mod_php4.c:291
#11 0x8124ee5 in run_cleanups (c=0x82b30f4) at alloc.c:1706
#12 0x812359b in ap_clear_pool (a=0x82b200c) at alloc.c:531
#13 0x812361b in ap_destroy_pool (a=0x82b200c) at alloc.c:561
#14 0x8123587 in ap_clear_pool (a=0x826600c) at alloc.c:528
#15 0x8133165 in child_main (child_num_arg=0) at http_main.c:3900
#16 0x81337a5 in make_child (s=0x8252034, slot=0, now=967748297)
at http_main.c:4281
#17 0x813391e in startup_children (number_to_start=3) at http_main.c:4363
#18 0x8133f28 in standalone_main (argc=2, argv=0xbfbffa48) at http_main.c:4651
#19 0x8134740 in main (argc=2, argv=0xbfbffa48) at http_main.c:4978
>From Apache's error log:
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
httpd in free(): warning: chunk is already free.
[Thu Aug 31 08:57:05 2000] [notice] child pid 57954 exit signal Segmentation fault (11)
---------------------------------------------------------------------------
[2000-08-23 10:30:05] [EMAIL PROTECTED]
If you're referring to Andrei's changes that accept the array($this, 'fooHandler')
syntax, no, it doesn't fix my problem, and I actually haven't gotten the new syntax to
work correctly, either. I'll try and look into it some more later today.
---------------------------------------------------------------------------
[2000-08-23 08:29:41] [EMAIL PROTECTED]
Wasn't this just fixed in cvs??
--Jani
---------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view the rest of the
comments, please view the bug report online.
Full Bug description available at: http://bugs.php.net/?id=6175
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]