php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #33242 mangled error message when stream fails
Submitted: 2005-06-04 15:05 UTC Modified: 2005-06-06 14:41 UTC
From: derick@php.net Assigned: wez
Status: Closed Package: HTTP related
PHP Version: 4CVS-2005-06-04 (stable) OS: Linux
Private report: No CVE-ID:
 [2005-06-04 15:05 UTC] derick@php.net
Description:
------------
Error message as shown in output:
Warning: fopen(http://ez:1137/index.php/eZ_accept_path_info_test): failed to open stream: HTTP request failed! Üsr§,úØà{¾RÌé’F“ in /home/httpd/ez_trunk/kernel/setup/ezsetuptests.php on line 343

No script, but valgrind errors:
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B9077FB: strlen (mac_replace_strmem.c:189)
==21504==    by 0x8097A7E: xbuf_format_converter (spprintf.c:518)
==21504==    by 0x8097E74: vspprintf (spprintf.c:725)
==21504==    by 0x80A0F81: php_stream_wrapper_log_error (streams.c:2653)
==21504==    by 0x8152D46: php_stream_url_wrap_http_ex (http_fopen_wrapper.c:538)
==21504==    by 0x8153975: php_stream_url_wrap_http (http_fopen_wrapper.c:576)
==21504==    by 0x80A10AD: _php_stream_open_wrapper_ex (streams.c:2696)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B907805: strlen (mac_replace_strmem.c:189)
==21504==    by 0x8097A7E: xbuf_format_converter (spprintf.c:518)
==21504==    by 0x8097E74: vspprintf (spprintf.c:725)
==21504==    by 0x80A0F81: php_stream_wrapper_log_error (streams.c:2653)
==21504==    by 0x8152D46: php_stream_url_wrap_http_ex (http_fopen_wrapper.c:538)
==21504==    by 0x8153975: php_stream_url_wrap_http (http_fopen_wrapper.c:576)
==21504==    by 0x80A10AD: _php_stream_open_wrapper_ex (streams.c:2696)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B907805: strlen (mac_replace_strmem.c:189)
==21504==    by 0x809D9FD: display_wrapper_errors (streams.c:200)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C7D80: execute (zend_execute.c:2241)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B907609: strcat (mac_replace_strmem.c:144)
==21504==    by 0x809DAA1: display_wrapper_errors (streams.c:207)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C7D80: execute (zend_execute.c:2241)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B907805: strlen (mac_replace_strmem.c:189)
==21504==    by 0x8097A7E: xbuf_format_converter (spprintf.c:518)
==21504==    by 0x8097E74: vspprintf (spprintf.c:725)
==21504==    by 0x8092B7A: php_verror (main.c:455)
==21504==    by 0x8092FAC: php_error_docref1 (main.c:563)
==21504==    by 0x809DA66: display_wrapper_errors (streams.c:221)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x812C1D7: php_escape_html_entities (html.c:916)
==21504==    by 0x8092EFA: php_verror (main.c:459)
==21504==    by 0x8092FAC: php_error_docref1 (main.c:563)
==21504==    by 0x809DA66: display_wrapper_errors (streams.c:221)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C7D80: execute (zend_execute.c:2241)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B907805: strlen (mac_replace_strmem.c:189)
==21504==    by 0x8097A7E: xbuf_format_converter (spprintf.c:518)
==21504==    by 0x8097E74: vspprintf (spprintf.c:725)
==21504==    by 0x8093080: php_error_cb (main.c:599)
==21504==    by 0x80B8631: zend_error (zend.c:789)
==21504==    by 0x8092C0F: php_verror (main.c:509)
==21504==    by 0x8092FAC: php_error_docref1 (main.c:563)
==21504==    by 0x809DA66: display_wrapper_errors (streams.c:221)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x809CD09: php_strlcpy (strlcpy.c:58)
==21504==    by 0x80930F0: php_error_cb (main.c:612)
==21504==    by 0x80B8631: zend_error (zend.c:789)
==21504==    by 0x8092C0F: php_verror (main.c:509)
==21504==    by 0x8092FAC: php_error_docref1 (main.c:563)
==21504==    by 0x809DA66: display_wrapper_errors (streams.c:221)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==    by 0x80C688C: execute (zend_execute.c:1700)
==21504==
==21504== Conditional jump or move depends on uninitialised value(s)
==21504==    at 0x1B907805: strlen (mac_replace_strmem.c:189)
==21504==    by 0x8097A7E: xbuf_format_converter (spprintf.c:518)
==21504==    by 0x8097E74: vspprintf (spprintf.c:725)
==21504==    by 0x8092AD7: php_printf (main.c:428)
==21504==    by 0x809329C: php_error_cb (main.c:665)
==21504==    by 0x80B8631: zend_error (zend.c:789)
==21504==    by 0x8092C0F: php_verror (main.c:509)
==21504==    by 0x8092FAC: php_error_docref1 (main.c:563)
==21504==    by 0x809DA66: display_wrapper_errors (streams.c:221)
==21504==    by 0x80A1191: _php_stream_open_wrapper_ex (streams.c:2758)
==21504==    by 0x812271C: php_if_fopen (file.c:1146)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==
==21504== Syscall param writev(vector[...]) points to uninitialised byte(s)
==21504==    at 0x1BC935E8: (within /lib/tls/libc-2.3.2.so)
==21504==    by 0x819A0DF: writev_it_all (in /dat/dev/php/apache_1.3.31/src/httpd)
==21504==    by 0x819A47B: large_write (in /dat/dev/php/apache_1.3.31/src/httpd)
==21504==    by 0x819A546: ap_bwrite (in /dat/dev/php/apache_1.3.31/src/httpd)
==21504==    by 0x81AEA1D: ap_rwrite (in /dat/dev/php/apache_1.3.31/src/httpd)
==21504==    by 0x808BCAA: sapi_apache_ub_write (in /dat/dev/php/apache_1.3.31/src/httpd)
==21504==    by 0x80A3C52: php_ub_body_write_no_header (output.c:689)
==21504==    by 0x80A3CF8: php_ub_body_write (output.c:722)
==21504==    by 0x80A3045: php_end_ob_buffer (output.c:299)
==21504==    by 0x80A3F43: zif_ob_end_flush (output.c:815)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80B8788: zend_execute_scripts (zend.c:935)
==21504==  Address 0x1D148B6B is 6995 bytes inside a block of size 40980 alloc'd
==21504==    at 0x1B90659D: malloc (vg_replace_malloc.c:130)
==21504==    by 0x80AAA5C: _emalloc (zend_alloc.c:164)
==21504==    by 0x80A3543: php_ob_init_named (output.c:435)
==21504==    by 0x80A3693: php_ob_init (output.c:524)
==21504==    by 0x80A2D28: php_start_ob_buffer (output.c:163)
==21504==    by 0x80A3D87: zif_ob_start (output.c:749)
==21504==    by 0x80C6B0C: execute (zend_execute.c:1656)
==21504==    by 0x80B8788: zend_execute_scripts (zend.c:935)
==21504==    by 0x809535C: php_execute_script (main.c:1751)
==21504==    by 0x80CA488: apache_php_module_main (sapi_apache.c:54)
==21504==    by 0x808C897: send_php (in /dat/dev/php/apache_1.3.31/src/httpd)
==21504==    by 0x808C90D: send_parsed_php (in /dat/dev/php/apache_1.3.31/src/httpd)



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-06-04 15:05 UTC] derick@php.net
Wez, can you please have a look at the code - I gave it a go but could not find something obvious.
 [2005-06-06 14:02 UTC] derick@php.net
