Bug 1122916 - kernel build hangs in debugedit due to infinite loop
Summary: kernel build hangs in debugedit due to infinite loop
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: rpm
Version: 6.2
Hardware: x86_64
OS: Linux
Target Milestone: rc
: ---
Assignee: Packaging Maintenance Team
QA Contact: BaseOS QE Security Team
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-24 11:59 UTC by Maruthi Seshidhar Inukonda
Modified: 2016-03-21 15:40 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2016-01-05 12:14:08 UTC

Attachments (Terms of Use)

Description Maruthi Seshidhar Inukonda 2014-07-24 11:59:11 UTC
Description of problem:

Trying to build the stock kernel 2.6.32-220 src rpm on CentOS 6.2 x86_64.

The build process hangs for more than 12 hours.
This is stuck at debugedit.

Version-Release number of selected component (if applicable):

# uname -a
Linux aidkakinada 2.6.32-220.el6.x86_64 0000001 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/redhat-release
CentOS release 6.2 (Final)

# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 22G 14G 6.2G 70% /
tmpfs 1.9G 0 1.9G 0% /dev/shm
/dev/sda1 504M 43M 437M 9% /boot
/dev/sdb 9.9G 151M 9.2G 2% /root/rpmbuild

# rpm -qi rpm
Name : rpm Relocations: (not relocatable)
Version : 4.8.0 Vendor: CentOS
Release : 19.el6 Build Date: Thu 08 Dec 2011 03:04:07 AM IST
Install Date: Wed 20 Nov 2013 12:43:41 PM IST Build Host: c6b6.bsys.dev.centos.org
Group : System Environment/Base Source RPM: rpm-4.8.0-19.el6.src.rpm
Size : 2031079 License: GPLv2+
Signature : RSA/SHA1, Fri 09 Dec 2011 02:36:45 AM IST, Key ID 0946fca2c105b9de
Packager : CentOS BuildSystem <http://bugs.centos.org> [^]
URL : http://www.rpm.org/ [^]
Summary : The RPM package management system
Description :
The RPM Package Manager (RPM) is a powerful command line driven
package management system capable of installing, uninstalling,
verifying, querying, and updating software packages. Each software
package consists of an archive of files along with information about
the package like its version, a description, etc.
How reproducible:

Steps to Reproduce:

# rpm -ivh /tmp/kernel-2.6.32-220.el6.src.rpm
# cd /root/rpmbuild
# rpmbuild -ba SPECS/kernel.spec
+ /usr/lib/rpm/debugedit -b /root/rpmbuild/BUILD -d /usr/src/debug -i arch/x86/vdso/vdso.so.dbg
+ /usr/lib/rpm/debugedit -b /root/rpmbuild/BUILD -d /usr/src/debug -i arch/x86/vdso/vdso32-int80.so.dbg
+ /usr/lib/rpm/debugedit -b /root/rpmbuild/BUILD -d /usr/src/debug -i arch/x86/vdso/vdso32-syscall.so.dbg
+ /usr/lib/rpm/debugedit -b /root/rpmbuild/BUILD -d /usr/src/debug -i arch/x86/vdso/vdso32-sysenter.so.dbg

It was stuck for more than 12 hours.

Updated to rpm-4.8.1-37, The problem persists.

Actual results:
hang, 100% cpu consumption.

Expected results:

Additional info:
Also raised bug on Centos bug tracker. 

0007268: kernel build hangs in debugedit due to infinite loop

Comment 1 Maruthi Seshidhar Inukonda 2014-07-24 11:59:57 UTC
Stack trace with rpm-4.8.0-37 package and its corresponding debuginfo.

# gdb /usr/lib/rpm/debugedit
(gdb) attach 30842

(gdb) bt
#0 0x0000000000401c94 in canonicalize_path (s=0x7f6326fa6a5f "arch/x86/vdso", d=0x7f6326fa6a5f "arch/x86/vdso") at tools/debugedit.c:429
0000001 0x0000000000402552 in edit_dwarf2_line (dso=0x0, off=<value optimized out>, comp_dir=0xd <Address 0xd out of bounds>, phase=<value optimized out>) at tools/debugedit.c:659
0000002 0x0000000000402fbb in edit_attributes (dso=0xe66a70) at tools/debugedit.c:948
#3 edit_dwarf2 (dso=0xe66a70) at tools/debugedit.c:1260
#4 0x0000000000404748 in main (argc=<value optimized out>, argv=<value optimized out>) at tools/debugedit.c:1593

(gdb) l
424 }
425 }
426 else
427 {
428 while (*s && ! IS_DIR_SEPARATOR (*s))
429 *d++ = *s++;
430 }
432 if (IS_DIR_SEPARATOR (*s))
433 {

(gdb) p s
$5 = 0x7f6326fa6a5f "arch/x86/vdso"
(gdb) p d
$6 = 0x7f6326fa6a5f "arch/x86/vdso"

(gdb) p *s
$3 = 97 'a'
(gdb) p *d
$4 = 97 'a'

Comment 3 Ľuboš Kardoš 2014-07-30 15:48:17 UTC
I tried to reproduce it but I wasn't able to reproduce it on RHEL6.2 nor CentOS6.2. Building of kernel always finished successfully.

Did you try to do some steps in debuger in order to find that loop in which rpm spends so much time?

Comment 4 Maruthi Seshidhar Inukonda 2014-07-31 03:16:56 UTC
I'm able to see hang almost every time.
I'm not sure what is causing the issue to reproduce.

May be one of these are causing
a. If you noticed, /root/rpmbuild is a different file-system (ext3).
b. The system is a 4CPU Virtual Machine with 4GB of memory.
   I've a 32GB Ram, 8CPU system on which the issue is less likely to happen.

I just attached to the hung debugedit and saw stack trace, and 
the loop variables. Haven't tried any other commands in debugger.

Comment 5 Ľuboš Kardoš 2015-08-31 09:59:12 UTC
I also tried configuration described in comment 4 and I am still not able to reproduce this.

Comment 6 Ľuboš Kardoš 2015-12-02 09:58:46 UTC
Can you try this on rhel-6.7 if this is still problem?

Comment 7 Ľuboš Kardoš 2016-01-05 12:14:08 UTC
This is reported against rhel-6.2 and I didn't get answer if this is still problem with the newest version i.e. rhel-6.7. and I am not able to reproduce this with any version of rhel so I am closing this bug. You can reopen this bug if you are able to reproduce this on on rhel-6.7.

Comment 8 Maruthi Seshidhar Inukonda 2016-03-21 15:40:25 UTC
I tried on RHEL 6.7 and didnt notice this issue. Let us close this and we can reopen if problem recurs. Thanks.

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