<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
 
<br>Hey Castor,
<p>This also looks good on ppc64.
<p>I'm slowly convincing myself that that this facility should be
<br>executed by default -- but with an option to turn it *off*...   
;-)
<p>Dave
<br> 
<p>Castor Fu wrote:
<blockquote TYPE=CITE> 
<div dir="ltr"><span class=592120220-17012007><font face="Arial"><font color="#0000FF"><font size=-1>Finding
the overrun wasn't actually that hard.  It's also fixed in the current
GDB tree.</font></font></font></span></div>

<div dir="ltr"><span class=592120220-17012007></span></div>

<div dir="ltr"><span class=592120220-17012007><font face="Arial"><font color="#0000FF"><font size=-1>I've
attached a patch which fixes the problem in symfile.c.  The point
of this patch</font></font></font></span></div>

<div dir="ltr"><span class=592120220-17012007><font face="Arial"><font color="#0000FF"><font size=-1>is
to fix loading kernel modules symbol information on 2.6 for those who have
not</font></font></font></span></div>

<div dir="ltr"><span class=592120220-17012007><font face="Arial"><font color="#0000FF"><font size=-1>been
following this.</font></font></font></span></div>

<div dir="ltr"><span class=592120220-17012007></span></div>

<div dir="ltr"><span class=592120220-17012007><font face="Arial"><font color="#0000FF"><font size=-1>Hopefully
this will work on other platforms too....</font></font></font></span></div>

<div dir="ltr"><span class=592120220-17012007></span></div>

<div dir="ltr"><span class=592120220-17012007><font face="Arial"><font color="#0000FF"><font size=-1>  
-castor</font></font></font></span></div>

<div dir="ltr"><span class=592120220-17012007></span></div>

<div dir="ltr"><span class=592120220-17012007></span></div>

<div dir="ltr">
<hr tabIndex=-1></div>

