home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / gdb / bug / 1047 < prev    next >
Encoding:
Text File  |  1992-09-14  |  6.7 KB  |  183 lines

  1. Newsgroups: gnu.gdb.bug
  2. Path: sparky!uunet!cis.ohio-state.edu!idt.unit.no!Anund.Lie
  3. From: Anund.Lie@idt.unit.no (Anund Lie)
  4. Subject: GDB 4.6 (SPARC, SunOS 4.1.2) forgets to close file descriptors
  5. Message-ID: <199209141238.AA27738@loke.idt.unit.no>
  6. Sender: gnulists@ai.mit.edu
  7. Organization: GNUs Not Usenet
  8. Distribution: gnu
  9. Date: Mon, 14 Sep 1992 16:38:55 GMT
  10. Approved: bug-gdb@prep.ai.mit.edu
  11. Lines: 170
  12.  
  13. GDB 4.6 forgets to close file descriptors in certain cases when the
  14. "file" command is used to switch executable files.  After a number of
  15. iterations the process runs out of file descriptors and hangs.  The
  16. case where this happens seems to be when the program is dynamically
  17. linked and the file command is used when the program is active.  In
  18. the example below, it seems to be the two dynamic libraries which are
  19. opened once more for each iteration.
  20.  
  21. Anund Lie
  22. Department of Computer Systems and Telematics 
  23. Norwegian Inst. of Technology, N-7034 Trondheim, Norway
  24. Email: Anund.Lie@idt.unit.no       (Internet)
  25.  
  26.  
  27. ------------------------------------------------------------------------
  28. villtind% cat t.c
  29. int
  30. main(argc,argv)
  31. int argc;
  32. char *argv[];
  33. {
  34.     return argc;
  35. }
  36. villtind% gcc -g -o t t.c
  37. villtind% gdb t
  38. GDB is free software and you are welcome to distribute copies of it
  39.  under certain conditions; type "show copying" to see the conditions.
  40. There is absolutely no warranty for GDB; type "show warranty" for details.
  41. GDB 4.6, Copyright 1992 Free Software Foundation, Inc...
  42. (gdb) b main
  43. Breakpoint 1 at 0x22a4: file t.c, line 6.
  44. (gdb) run
  45. Starting program: /a/villtind/home/villtind/anund/t 
  46.  
  47. Breakpoint 1, main (argc=1, argv=0xf7fffbd4) at t.c:6
  48. 6        return argc;
  49. (gdb) 
  50. Stopped
  51. villtind% ls -li t t.c /usr/lib/libc.so.* /usr/lib/libdl.so.* /local/bin/gdb
  52.  34345 -rwxr-xr-x  1 anund     2801664 Aug 12 15:02 /local/bin/gdb*
  53.  31875 -rwxr-xr--  1 root       516096 May  7 00:38 /usr/lib/libc.so.1.7*
  54.  31804 -rwxr-xr-x  1 root        24576 Oct 11  1990 /usr/lib/libdl.so.1.0*
  55.  71588 -rwxr-xr-x  1 anund       24576 Sep 14 14:13 t*
  56.  71576 -rw-r--r--  1 anund          65 Sep 14 14:12 t.c
  57. villtind% ps ax | egrep gdb
  58. 18170 p4 T     0:00 gdb t
  59. 18180 p4 S     0:00 egrep gdb
  60. villtind% ofiles 18170
  61. user     process command
  62. anund    18170     gdb               
  63.  cwd    = directory inode 71559 on local fs 707 (/a/villtind/home/villtind)
  64.  fd #0  = character special device /dev/ttyp4
  65.  fd #1  = character special device /dev/ttyp4
  66.  fd #2  = character special device /dev/ttyp4
  67.  fd #3  = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  68.  fd #4  = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  69.  fd #5  = file inode 31875 on local fs 706 (/usr)
  70.  fd #6  = file inode 31875 on local fs 706 (/usr)
  71.  fd #7  = file inode 31804 on local fs 706 (/usr)
  72.  fd #8  = file inode 31804 on local fs 706 (/usr)
  73.  mmap   = file inode 34345 on nfs fs 33280 (/local)
  74.  mmap   = file inode 31804 on local fs 706 (/usr)
  75.  mmap   = file inode 31804 on local fs 706 (/usr)
  76.  mmap   = file inode 31875 on local fs 706 (/usr)
  77. villtind% %gdb
  78. gdb t
  79. (gdb) file t
  80. A program is being debugged already.  Kill it? (y or n) y
  81. Load new symbol table from "t"? (y or n) y
  82. Reading symbols from t...
  83. Breakpoint 1 at 0x22a4: file t.c, line 6.
  84. done.
  85. (gdb) run
  86. Starting program: /a/villtind/home/villtind/anund/t 
  87.  
  88. Breakpoint 1, main (argc=1, argv=0xf7fffbd4) at t.c:6
  89. 6        return argc;
  90. (gdb) 
  91. Stopped
  92. villtind% jobs
  93. [1]  + Stopped              gdb t
  94. villtind% !ofi
  95. ofiles 18170
  96. user     process command
  97. anund    18170     gdb               
  98.  cwd    = directory inode 71559 on local fs 707 (/a/villtind/home/villtind)
  99.  fd #0  = character special device /dev/ttyp4
  100.  fd #1  = character special device /dev/ttyp4
  101.  fd #2  = character special device /dev/ttyp4
  102.  fd #3  = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  103.  fd #4  = file inode 31875 on local fs 706 (/usr)
  104.  fd #5  = file inode 31875 on local fs 706 (/usr)
  105.  fd #6  = file inode 31875 on local fs 706 (/usr)
  106.  fd #7  = file inode 31804 on local fs 706 (/usr)
  107.  fd #8  = file inode 31804 on local fs 706 (/usr)
  108.  fd #9  = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  109.  fd #10 = file inode 31804 on local fs 706 (/usr)
  110.  mmap   = file inode 34345 on nfs fs 33280 (/local)
  111. villtind% %gdb
  112. gdb t
  113. (gdb) file t
  114. A program is being debugged already.  Kill it? (y or n) y
  115. Load new symbol table from "t"? (y or n) y
  116. Reading symbols from t...
  117. Breakpoint 1 at 0x22a4: file t.c, line 6.
  118. done.
  119. (gdb) run
  120. Starting program: /a/villtind/home/villtind/anund/t 
  121.  
  122. Breakpoint 1, main (argc=1, argv=0xf7fffbd4) at t.c:6
  123. 6        return argc;
  124. (gdb) 
  125. Stopped
  126. villtind% !ofi
  127. ofiles 18170
  128. user     process command
  129. anund    18170     gdb               
  130.  cwd    = directory inode 71559 on local fs 707 (/a/villtind/home/villtind)
  131.  fd #0  = character special device /dev/ttyp4
  132.  fd #1  = character special device /dev/ttyp4
  133.  fd #2  = character special device /dev/ttyp4
  134.  fd #3  = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  135.  fd #4  = file inode 31875 on local fs 706 (/usr)
  136.  fd #5  = file inode 31875 on local fs 706 (/usr)
  137.  fd #6  = file inode 31875 on local fs 706 (/usr)
  138.  fd #7  = file inode 31875 on local fs 706 (/usr)
  139.  fd #8  = file inode 31804 on local fs 706 (/usr)
  140.  fd #9  = file inode 31804 on local fs 706 (/usr)
  141.  fd #10 = file inode 31804 on local fs 706 (/usr)
  142.  fd #11 = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  143.  fd #12 = file inode 31804 on local fs 706 (/usr)
  144.  mmap   = file inode 34345 on nfs fs 33280 (/local)
  145. villtind% %gdb
  146. gdb t
  147. (gdb) file t
  148. A program is being debugged already.  Kill it? (y or n) y
  149. Load new symbol table from "t"? (y or n) y
  150. Reading symbols from t...
  151. Breakpoint 1 at 0x22a4: file t.c, line 6.
  152. done.
  153. (gdb) run
  154. Starting program: /a/villtind/home/villtind/anund/t 
  155.  
  156. Breakpoint 1, main (argc=1, argv=0xf7fffbd4) at t.c:6
  157. 6        return argc;
  158. (gdb) 
  159. Stopped
  160. villtind% !ofi
  161. ofiles 18170
  162. user     process command
  163. anund    18170     gdb               
  164.  cwd    = directory inode 71559 on local fs 707 (/a/villtind/home/villtind)
  165.  fd #0  = character special device /dev/ttyp4
  166.  fd #1  = character special device /dev/ttyp4
  167.  fd #2  = character special device /dev/ttyp4
  168.  fd #3  = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  169.  fd #4  = file inode 31875 on local fs 706 (/usr)
  170.  fd #5  = file inode 31875 on local fs 706 (/usr)
  171.  fd #6  = file inode 31875 on local fs 706 (/usr)
  172.  fd #7  = file inode 31875 on local fs 706 (/usr)
  173.  fd #8  = file inode 31804 on local fs 706 (/usr)
  174.  fd #9  = file inode 31875 on local fs 706 (/usr)
  175.  fd #10 = file inode 31804 on local fs 706 (/usr)
  176.  fd #11 = file inode 31804 on local fs 706 (/usr)
  177.  fd #12 = file inode 31804 on local fs 706 (/usr)
  178.  fd #13 = file inode 71588 on local fs 707 (/a/villtind/home/villtind)
  179.  fd #14 = file inode 31804 on local fs 706 (/usr)
  180.  mmap   = file inode 34345 on nfs fs 33280 (/local)
  181. villtind% 
  182.  
  183.