Debian Bug report logs - #58322
can't "p environ"

version graph

Package: gdb; Maintainer for gdb is Héctor Orón Martínez <[email protected]>; Source for gdb is src:gdb (PTS, buildd, popcon).

Reported by: shaslam <[email protected]>

Date: Thu, 17 Feb 2000 17:33:00 UTC

Severity: important

Merged with 536024

Found in versions gdb/6.8-3, gdb/4.18.19990928-1

Forwarded to http://sourceware.org/bugzilla/show_bug.cgi?id=8588

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Vincent Renardias <[email protected]>:
Bug#58322; Package gdb. (full text, mbox, link).


Acknowledgement sent to shaslam <[email protected]>:
New Bug report received and forwarded. Copy sent to Vincent Renardias <[email protected]>. (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: shaslam <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: can't "p environ"
Date: Thu, 17 Feb 2000 17:20:31 +0000
Package: gdb
Version: 4.18.19990928-1
Severity: normal

I wrote envstuff.c:

#include <stdlib.h>
#include <stdio.h>

extern char **environ;

int main(int argc, char **argv, char **env)
{
  printf("argc=%d argv=%p env=%p environ=%p\n", argc, argv, env, environ);
  exit(0);
}

and compiled it (gcc -ggdb envstuff.c -o envstuff)

It produces this output:

bash$ ./envstuff 
argc=1 argv=0xbffff8d4 env=0xbffff8dc environ=0xbffff8dc

but when in gdb, I get:

(gdb) b main
Breakpoint 1 at 0x8048486: file envstuff.c, line 8.
(gdb) r
Starting program: /usr/home/shaslam/perltest/envstuff 

Breakpoint 1, main (argc=1, argv=0xbffff8c4, env=0xbffff8cc) at envstuff.c:8
8	  printf("argc=%d argv=%p env=%p environ=%p\n", argc, argv, env,
environ);
(gdb) p env
$1 = (char **) 0xbffff8cc
(gdb) p environ
$2 = (char **) 0x0

?

bash$ gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.2/specs
gcc version 2.95.2 20000116 (Debian GNU/Linux)

SRH
-- System Information
Debian Release: 2.2
Architecture: i386
Kernel: Linux hell 2.2.14 #1-DellLatCPi Thu Jan 6 20:47:36 GMT 2000 i686

Versions of packages gdb depends on:
ii  libc6                         2.1.3-2    GNU C Library: Shared libraries an
ii  libncurses4                   4.2-8      Shared libraries for terminal hand



Information forwarded to [email protected], Daniel Jacobowitz <[email protected]>:
Bug#58322; Package gdb. (full text, mbox, link).


Acknowledgement sent to Matthew Wilcox <[email protected]>:
Extra info received and forwarded to list. Copy sent to Daniel Jacobowitz <[email protected]>. (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Matthew Wilcox <[email protected]>
To: [email protected]
Subject: Confirmed
Date: Sun, 11 Jul 2004 15:18:43 +0100
This bug still occurs with gdb 6.1-3.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain



Information stored:
Bug#58322; Package gdb. (full text, mbox, link).


Acknowledgement sent to Daniel Jacobowitz <[email protected]>:
Extra info received and filed, but not forwarded. (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Daniel Jacobowitz <[email protected]>
To: [email protected]
Subject: Cause of environ error
Date: Sat, 29 Sep 2007 17:51:12 -0400
(gdb) info var environ

Non-debugging symbols:
0x00000000006009a8  __environ@@GLIBC_2.2.5
0x00000000006009a8  environ@@GLIBC_2.2.5
0x00002aaaab01ca08  __environ
0x00002aaaab01ca08  _environ

GDB does not realize that the symbol in the application's dynbss
section is supposed to be the same as the symbol in the shared
libc.so.6.  There's a copy in the executable because of the R_386_COPY
relocation, necessary to ensure all shared libraries use the same copy.

-- 
Daniel Jacobowitz
CodeSourcery




Set Bug forwarded-to-address to 'http://sourceware.org/bugzilla/show_bug.cgi?id=8588'. Request was from Samuel Bronson <[email protected]> to [email protected]. (Tue, 29 Jan 2013 23:39:06 GMT) (full text, mbox, link).


Severity set to 'important' from 'normal' Request was from Samuel Bronson <[email protected]> to [email protected]. (Tue, 29 Jan 2013 23:39:06 GMT) (full text, mbox, link).


Marked as found in versions gdb/6.8-3. Request was from Samuel Bronson <[email protected]> to [email protected]. (Tue, 29 Jan 2013 23:39:06 GMT) (full text, mbox, link).


Merged 536024 58322 Request was from Samuel Bronson <[email protected]> to [email protected]. (Tue, 29 Jan 2013 23:39:06 GMT) (full text, mbox, link).


Message #24 received at [email protected] (full text, mbox, reply):

From: Samuel Bronson <[email protected]>
To: [email protected]
Subject: Re: Bug#536024: gdb gets wrong address for glibc optind variable
Date: Tue, 29 Jan 2013 20:28:24 -0500
Package: gdb
Version: 7.4.1-1

This bug seems to have vanished at some point; I tried the testcase
provided at <http://sourceware.org/bugzilla/show_bug.cgi?id=8588> and
got the correct result.

-- 
Hi! I'm a .signature virus! Copy me into your ~/.signature to help me spread!



Bug reopened Request was from Samuel Bronson <[email protected]> to [email protected]. (Fri, 01 Feb 2013 21:27:03 GMT) (full text, mbox, link).


No longer marked as fixed in versions gdb/7.4.1-1. Request was from Samuel Bronson <[email protected]> to [email protected]. (Fri, 01 Feb 2013 21:27:04 GMT) (full text, mbox, link).


No longer marked as found in versions 4.18.19990928-1. Request was from Samuel Bronson <[email protected]> to [email protected]. (Fri, 01 Feb 2013 22:51:10 GMT) (full text, mbox, link).


Marked as found in versions gdb/4.18.19990928-1. Request was from Samuel Bronson <[email protected]> to [email protected]. (Fri, 01 Feb 2013 22:51:11 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Mon Nov 11 13:50:41 2024; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.