Bug 161562

Summary: gdb failing to recognize types at first
Product: [Fedora] Fedora Reporter: Joe Orton <jorton>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED INSUFFICIENT_DATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 4CC: cagney
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-02-17 04:10:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Joe Orton 2005-06-24 13:56:34 UTC
I keep seeing this when trying to debug PHP: there is a global structure,
ps_globals; when printing it the first time, gdb claims ignorance about its
type.  After printing it casted to the correct type, gdb will subsequently
recognize the type as expected.  Using debuginfo packages.

(gdb) print ps_globals
$2 = 160245824
(gdb) print (zend_ps_globals *)ps_globals
$3 = (php_ps_globals *) 0x98d2840
(gdb) print (zend_ps_globals *)ps_globals
$4 = (php_ps_globals *) 0x98d2840
(gdb) print ps_globals
$5 = {save_path = 0x98d2840 "/var/lib/php/session", session_name = 0x9929ac0
"PHPSESSID",
... rest of structure, as expected.

Comment 1 Joe Orton 2005-06-24 14:49:00 UTC
This is reproducible with the core dump from
https://bugzilla.redhat.com/bugzilla/attachment.cgi?id=115920 in bug 160480
(gzipped)

an up to date FC4 install:

gdb-6.3.0.0-1.21
php-5.0.4-10
php-debuginfo-5.0.4-10

[root@trash ~]# gdb /usr/sbin/httpd core.4350
...
Loaded symbols for /usr/lib/php/modules/mysqli.so
#0  0x020f4efd in zend_hash_del_key_or_index (ht=0x8ff19bc, arKey=Variable
"arKey" is not available.

) at /usr/src/debug/php-5.0.4/Zend/zend_hash.c:462
462             p = ht->arBuckets[nIndex];
(gdb) ptype ps_globals
type = <data variable, no debug info>
(gdb) print ps_globals
$1 = 145746432
(gdb) print (char *)ps_globals
$2 = 0x8afea00 "/var/lib/php/session"
(gdb) ptype ps_globals
type = <data variable, no debug info>
(gdb) print ps_globals
$3 = 145746432
(gdb) print (zend_ps_globals *)ps_globals
$4 = (php_ps_globals *) 0x8afea00
(gdb) ptype ps_globals
type = struct _php_ps_globals {
    char *save_path;
    char *session_name;
...
etc

and from then on, it's OK.



Comment 2 Christian Iseli 2007-01-20 00:34:24 UTC
This report targets the FC3 or FC4 products, which have now been EOL'd.

Could you please check that it still applies to a current Fedora release, and
either update the target product or close it ?

Thanks.

Comment 3 petrosyan 2008-02-17 04:10:53 UTC
Fedora Core 4 is no longer maintained.

Setting status to "INSUFFICIENT_DATA". If you can reproduce this bug in the
current Fedora release, please reopen this bug and assign it to the
corresponding Fedora version.