Bug 860696

Summary: GDB segfaults when stepping through a program
Product: Red Hat Developer Toolset Reporter: Marek Polacek <mpolacek>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Martin Cermak <mcermak>
Severity: high Docs Contact:
Priority: unspecified    
Version: DTS 1.1 RHEL 5CC: jan.kratochvil, mcermak, mfranc, mnewsome, pkovar
Target Milestone: beta2   
Target Release: 1.1   
Hardware: ppc64   
OS: Unspecified   
Whiteboard:
Fixed In Version: devtoolset-1.1-gdb-7.5.0.20120926-22.el5 Doc Type: Release Note
Doc Text:
No documentation needed
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-22 14:39:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marek Polacek 2012-09-26 13:57:25 UTC
# scl enable devtoolset-1.1 bash
# rpm -q devtoolset-1.1-gdb
devtoolset-1.1-gdb-7.5-20.el5
# gdb /bin/true -q -ex sta -ex 's 999999'
Reading symbols from /bin/true...Reading symbols from /usr/lib/debug/bin/true.debug...done.
done.
Temporary breakpoint 1 at 0x10000c38: file true.c, line 63.
Starting program: /bin/true 

Temporary breakpoint 1, main (argc=1, argv=0xffabf654) at true.c:63
63	  setlocale (LC_ALL, "");
Segmentation fault

When stepping manually:
(gdb) 
__ctype_b_loc () at ../include/ctype.h:34
34	  if (__builtin_expect (*u.tablep == NULL, 0))
(gdb) 
_nl_normalize_codeset (codeset=0xfff6fd2a "UTF-8", name_len=1) at l10nflist.c:341
341		if (isalpha ((unsigned char) codeset[cnt]))
(gdb) 
336	  for (cnt = 0; cnt < name_len; ++cnt)
(gdb) 
341		if (isalpha ((unsigned char) codeset[cnt]))
(gdb) 
336	  for (cnt = 0; cnt < name_len; ++cnt)
(gdb) 
345	  retval = (char *) malloc ((only_digit ? 3 : 0) + len + 1);
(gdb) 
Segmentation fault

With system gdb:

# gdb /bin/true -q -ex sta -ex 's 999999' -ex q
Reading symbols from /bin/true...Reading symbols from /usr/lib/debug/bin/true.debug...done.
done.
Temporary breakpoint 1 at 0x10000c38: file true.c, line 63.
Starting program: /bin/true 

Temporary breakpoint 1, main (argc=1, argv=0xffc2f8d4) at true.c:63
63	  setlocale (LC_ALL, "");

Program exited normally.

Seems this doesn't happen on RHEL6.

Comment 2 Jan Kratochvil 2012-09-26 16:59:52 UTC
[patch+7.5] Fix ppc32 7.5 stepping crash regression
http://sourceware.org/ml/gdb-patches/2012-09/msg00598.html

QA: New testfile: gdb.base/step-symless.exp

Comment 5 errata-xmlrpc 2013-01-22 14:39:32 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHEA-2013-0172.html