emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug out of memory situation?


From: Kai Großjohann
Subject: Re: How to debug out of memory situation?
Date: Mon, 09 Jun 2003 19:23:07 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

Richard Stallman <address@hidden> 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 <return> to continue, or q <return> 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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 <command_loop_1>,
    handlers=405583908, hfun=0x80d9a04 <cmd_error>) at eval.c:1333
#11 0x080d9cc8 in command_loop_2 () at keyboard.c:1292
#12 0x0812f1e5 in internal_catch (tag=405545156,
    func=0x80d9ca4 <command_loop_2>, 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.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]