This is an interesting one :) 

To reproduce:
1. run apache in single process mode (-X)
2. create a PHP script:

<?php
    file_get_contents("http://hostname/file.php");

where hostname points to the apache server, and file.php should be the name of the file you use to test.

3. The following valgrind error shows up then:
==5697== Conditional jump or move depends on uninitialised value(s)
==5697==    at 0x1B9057FB: strlen (mac_replace_strmem.c:189)
==5697==    by 0x80A681D: xbuf_format_converter (spprintf.c:518)
==5697==    by 0x80A6F52: vspprintf (spprintf.c:725)
==5697==    by 0x80B439B: php_stream_wrapper_log_error (streams.c:2653)
==5697==    by 0x81E5E70: php_stream_url_wrap_http_ex (http_fopen_wrapper.c:541)
==5697==    by 0x81E607A: php_stream_url_wrap_http (http_fopen_wrapper.c:576)
==5697==    by 0x80B458A: _php_stream_open_wrapper_ex (streams.c:2696)
==5697==    by 0x81A404A: zif_file_get_contents (file.c:448)
==5697==    by 0x80E727E: execute (zend_execute.c:1656)
==5697==    by 0x80D373B: zend_execute_scripts (zend.c:935)
==5697==    by 0x80A4125: php_execute_script (main.c:1751)
==5697==    by 0x80EC752: apache_php_module_main (sapi_apache.c:54)

 [2005-06-06 14:41 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Wed Apr 23 07:02:14 2014 UTC