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_process_title_field "command";
11: if (
strtoupper(substr(PHP_OS03)) == "AIX")
12: {
13:   
$ps_process_title_field "args";
14: }
15:
$ps_output shell_exec("ps -p $pid -o $ps_process_title_field | tail -n 1");
16:
17: if (
$ps_output === null)
18: {
19:   echo 
"ps failed\n";
20:   die();
21: }
22:
23:
$loaded_title trim($ps_output);
24: if (
strpos(strtoupper(substr(PHP_OS013)), "BSD") !== false)
25: {
26:   
// Fix up title for BSD
27:   
$set_title "php: $original_title (php)";
28: }
29:
30: if (
$loaded_title == $set_title)
31:   echo 
"Successfully verified title using ps\n";
32: else
33:   echo 
"Actually loaded from ps: $loaded_title\n";
34:
35:
$read_title cli_get_process_title();
36: if (
$read_title == $original_title)
37:   echo 
"Successfully verified title using get\n";
38: else
39:   echo 
"Actually loaded from get: $read_title\n";
40:
41:
?>
42:

Report

==32497== Conditional jump or move depends on uninitialised value(s)
==32497==    at 0x4C2D1A7: __GI___rawmemchr (vg_replace_strmem.c:1394)
==32497==    by 0x52E96CF: _IO_str_init_static_internal (in /lib64/libc-2.12.so)
==32497==    by 0x52DD674: vsscanf (in /lib64/libc-2.12.so)
==32497==    by 0x52D76E7: sscanf (in /lib64/libc-2.12.so)
==32497==    by 0x4031B6: ??? (in /bin/ps)
==32497==    by 0x402335: ??? (in /bin/ps)
==32497==    by 0x5292D1C: (below main) (in /lib64/libc-2.12.so)
==32497== 

 

Generated at Sun, 28 Aug 2016 17:10:18 +0000 (8 hours ago)

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