From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: kai.grossjohann@gmx.net (=?iso-8859-1?q?Kai_Gro=DFjohann?=) Newsgroups: gmane.emacs.devel Subject: Re: How to debug out of memory situation? Date: Mon, 09 Jun 2003 19:23:07 +0200 Organization: University of Duisburg, Germany Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <84y90bmah0.fsf@lucy.is.informatik.uni-duisburg.de> References: <84n0h8l98r.fsf@lucy.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1055179671 2799 80.91.224.249 (9 Jun 2003 17:27:51 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 9 Jun 2003 17:27:51 +0000 (UTC) Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Mon Jun 09 19:27:48 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19PQOv-0000Yq-00 for ; Mon, 09 Jun 2003 19:25:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 19PQj1-0000Lm-00 for ; Mon, 09 Jun 2003 19:46:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19PQQZ-0004jw-1a for emacs-devel@quimby.gnus.org; Mon, 09 Jun 2003 13:27:27 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19PQPw-0004Ur-W6 for emacs-devel@gnu.org; Mon, 09 Jun 2003 13:26:48 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19PQPi-0004K0-LG for emacs-devel@gnu.org; Mon, 09 Jun 2003 13:26:36 -0400 Original-Received: from main.gmane.org ([80.91.224.249]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19PQPQ-0003oc-DZ for emacs-devel@gnu.org; Mon, 09 Jun 2003 13:26:16 -0400 Original-Received: from list by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19PQME-0000Kl-00 for ; Mon, 09 Jun 2003 19:22:58 +0200 Mail-Followup-To: emacs-devel@gnu.org X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Received: from news by main.gmane.org with local (Exim 3.35 #1 (Debian)) id 19PQKV-0000Bc-00 for ; Mon, 09 Jun 2003 19:21:11 +0200 Original-Lines: 412 Original-X-Complaints-To: usenet@main.gmane.org Mail-Copies-To: never User-Agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:tnxeB1ZNbuFcHG04FT5Rwjb8I7k= X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:14962 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:14962 Richard Stallman writes: > If you put a breakpoint in memory_full, you will be able to make a > backtrace. If Emacs is continuing to use memory for a certain purpose > and ran out while trying to do more of that, you should see within a > few cases what the pattern is. I tried this a couple of times but couldn't really find anything. Now I tried it again and this time, I at least got some backtraces. They were not so interesting, I'm afraid :-/ Here is the first time it happened: (Search for CCC to find the end of the gdb output.) Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=48, type=MEM_TYPE_VECTOR) at alloc.c:615 #2 0x0811c590 in allocate_vectorlike (len=10, type=MEM_TYPE_VECTOR) at alloc.c:2253 #3 0x0811c5e5 in allocate_vector (nslots=10) at alloc.c:2276 #4 0x0811c73e in Fmake_vector (length=10, init=405487172) at alloc.c:2372 #5 0x0811c88e in Fvector (nargs=10, args=0xbfffd8c8) at alloc.c:2437 #6 0x08131016 in Ffuncall (nargs=11, args=0xbfffd8c4) at eval.c:2705 #7 0x0815842c in Fbyte_code (bytestr=942873532, vector=1221889640, maxdepth=16) at bytecode.c:710 #8 0x08130724 in Feval (form=1489062228) at eval.c:2084 #9 0x0812f57d in Fcondition_case (args=1525038380) at eval.c:1280 #10 0x081588ca in Fbyte_code (bytestr=945883100, vector=1221890072, maxdepth=8) at bytecode.c:891 #11 0x081315d1 in funcall_lambda (fun=1221890304, nargs=4, arg_vector=0xbfffdc48) at eval.c:2911 #12 0x08131191 in Ffuncall (nargs=5, args=0xbfffdc44) at eval.c:2781 #13 0x0815842c in Fbyte_code (bytestr=955457068, vector=1223899728, maxdepth=19) at bytecode.c:710 #14 0x081315d1 in funcall_lambda (fun=1223900240, nargs=2, arg_vector=0xbfffdd34) at eval.c:2911 #15 0x081312d4 in apply_lambda (fun=1223900240, args=1492329948, eval_flag=1) at eval.c:2833 #16 0x0813088e in Feval (form=1492329940) at eval.c:2136 #17 0x0812f57d in Fcondition_case (args=1538322764) at eval.c:1280 #18 0x081588ca in Fbyte_code (bytestr=955456908, vector=1223897312, maxdepth=5) at bytecode.c:891 #19 0x081315d1 in funcall_lambda (fun=1223897552, nargs=0, arg_vector=0xbfffe0a8) at eval.c:2911 #20 0x08131191 in Ffuncall (nargs=1, args=0xbfffe0a4) at eval.c:2781 ---Type to continue, or q to quit---q Quit (gdb) xbacktrace "vector" "byte-code" "gnus-get-newsgroup-headers-xover" "gnus-agent-fetch-group-1" "gnus-agent-fetch-session" "call-interactively" CCC Okay, so the function is gnus-get-newsgroup-headers-xover. I then continue. (gdb) cont Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace "expand-file-name" "apply" "jka-compr-run-real-handler" "jka-compr-handler" "debug" "byte-code" "gnus-get-newsgroup-headers-xover" "gnus-agent-fetch-group-1" "gnus-agent-fetch-session" "call-interactively" CCC Still gnus-get-newsgroup-headers-xover, it seems. But from now on, it gets less interesting really fast. (No more text until end of this message -- just gdb output.) I really feel I'm fishing in muddy waters and I have no idea what I can do. There are probably ways to find out more, but I don't know them. Help? (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace "format" "byte-code" "gnus-agent-fetch-session" "call-interactively" (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace (gdb) xbacktrace (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) xbacktrace (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) xbacktrace (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) where #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) wh wh whatis where while while-stepping (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) c Continuing. Breakpoint 3, memory_full () at alloc.c:464 464 bytes_used_when_full = BYTES_USED; (gdb) bt #0 memory_full () at alloc.c:464 #1 0x0811b3cd in lisp_malloc (nbytes=1012, type=MEM_TYPE_STRING) at alloc.c:615 #2 0x0811b88b in allocate_string () at alloc.c:1321 #3 0x0811c0dd in make_uninit_multibyte_string (nchars=9, nbytes=9) at alloc.c:1895 #4 0x0811c0ab in make_uninit_string (length=9) at alloc.c:1876 #5 0x0811bf50 in make_unibyte_string (contents=0x8184da0 "emergency", length=9) at alloc.c:1790 #6 0x0811bf22 in make_string (contents=0x8184da0 "emergency", nbytes=9) at alloc.c:1775 #7 0x081461bf in intern (str=0x8184da0 "emergency") at lread.c:3092 #8 0x0811b0b3 in display_malloc_warning () at alloc.c:441 #9 0x080d9fb5 in command_loop_1 () at keyboard.c:1443 #10 0x0812f66d in internal_condition_case (bfun=0x80d9e00 , handlers=405583908, hfun=0x80d9a04 ) at eval.c:1333 #11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292 #12 0x0812f1e5 in internal_catch (tag=405545156, func=0x80d9ca4 , arg=405487172) at eval.c:1094 #13 0x080d9c73 in command_loop () at keyboard.c:1271 #14 0x080d97c8 in recursive_edit_1 () at keyboard.c:987 #15 0x080d98f0 in Frecursive_edit () at keyboard.c:1043 #16 0x080d8773 in main (argc=3, argv=0xbfffe824) at emacs.c:1666 (gdb) xbacktrace (gdb) xbacktrace -- This line is not blank.