[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
better backtrace for emacs
From: |
Marcus Brinkmann |
Subject: |
better backtrace for emacs |
Date: |
Mon, 29 Apr 2002 13:49:58 -0400 |
User-agent: |
Mutt/1.3.25i |
Hi,
here is a much better backtrace, with debugging symbols.
More importantly, I have went through both glibc in parallel,
in two debugging sessions, and found the place where it differs.
In the working version:
0x0816db9f 70 cp = (char *) (*real_morecore) (0);
1: x/i $eip 0x816db9f <check_memory_limits+55>: call *%eax
(gdb)
__default_morecore (increment=422313983) at ../sysdeps/generic/morecore.c:46
46 ../sysdeps/generic/morecore.c: No such file or directory.
in ../sysdeps/generic/morecore.c
1: x/i $eip 0x1377d14 <__default_morecore>: push %ebp
(gdb)
0x01377d15 46 in ../sysdeps/generic/morecore.c
1: x/i $eip 0x1377d15 <__default_morecore+1>: mov %esp,%ebp
etc.
But in the non-working version:
0x0816db9f 70 cp = (char *) (*real_morecore) (0);
2: x/i $eip 0x816db9f <check_memory_limits+55>: call *%eax
(gdb)
0x01377d14 in free_atfork (mem=0x192bffff, caller=0x83e8ec0) at malloc.c:4885
4885 malloc.c: No such file or directory.
in malloc.c
2: x/i $eip 0x1377d14 <free_atfork+168>:
je 0x1377d30 <free_atfork+196>
etc. So, obviously, the "real_morecore" variable contains a bogus value
in emacs. It turns out that the value seems to be hard coded in the
binary. Setting real_morecore to __default_morecore in
realloc_glyph_pool made it work!
__morecore had the correct value of __default_morecore.
I set a break point at r_alloc_reinit but it was not called before
it segfaults. So maybe it is not called early enough? Mmh, this malloc
mangling is still pretty obscure to me. Do I have enough info for the
emacs people (or do you know a fix)?
#0 0x012f7ba8 in strfnames () from /root/debug/libc.so.0.3
#1 0x01377d2d in free_atfork (mem=0x192bffff, caller=0x83e8ec0)
at ../mach/lock-intern.h:86
#2 0x013752e6 in chunk_alloc (ar_ptr=0x1442540, nb=40008) at malloc.c:2593
#3 0x01374c7a in __libc_malloc (bytes=40000) at malloc.c:2810
#4 0x0811a60c in emacs_blocked_malloc (size=40000) at alloc.c:737
#5 0x01374bed in __libc_malloc (bytes=40000) at malloc.c:2797
#6 0x0811a27f in xmalloc (size=40000) at alloc.c:520
#7 0x080508ad in realloc_glyph_pool (pool=0x83a6b40, matrix_dim=
{width = 80, height = 25}) at dispnew.c:1628
#8 0x080511ac in adjust_frame_glyphs_for_frame_redisplay
(f=0x8290a40) at dispnew.c:1628
#9 0x08050e66 in adjust_frame_glyphs (f=0x8290a40) at dispnew.c:2141
#10 0x08050e30 in adjust_frame_glyphs_initially () at dispnew.c:2127
#11 0x08057742 in init_display () at dispnew.c:6537
#12 0x080d5ed5 in main (argc=3, argv=0x1023c00, envp=0x1023c10) at emacs.c:1448
#13 0x0131ddb6 in __libc_start_main (main=0x80d5744 <main>, argc=3,
ubp_av=0x1023c00, init=0x804d6d0 <_init>, fini=0x81739f8 <_fini>,
rtld_fini=0xb440 <_dl_fini>, stack_end=0x1023bfc)
at ../sysdeps/generic/libc-start.c:129
eax 0x2a410 173072
ecx 0xcccccccd -858993459
edx 0x0 0
ebx 0xccccccc 214748364
esp 0x1023938 0x1023938
ebp 0x1023978 0x1023978
esi 0x2a000 172032
edi 0x8417000 138506240
eip 0x12f7ba8 0x12f7ba8
eflags 0x10202 66050
cs 0x17 23
ss 0x1f 31
ds 0x1f 31
es 0x1f 31
fs 0x1f 31
gs 0x1f 31
fctrl 0x0 0
fstat 0x0 0
ftag 0x0 0
fiseg 0x0 0
fioff 0x0 0
foseg 0x0 0
fooff 0x0 0
fop 0x0 0
(gdb) x/20i $pc
0x12f7ba8 <strfnames+113512>: jmp *0x464(%ebx)
0x12f7bae <strfnames+113518>: push $0x8b0
0x12f7bb3 <strfnames+113523>: jmp 0x12f6a38 <strfnames+109048>
0x12f7bb8 <strfnames+113528>: jmp *0x468(%ebx)
0x12f7bbe <strfnames+113534>: push $0x8b8
0x12f7bc3 <strfnames+113539>: jmp 0x12f6a38 <strfnames+109048>
0x12f7bc8 <strfnames+113544>: jmp *0x46c(%ebx)
etc
- better backtrace for emacs,
Marcus Brinkmann <=