Bug 135822 - gdb loops when application unloads library with breakpoint
Summary: gdb loops when application unloads library with breakpoint
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: gdb
Version: 3.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jeff Johnston
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2004-10-15 09:34 UTC by Göran Uddeborg
Modified: 2015-01-08 00:08 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2004-10-20 21:36:17 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:561 0 normal SHIPPED_LIVE Updated gdb and libunwind packages 2004-12-21 05:00:00 UTC

Description Göran Uddeborg 2004-10-15 09:34:02 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.4.3)
Gecko/20040924

Description of problem:
If you run an application which opens some library with dlopen(), puts
a breakpoint in the directory, and then the application closes the
library with dlclose(), gdb will start looping during the dlclose()
call the second time you run the application.

Version-Release number of selected component (if applicable):
gdb-6.1post-1.20040607.17

How reproducible:
Always

Steps to Reproduce:
1.Create a file main.c with this content:
#include <dlfcn.h>

int main()
{
  void *handle;
  if (handle = dlopen("./liblyra.so", RTLD_LAZY))
    dlclose(handle);
  return 0;
}

2.Create a file lyra.c with this content
void alfa() {}

3.cc -g -o main main.c -ldl
4.cc -g -o liblyra.so -shared lyra.c
5.gdb main
6.(The rest is in gdb)
  break dlclose
7.run
8.break alfa
9.cont
10.disable 2
11.run
12.enable 2
13.cont

Actual Results:  The last "cont" never returns, and gdb starts looping
with 100% CPU usage.

Expected Results:  The application should terminate, just like the
first time it was run.

Additional info:

This has been verified on i386 and x86_64 platforms.

Comment 1 Jeff Johnston 2004-10-20 21:36:17 UTC
This bug was fixed as part of bugzilla 128618 and the fix is found in
rh gdb as of version .27 and will be part of the next errata release
of gdb.  I have confirmed the problem is fixed and that the
application continues to termination as expected.

Comment 2 Göran Uddeborg 2004-10-22 06:37:40 UTC
Right, when I tried it now, I can't reproduce the problem on our
RHEL4T1 machine.  (With gdb-6.1post-1.20040607.28)

Comment 3 John Flanagan 2004-12-21 19:37:20 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/RHBA-2004-561.html



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