PHP  
 PHP_HEAD
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

==8224== Conditional jump or move depends on uninitialised value(s)
==8224==    at 0x4C2B537: __GI___rawmemchr (mc_replace_strmem.c:1203)
==8224==    by 0x52E670F: _IO_str_init_static_internal (in /lib64/libc-2.12.so)
==8224==    by 0x52DA6B4: vsscanf (in /lib64/libc-2.12.so)
==8224==    by 0x52D4727: sscanf (in /lib64/libc-2.12.so)
==8224==    by 0x4031B6: ??? (in /bin/ps)
==8224==    by 0x402335: ??? (in /bin/ps)
==8224==    by 0x528FD5C: (below main) (in /lib64/libc-2.12.so)
==8224== 

 

Generated at Sat, 13 Dec 2014 06:16:29 +0000 (6 days ago)

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