Bug 185337 - p errno does not work when stopped at a breakpoint
Summary: p errno does not work when stopped at a breakpoint
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb
Version: 4.0
Hardware: i686
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jan Kratochvil
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks: 202727 209548
TreeView+ depends on / blocked
 
Reported: 2006-03-13 20:26 UTC by Jay Fenlason
Modified: 2015-01-08 00:12 UTC (History)
5 users (show)

Fixed In Version: RHSA-2007-0229
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2007-05-01 17:22:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
source for simple test program (2.52 KB, text/plain)
2006-03-13 20:26 UTC, Jay Fenlason
no flags Details
Access TLS symbols without DWARF debuginfo (23.59 KB, patch)
2006-08-25 09:49 UTC, Jan Kratochvil
no flags Details | Diff
Ignore TLS symbols for non-TLS programs (4.28 KB, patch)
2006-08-25 09:50 UTC, Jan Kratochvil
no flags Details | Diff
Suggest how to resolve the missing "errno" symbol (923 bytes, patch)
2006-08-25 09:51 UTC, Jan Kratochvil
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2007:0229 0 normal SHIPPED_LIVE Low: gdb security and bug fix update 2007-05-01 17:21:30 UTC

Description Jay Fenlason 2006-03-13 20:26:10 UTC
Description of problem: 
I compiled a simple test program, started gdb on it, set a breakpoint, started 
my program, and after it hit the breakpoint, attempted to "p errno".  Instead 
of printing the value of errno, gdb said "Cannot access memory at address 0x8" 
 
Version-Release number of selected component (if applicable): 
gdb-6.3.0.0-1.96 
 
How reproducible: 
Always. 
 
Steps to Reproduce: 
1.Compile the attached program with gcc -o convert -g convert.c 
2.gdb convert 
3.b 59 
4.run utf8 cp850 foobarbaz 
5.p errno 
 
Actual results: 
Cannot access memory at address 0x8 
 
Expected results: 
$1 = 0 
 
 
Additional info: 
This works on RHEL3, hence regression.

Comment 1 Jay Fenlason 2006-03-13 20:26:10 UTC
Created attachment 126068 [details]
source for simple test program

Comment 2 Jay Fenlason 2006-03-14 20:33:00 UTC
This is also broken in rawhide with gdb-6.3.0.0-1.122 

Comment 3 Jan Kratochvil 2006-07-25 12:30:21 UTC
Please retest if compiled with -ggdb3: gcc -o convert -ggdb3 convert.c
        -ggdb3  -ggdb2
FC5 gdb OK      Cannot find thread-local variables
CVS gdb OK      Cannot access memory at address 0x8
FC4 gdb OK      Cannot access memory at address 0x8

As it is fixed by on of the Red Hat vendor patches, suggesting to extend the
error message by: ", try gcc -ggdb3"


Comment 6 Jan Kratochvil 2006-08-25 09:49:12 UTC
Created attachment 134901 [details]
Access TLS symbols without DWARF debuginfo

Attached patch implements accessing TLS symbols without the debuginfo
suggestions as not always such associatet debuginfo is available.  It checks
for
	SYMBOL_BFD_SECTION (msymbol)->flags & SEC_THREAD_LOCAL
symbols, implements for them new `UNOP_MEMVAL_TLS' and reuses for them former
`dwarf_expr_tls_address'.

Comment 7 Jan Kratochvil 2006-08-25 09:50:38 UTC
Created attachment 134902 [details]
Ignore TLS symbols for non-TLS programs

IMO the right way is to ignore TLS symbols for inferiors without activated
threading.

Comment 8 Jan Kratochvil 2006-08-25 09:51:46 UTC
Created attachment 134903 [details]
Suggest how to resolve the missing "errno" symbol

Also attached suggestion patch how to deal with the most common "errno" symbol
for the most common under-ggdb3 compiled programs.

Comment 9 RHEL Program Management 2006-09-01 18:47:12 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 12 RHEL Program Management 2006-12-12 17:19:38 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being marked as a blocker for this release.  

Please resolve ASAP.

Comment 13 RHEL Program Management 2006-12-12 17:20:19 UTC
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being marked as a blocker for this release.  

Please resolve ASAP.

Comment 17 Red Hat Bugzilla 2007-05-01 17:22:31 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2007-0229.html



Note You need to log in before you can comment on or make changes to this bug.