PHP  
 PHP_5_6
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Valgrind Report for sapi/cli/tests/cli_process_title_unix.phpt ('Check cli_process_title support on Unix')

Script

1: <?php
2:
echo "*** Testing setting the process title ***\n";
3:
4:
$set_title $original_title uniqid("title"true);
5:
$pid getmypid();
6:
7: if (
cli_set_process_title($original_title) === true)
8:   echo 
"Successfully set title\n";
9:
10:
$ps_output shell_exec("ps -p $pid -o command | tail -n 1");
11:
12: if (
$ps_output === null)
13: {
14:   echo 
"ps failed\n";
15:   die();
16: }
17:
18:
$loaded_title trim($ps_output);
19: if (
strpos(strtoupper(substr(PHP_OS013)), "BSD") !== false)
20: {
21:   
// Fix up title for BSD
22:   
$set_title "php: $original_title (php)";
23: }
24:
25: if (
$loaded_title == $set_title)
26:   echo 
"Successfully verified title using ps\n";
27: else
28:   echo 
"Actually loaded from ps: $loaded_title\n";
29:
30:
$read_title cli_get_process_title();
31: if (
$read_title == $original_title)
32:   echo 
"Successfully verified title using get\n";
33: else
34:   echo 
"Actually loaded from get: $read_title\n";
35:
36:
?>
37:

Report

==30182== Conditional jump or move depends on uninitialised value(s)
==30182==    at 0x4C2B537: __GI___rawmemchr (mc_replace_strmem.c:1203)
==30182==    by 0x52E671F: _IO_str_init_static_internal (in /lib64/libc-2.12.so)
==30182==    by 0x52DA6C4: vsscanf (in /lib64/libc-2.12.so)
==30182==    by 0x52D4737: sscanf (in /lib64/libc-2.12.so)
==30182==    by 0x403096: ??? (in /bin/ps)
==30182==    by 0x4022A5: ??? (in /bin/ps)
==30182==    by 0x528FD5C: (below main) (in /lib64/libc-2.12.so)
==30182== 

 

Generated at Tue, 28 Oct 2014 09:43:43 +0000 (3 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.