<div dir="ltr"><font face="Tahoma"><font size=-1><b>From:</b> crash-utility-bounces@redhat.com
[<A HREF="mailto:crash-utility-bounces@redhat.com">mailto:crash-utility-bounces@redhat.com</A>] <b>On Behalf Of </b>Castor Fu</font></font>
<br><font face="Tahoma"><font size=-1><b>Sent:</b> Wednesday, January 17,
2007 7:49 AM</font></font>
<br><font face="Tahoma"><font size=-1><b>To:</b> Discussion list for crash
utility usage, maintenance and development; Discussion list for crash utility
usage, maintenance and development</font></font>
<br><font face="Tahoma"><font size=-1><b>Subject:</b> RE: [Crash-utility]
test results of latest 4.0-3.16.sym.patch (ia64)</font></font>
<br> </div>
<!-- Converted from text/plain format -->
<p><font size=-1>Hi Dave:</font>
<p><font size=-1>I reproduced the problem on an x86 system by creating
a module with a bunch</font>
<br><font size=-1>of sections.</font>
<p><font size=-1>I then found the following in gdb-6.1/gdb/symfile.c:add_symbol_table_command()</font>
<br> 
<p><font size=-1>    num_sec_opts = 16;</font>
<p><font size=-1>with additional code for xreallocing if it turned out
to have too many</font>
<br><font size=-1>sections.</font>
<p><font size=-1>This seems to be the code which is broken.  I'm loath
to figure out exactly</font>
<br><font size=-1>what it is...  I'll put together a patch against
4.0-3.17 which jacks this</font>
<br><font size=-1>up, and probably print a warning if we exceed the count.</font>
<p><font size=-1>Thanks for digging so far into this.</font>
<p><font size=-1>   -castor</font>
<p><font size=-1>-----Original Message-----</font>
<br><font size=-1>From: crash-utility-bounces@redhat.com on behalf of Dave
Anderson</font>
<br><font size=-1>Sent: Thu 1/4/2007 8:22 AM</font>
<br><font size=-1>To: Discussion list for crash utility usage, maintenance
and development</font>
<br><font size=-1>Subject: Re: [Crash-utility] test results of latest 4.0-3.16.sym.patch
(ia64)</font>
<br> 
<p><font size=-1>Hi Castor,</font>
<p><font size=-1>Another FYI re: the xrealloc() crash.  The problem
appears</font>
<br><font size=-1>to be specific to gdb.</font>
<p><font size=-1>I captured the "add-symbol-file" command string and saved</font>
<br><font size=-1>it in an input file.  Then I brought crash up and
executed</font>
<br><font size=-1>the input file, which simply passes the suspect command
line</font>
<br><font size=-1>directly to gdb, and it crashes on its own:</font>
<p><font size=-1>crash> < /tmp/junk</font>
<br><font size=-1>crash> add-symbol-file /lib/modules/2.6.18-1.2767.el5/kernel/net/ipv6/ipv6.ko
0xa00000021ed605b0 -s .exit.text 0xa00000021edb49a0 -s .rodata 0xa00000021edbd4c8
-s __ksymtab_strings 0xa00000021edbdc08 -s __versions 0xa00000021edbdf98
-s .data 0xa00000021edd6a20 -s .data.rel.ro 0xa00000021edd6c00 -s __ksymtab_gpl
0xa00000021edd6df8 -s __kcrctab_gpl 0xa00000021edd6ed8 -s .data.rel 0xa00000021edd6f48
-s .data.rel.local 0xa00000021ee39940 -s .data.rel.ro.local 0xa00000021ee3a9c0
-s .data.read_mostly 0xa00000021ee3a9e0 -s __ksymtab 0xa00000021ee3aa60
-s __kcrctab 0xa00000021ee3ac30 -s .gnu.linkonce.this_module 0xa00000021ee3ad80
-s .sdata 0xa00000021ee5d730 -s .bss 0xa00000021ee5b000 -s .sbss 0xa00000021ee5e8b8</font>
<br><font size=-1>add_symbol_file_command: calling xrealloc w/argcnt: 49
arg: [0xa00000021ee5d730]...</font>
<br><font size=-1>*** glibc detected *** ./crash: realloc(): invalid next
size: 0x6000000001921fe0 ***</font>
<br><font size=-1>======= Backtrace: =========</font>
<br><font size=-1>/lib/libc.so.6.1[0x20000000002f2a70]</font>
<br><font size=-1>/lib/libc.so.6.1(realloc-0x1cb0b0)[0x20000000002f5e20]</font>
<br><font size=-1>./crash(xmrealloc+0x1fffffffffee6e20)[0x40000000003a7d00]</font>
<br><font size=-1>./crash[0x40000000002ff500]</font>
<br><font size=-1>./crash[0x40000000004221e0]</font>
<br><font size=-1>./crash(cmd_func+0x1ffffffffff61610)[0x4000000000422500]</font>
<br><font size=-1>./crash(execute_command+0x1fffffffffee25f0)[0x40000000003a34f0]</font>
<br><font size=-1>./crash(gdb_command_funnel+0x1fffffffffe2feb0)[0x40000000002f0dc0]</font>
<br><font size=-1>./crash(gdb_interface+0x1fffffffffcd7590)[0x40000000001984b0]</font>
<br><font size=-1>./crash(gdb_pass_through+0x1fffffffffcd6cb0)[0x4000000000197be0]</font>
<br><font size=-1>./crash(cmd_gdb+0x2000000000151068)[0x400000000019bbc0]</font>
<br><font size=-1>./crash(exec_command+0x1fffffffffb99db0)[0x400000000005acf0]</font>
<br><font size=-1>./crash(exec_input_file+0x1fffffffffd86d40)[0x4000000000247c90]</font>
<br><font size=-1>./crash[0x400000000005b420]</font>
<br><font size=-1>./crash(exec_command+0x1fffffffffb99e50)[0x400000000005ad90]</font>
<br><font size=-1>./crash(main_loop+0x1fffffffffb9a2e0)[0x400000000005a8e0]</font>
<br><font size=-1>./crash(current_interp_command_loop+0x200000000001fd60)[0x40000000004e0cc0]</font>
<br><font size=-1>./crash[0x40000000003199c0]</font>
<br><font size=-1>./crash[0x400000000039f370]</font>
<br><font size=-1>./crash[0x40000000003a4260]</font>
<br><font size=-1>./crash(catch_errors+0x1fffffffffee33b0)[0x40000000003a4320]</font>
<br><font size=-1>./crash[0x400000000031a930]</font>
<br><font size=-1>./crash[0x400000000039f370]</font>
<br><font size=-1>./crash[0x40000000003a4260]</font>
<br><font size=-1>./crash(catch_errors+0x1fffffffffee33b0)[0x40000000003a4320]</font>
<br><font size=-1>./crash(gdb_main+0x1fffffffffe58960)[0x40000000003198e0]</font>
<br><font size=-1>./crash(gdb_main_entry+0x1fffffffffe589f0)[0x4000000000319980]</font>
<br><font size=-1>./crash(gdb_main_loop+0x1fffffffffcd54d0)[0x4000000000196470]</font>
<br><font size=-1>./crash(main+0x1fffffffffb99820)[0x400000000005a330]</font>
<br><font size=-1>/lib/libc.so.6.1(__libc_start_main-0x2818f0)[0x200000000023f6c0]</font>
<br><font size=-1>./crash(_start+0x1fffffffffb95240)[0x4000000000056200]</font>
<br><font size=-1>======= Memory map: ========</font>
<br><font size=-1>00000000-00004000 r--p 00000000 00:00 0</font>
<br><font size=-1>2000000000000000-2000000000038000 r-xp 00000000 fd:00
10256390           /lib/ld-2.5.so</font>
<br><font size=-1>2000000000044000-2000000000050000 rw-p 00034000 fd:00
10256390           /lib/ld-2.5.so</font>
<br><font size=-1>2000000000050000-2000000000114000 r-xp 00000000 fd:00
10256405           /lib/libm-2.5.so</font>
<br><font size=-1>2000000000114000-2000000000120000 ---p 000c4000 fd:00
10256405           /lib/libm-2.5.so</font>
<br><font size=-1>2000000000120000-2000000000124000 rw-p 000c0000 fd:00
10256405           /lib/libm-2.5.so</font>
<br><font size=-1>2000000000124000-20000000001b0000 r-xp 00000000 fd:00
10883077           /usr/lib/libncurses.so.5.5</font>
<br><font size=-1>20000000001b0000-20000000001bc000 ---p 0008c000 fd:00
10883077           /usr/lib/libncurses.so.5.5</font>
<br><font size=-1>20000000001bc000-20000000001cc000 rw-p 00088000 fd:00
10883077           /usr/lib/libncurses.so.5.5</font>
<br><font size=-1>20000000001cc000-20000000001d0000 rw-p 20000000001cc000
00:00 0</font>
<br><font size=-1>20000000001d0000-20000000001d8000 r-xp 00000000 fd:00
10256403           /lib/libdl-2.5.so</font>
<br><font size=-1>20000000001d8000-20000000001e4000 ---p 00008000 fd:00
10256403           /lib/libdl-2.5.so</font>
<br><font size=-1>20000000001e4000-20000000001e8000 rw-p 00004000 fd:00
10256403           /lib/libdl-2.5.so</font>
<br><font size=-1>20000000001e8000-200000000020c000 r-xp 00000000 fd:00
10882711           /usr/lib/libz.so.1.2.3</font>
<br><font size=-1>200000000020c000-2000000000218000 ---p 00024000 fd:00
10882711           /usr/lib/libz.so.1.2.3</font>
<br><font size=-1>2000000000218000-200000000021c000 rw-p 00020000 fd:00
10882711           /usr/lib/libz.so.1.2.3</font>
<br><font size=-1>200000000021c000-2000000000480000 r-xp 00000000 fd:00
10256397           /lib/libc-2.5.so</font>
<br><font size=-1>2000000000480000-200000000048c000 ---p 00264000 fd:00
10256397           /lib/libc-2.5.so</font>
<br><font size=-1>200000000048c000-2000000000498000 rw-p 00260000 fd:00
10256397           /lib/libc-2.5.so</font>
<br><font size=-1>2000000000498000-20000000004d8000 rw-p 2000000000498000
00:00 0</font>
<br><font size=-1>20000000004d8000-2000000003c1c000 r--p 00000000 fd:00
10882710           /usr/lib/locale/locale-archive</font>
<br><font size=-1>2000000003c1c000-2000000003c2c000 rw-p 2000000003c1c000
00:00 0</font>
<br><font size=-1>2000000003c38000-2000000003c44000 r-xp 00000000 fd:00
10256427           /lib/libthread_db-1.0.so</font>
<br><font size=-1>2000000003c44000-2000000003c50000 ---p 0000c000 fd:00
10256427           /lib/libthread_db-1.0.so</font>
<br><font size=-1>2000000003c50000-2000000003c54000 rw-p 00008000 fd:00
10256427           /lib/libthread_db-1.0.so</font>
<br><font size=-1>2000000003c54000-2000000003c58000 rw-p 2000000003c54000
00:00 0</font>
<br><font size=-1>2000000003c6c000-2000000003da0000 rw-p 2000000003c6c000
00:00 0</font>
<br><font size=-1>2000000003da0000-2000000003dbc000 r-xp 00000000 fd:00
10884674           /usr/lib/libunwind.so.7.0.0</font>
<br><font size=-1>2000000003dbc000-2000000003dc8000 ---p 0001c000 fd:00
10884674           /usr/lib/libunwind.so.7.0.0</font>
<br><font size=-1>2000000003dc8000-2000000003dcc000 rw-p 00018000 fd:00
10884674           /usr/lib/libunwind.so.7.0.0</font>
<br><font size=-1>2000000003dcc000-2000000003df0000 rw-p 2000000003dcc000
00:00 0</font>
<br><font size=-1>2000000003e00000-2000000003e08000 r--s 00000000 fd:00
10977539           /usr/lib/gconv/gconv-modules.cache</font>
<br><font size=-1>2000000003e08000-2000000003e18000 rw-p 2000000003e08000
00:00 0</font>
<br><font size=-1>2000000003e1c000-2000000006edc000 rw-p 2000000003e1c000
00:00 0</font>
<br><font size=-1>2000000006ee8000-2000000006f04000 r-xp 00000000 fd:00
10256386           /lib/libgcc_s-4.1.1-20061130.so.1</font>
<br><font size=-1>2000000006f04000-2000000006f10000 ---p 0001c000 fd:00
10256386           /lib/libgcc_s-4.1.1-20061130.so.1</font>
<br><font size=-1>2000000006f10000-2000000006f14000 rw-p 00018000 fd:00
10256386           /lib/libgcc_s-4.1.1-20061130.so.1</font>
<br><font size=-1>2000000006f14000-2000000006f24000 rw-p 2000000006f14000
00:00 0</font>
<br><font size=-1>2000000008000000-2000000008024000 rw-p 2000000008000000
00:00 0</font>
<br><font size=-1>2000000008024000-200000000c000000 ---p 2000000008024000
00:00 0</font>
<br><font size=-1>4000000000000000-40000000007e0000 r-xp 00000000 fd:00
9633909           
/var/tmp/crash-4.0-3.16/crash</font>
<br><font size=-1>600000000000c000-600000000006c000 rw-p 007dc000 fd:00
9633909           
/var/tmp/crash-4.0-3.16/crash</font>
<br><font size=-1>600000000006c000-6000000001fc0000 rw-p 600000000006c000
00:00 0          [heap]</font>
<br><font size=-1>60000fff7fffc000-60000fff80004000 rw-p 60000fff7fffc000
00:00 0</font>
<br><font size=-1>60000ffffe068000-60000ffffe0bc000 rw-p 60000ffffe068000
00:00 0          [stack]</font>
<br><font size=-1>a000000000000000-a000000000020000 ---p 00000000 00:00
0                 
[vdso]</font>
<br><font size=-1>Aborted</font>
<br> 
<br> 
<br> 
<pre WRAP>
<hr WIDTH="90%" SIZE=4>--
Crash-utility mailing list
Crash-utility@redhat.com
<a href="https://www.redhat.com/mailman/listinfo/crash-utility">https://www.redhat.com/mailman/listinfo/crash-utility</a></pre>
</blockquote>
</html>