Hi,
Today I was writing some new tests for tidy, but they aren't working because
of some problem in the engine or the streams stuff that leads to memory
corruption.
The test is ext/tidy/tests/020.phpt.
Attached is a nice valgrind log :)
Nuno
==18294== Memcheck, a memory error detector.
==18294== Copyright (C) 2002-2005, and GNU GPL'd, by Julian Seward et al.
==18294== Using LibVEX rev 1575, a library for dynamic binary translation.
==18294== Copyright (C) 2004-2005, and GNU GPL'd, by OpenWorks LLP.
==18294== Using valgrind-3.1.1, a dynamic binary instrumentation framework.
==18294== Copyright (C) 2000-2005, and GNU GPL'd, by Julian Seward et al.
==18294== For more details, rerun with: -v
==18294==
Strict Standards: date(): It is not safe to rely on the system's timezone
settings. Please use the date.timezone setting, the TZ environment variable or
the date_default_timezone_set() function. In case you used any of those methods
and you are still getting this warning, you most likely misspelled the timezone
identifier. We selected 'Europe/Paris' for 'WEST/1.0/DST' instead in
/cvs/php-src/run-tests.php on line 221
=====================================================================
CWD : /cvs/php-src
PHP : ./sapi/cli/php
PHP_SAPI : cli
PHP_VERSION : 6.0.0-dev
ZEND_VERSION: 3.0.0-dev
PHP_OS : Linux - Linux linux.mshome.net 2.6.16.11 #1 PREEMPT Sat Apr 29
12:05:38 WEST 2006 i686
UNICODE : ON
INI actual : /usr/local/lib/php.ini
More .INIs :
Extra dirs :
=====================================================================
Running selected tests.
==18294== Conditional jump or move depends on uninitialised value(s)
==18294== at 0x44784C3: u_memchr_3_4 (ustring.c:247)
==18294== by 0x826D130: php_stream_locate_eol (streams.c:912)
==18294== by 0x826D22A: _php_stream_get_line (streams.c:969)
==18294== by 0x81EDFB5: zif_fgets (file.c:1052)
==18294== by 0x82C851C: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:209)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82A639F: zend_execute_scripts (zend.c:1561)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294==
==18294== Conditional jump or move depends on uninitialised value(s)
==18294== at 0x826D254: _php_stream_get_line (streams.c:975)
==18294== by 0x81EDFB5: zif_fgets (file.c:1052)
==18294== by 0x82C851C: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:209)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82A639F: zend_execute_scripts (zend.c:1561)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294== by 0x8362809: main (php_cli.c:1089)
==18294==
==18294== Conditional jump or move depends on uninitialised value(s)
==18294== at 0x44795FB: u_countChar32_3_4 (ustring.c:1015)
==18294== by 0x826D486: _php_stream_get_line (streams.c:1015)
==18294== by 0x81EDFB5: zif_fgets (file.c:1052)
==18294== by 0x82C851C: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:209)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82A639F: zend_execute_scripts (zend.c:1561)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294== by 0x8362809: main (php_cli.c:1089)
==18294==
==18294== Conditional jump or move depends on uninitialised value(s)
==18294== at 0x4460FDE: ucnv_fromUnicode_UTF8_3_4 (ucnv_u8.c:367)
==18294== by 0x445647E: ucnv_fromUnicode_3_4 (ucnv.c:773)
==18294== by 0x82975FC: zend_convert_from_unicode (zend_unicode.c:304)
==18294== by 0x8297A8C: zval_unicode_to_string (zend_unicode.c:452)
==18294== by 0x829A955: _convert_to_string_with_converter
(zend_operators.c:671)
==18294== by 0x829AAA2: _convert_to_string (zend_operators.c:655)
==18294== by 0x82A7E8C: zend_parse_va_args (zend_API.c:407)
==18294== by 0x82A8DB2: zend_parse_parameters (zend_API.c:937)
==18294== by 0x80AFDCA: php_pcre_match (php_pcre.c:411)
==18294== by 0x82C851C: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:209)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294==
==18294== Conditional jump or move depends on uninitialised value(s)
==18294== at 0x80ADBBC: php_pcre_exec (pcre_exec.c:3739)
==18294== by 0x80B01C9: php_pcre_match (php_pcre.c:529)
==18294== by 0x82C851C: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:209)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82C8100: zend_do_fcall_common_helper_SPEC
(zend_vm_execute.h:243)
==18294== by 0x82C7E3B: execute (zend_vm_execute.h:92)
==18294== by 0x82A639F: zend_execute_scripts (zend.c:1561)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294== by 0x8362809: main (php_cli.c:1089)
BORK:N missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX-- [ext/tidy/tests/020.phpt]
BORK:U missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX-- [ext/tidy/tests/020.phpt]
=====================================================================
Number of tests : 2 0
Tests borked : 2 (100.0%) --------
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 0 seconds
=====================================================================
=====================================================================
BORKED TEST SUMMARY
---------------------------------------------------------------------
N:missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--
[ext/tidy/tests/020.phpt]
U:missing section --EXPECT--, --EXPECTF-- or --EXPECTREGEX--
[ext/tidy/tests/020.phpt]
=====================================================================
==18294==
==18294== ERROR SUMMARY: 1246 errors from 5 contexts (suppressed: 65 from 1)
==18294== malloc/free: in use at exit: 196,200 bytes in 2,533 blocks.
==18294== malloc/free: 44,805 allocs, 42,272 frees, 3,651,936 bytes allocated.
==18294== For counts of detected errors, rerun with: -v
==18294== searching for pointers to 2,533 not-freed blocks.
==18294== checked 1,460,896 bytes.
==18294==
==18294==
==18294== 24 bytes in 1 blocks are possibly lost in loss record 2 of 14
==18294== at 0x401CC8F: realloc (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==18294== by 0x8297498: zend_convert_to_unicode (zend_unicode.c:259)
==18294== by 0x827EFD8: zend_convert_scanner_output
(zend_language_scanner.l:633)
==18294== by 0x8285524: lex_scan (zend_language_scanner.l:419)
==18294== by 0x8291816: zendlex (zend_compile.c:4237)
==18294== by 0x8279F7D: zendparse (zend_language_parser.c:2768)
==18294== by 0x8280F6C: compile_file (zend_language_scanner.l:810)
==18294== by 0x82A6360: zend_execute_scripts (zend.c:1553)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294== by 0x8362809: main (php_cli.c:1089)
==18294==
==18294==
==18294== 2,872 (144 direct, 2,728 indirect) bytes in 1 blocks are definitely lost in loss record 5 of 14
==18294== at 0x401B511: malloc (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==18294== by 0x8280EF7: compile_file (zend_language_scanner.l:780)
==18294== by 0x82A6360: zend_execute_scripts (zend.c:1553)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294== by 0x8362809: main (php_cli.c:1089)
==18294==
==18294==
==18294== 148,428 bytes in 1 blocks are possibly lost in loss record 14 of 14
==18294== at 0x401CC8F: realloc (in
/usr/lib/valgrind/x86-linux/vgpreload_memcheck.so)
==18294== by 0x8299499: pass_two (zend_opcode.c:374)
==18294== by 0x8280FAA: compile_file (zend_language_scanner.l:823)
==18294== by 0x82A6360: zend_execute_scripts (zend.c:1553)
==18294== by 0x825BB36: php_execute_script (main.c:1878)
==18294== by 0x8362809: main (php_cli.c:1089)
==18294==
==18294== LEAK SUMMARY:
==18294== definitely lost: 144 bytes in 1 blocks.
==18294== indirectly lost: 2,728 bytes in 76 blocks.
==18294== possibly lost: 148,452 bytes in 2 blocks.
==18294== still reachable: 25,432 bytes in 1,194 blocks.
==18294== suppressed: 19,444 bytes in 1,260 blocks.
==18294== Reachable blocks (those to which a pointer was found) are not shown.
==18294== To see them, rerun with: --show-reachable=yes
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php