Bug #60078 [NEW]: SIGSEGV in xhprof.c
| From: | odoucet@php.net | Date: | Mon, 17 Oct 2011 16:51:21 +0000 |
| Subject: | Bug #60078 [NEW]: SIGSEGV in xhprof.c | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-164377@lists.php.net to get a copy of this message | ||
From:
Operating system: -
PHP version: Irrelevant
Package: xhprof
Bug Type: Bug
Bug description:SIGSEGV in xhprof.c
Description:
------------
I'll try to be as precise as possible :
This happens in a special case that can be reproduced 100%, but I cannot
provide
a test
script (it is using 20MB of closed customer code).
This happens only whith xhprof_enable(). No problem is encountered when the
module is just
loaded with no call to xhprof_enable()
In latest clone from git (commit a6bae51236 for file xhprof.c)
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff3575f49 in hp_mode_shared_endfn_cb (top=0xef0210, symbol=<value
optimized out>)
at /usr/src/xhprof/extension/xhprof.c:1553
bt
#0 hp_mode_shared_endfn_cb (top=0xef0210, symbol=<value optimized out>) at
/usr/src/xhprof/extension/xhprof.c:1553
#1 0x00007ffff357609e in hp_mode_hier_endfn_cb (entries=<value optimized
out>)
at
/usr/src/xhprof/extension/xhprof.c:1573
#2 0x00007ffff3576e66 in hp_compile_file (file_handle=<value optimized
out>,
type=8) at
/usr/src/xhprof/extension/xhprof.c:1721
#3 0x00000000007218a4 in ?? ()
#4 0x000000000071f294 in execute ()
#5 0x00000000006faf7b in zend_execute_scripts ()
#6 0x00000000006b573a in php_execute_script ()
#7 0x0000000000772287 in main ()
Ok so problem is in the function "hp_mode_shared_endfn_cb"
Let's try to see what is the value of each variable here :
print /f hp_globals.cpu_frequencies[hp_globals.cur_cpu_id]
Cannot access memory at address 0x0
ok so problem is in this expression.
print hp_globals.cpu_frequencies
$8 = (double *) 0x0
(gdb) print /f hp_globals.cur_cpu_id
$9 = 0
Ok so I can see that hp_globals.cpu_frequencies equals NULL (right ?), and
we
attempt to
access it as an array.
I read the source code quickly, and I can see that this array should be
filled
at some
point. Seems it is not.
I made a dirty patch just to avoid the SIGSEGV, but all my timings in
xhprof
reports are
inaccurate now.
--
Edit bug report at https://bugs.php.net/bug.php?id=60078&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60078&r=trysnapshot54
Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60078&r=trysnapshot53
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60078&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=60078&r=fixed
Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60078&r=needdocs
Fixed in release: https://bugs.php.net/fix.php?id=60078&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=60078&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=60078&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=60078&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=60078&r=support
Expected behavior: https://bugs.php.net/fix.php?id=60078&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=60078&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=60078&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=60078&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60078&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=60078&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=60078&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=60078&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=60078&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=60078&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=60078&r=mysqlcfg