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

Valgrind Report for ext/standard/tests/general_functions/proc_nice_basic.phpt ('proc_nice() basic behaviour')

Script

1: <?php
2:     
function getNice($id)
3:     {
4:         
$res shell_exec('ps -p ' $id .' -o "pid,nice"');
5:         
preg_match('/^\s*\w+\s+\w+\s*(\d+)\s+(\d+)/m'$res$matches);
6:         if (
count($matches) > 2)
7:             return 
$matches[2];
8:         else
9:             return -
1;
10:     }
11:     
$delta 10;
12:     
$pid getmypid();
13:     
$niceBefore getNice($pid);
14:     
proc_nice($delta);
15:     
$niceAfter getNice($pid);
16:     
var_dump($niceBefore == ($niceAfter $delta));
17:
?>
18:

Report

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

 

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

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