This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug cli/11646] New: which a shared library is opened and closed


gdb version: 7.1, OS: Red Hat Enterprise Linux Client release 5.3 (Tikanga)
Reproduce steps:
1. build a shared library:
  source code (file shared.c):
  int add(int a, int b)
  {
     return a+b;
   } 
  gcc -m32 -fpic -shared shared.c -o libmyshared.so
2. build an executable
   source code (main.c)
  #include <stdio.h>
  #include <dlfcn.h>
  void openlibrary()
  {
     void *handle = dlopen("./libmyshared.so", RTLD_LAZY);
     if(handle!=NULL)
     {
       printf("open successully\n");
       dclose(handle);
     }
     else
     {
        fprintf(stderr, "%s\n", dlerror());

     }
  }

  int main()
  {
     return 0;
   }
  
  gcc -m32 -g main.c -ldl

3. launch the debugger by command "gdb a.out"
  then in the command line interface:
  1) input "b main", then type enter
  2) input "run", then type enter
  3) input "c openlibrary()", then type enter
  4) repeat step 3 at most 50 times, then the gdb terminates. This behavior is
unexpected.

Note: this bug doesn't exist in 6.8-27.el5

-- 
           Summary: which  a shared library is opened and closed
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P1
         Component: cli
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: pizhoupeter at hotmail dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11646

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]