mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Andre Tomt <andre@tomt.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Linux 2.6.3-rc1
Date: Mon, 9 Feb 2004 02:34:20 +0100	[thread overview]
Message-ID: <200402090234.20832.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <4026CF98.5000905@tomt.net>

On Monday 09 of February 2004 01:08, Andre Tomt wrote:
> Bartlomiej Zolnierkiewicz wrote:
> >>>Can you disassemble ide_pci_register_host_proc using gdb?
> >>
> >>I'd need a walkthrough, not very familiar with gdb other than getting a
> >>backtrace out of it
> >
> > Make sure to enable following options in kernel config:
> > CONFIG_DEBUG_KERNEL ("Kernel hacking"->"Kernel debugging" ) and
> > CONFIG_DEBUG_INFO ("Kernel debugging"->"Compile the kernel with debug
> > info").
> >
> > Recompile kernel.
> >
> > $ gdb /usr/src/linux/vmlinux
> > (gdb) disassemble ide_pci_register_host_proc
> >
> > That's all :-).
>
> Ahh. However, as ide-core is a module in this case, I had to run gdb on
> the module instead. Anyway..

Yep.

> (gdb) disassemble ide_pci_register_host_proc
> Dump of assembler code for function ide_pci_register_host_proc:
> 0xe940 <ide_pci_register_host_proc>:    mov    0x4(%esp,1),%ecx
> 0xe944 <ide_pci_register_host_proc+4>:  test   %ecx,%ecx
> 0xe946 <ide_pci_register_host_proc+6>:  je     0xe978
> <ide_pci_register_host_proc+56>
> 0xe948 <ide_pci_register_host_proc+8>:  movl   $0x0,0x10(%ecx)
> 0xe94f <ide_pci_register_host_proc+15>: movb   $0x1,0x4(%ecx)
> 0xe953 <ide_pci_register_host_proc+19>: mov    0x3910,%eax
> 0xe958 <ide_pci_register_host_proc+24>: test   %eax,%eax
> 0xe95a <ide_pci_register_host_proc+26>: je     0xe972
> <ide_pci_register_host_proc+50>
> 0xe95c <ide_pci_register_host_proc+28>: mov    %eax,%edx
> 0xe95e <ide_pci_register_host_proc+30>: mov    0x10(%eax),%eax
> 0xe961 <ide_pci_register_host_proc+33>: test   %eax,%eax
> 0xe963 <ide_pci_register_host_proc+35>: je     0xe96e
> <ide_pci_register_host_proc+46>
> 0xe965 <ide_pci_register_host_proc+37>: mov    %eax,%edx

Access to ide_pci_proc_host_list->next.

> 0xe967 <ide_pci_register_host_proc+39>: mov    0x10(%eax),%eax
> 0xe96a <ide_pci_register_host_proc+42>: test   %eax,%eax
> 0xe96c <ide_pci_register_host_proc+44>: jne    0xe965
> <ide_pci_register_host_proc+37>
> 0xe96e <ide_pci_register_host_proc+46>: mov    %ecx,0x10(%edx)
> 0xe971 <ide_pci_register_host_proc+49>: ret
> 0xe972 <ide_pci_register_host_proc+50>: mov    %ecx,0x3910
> 0xe978 <ide_pci_register_host_proc+56>: ret
> End of assembler dump.

Ok thanks, I got the same dump.  I think the problem is that memory used by
previously registered ide_pci_host_proc_list entry (for pdc202xx_new driver)
is already unmapped because of __initdata in pdc202xx_new.h.
(This doesn't happen in built-in case because this memory is freed after
all drivers are initialized.)

Does this patch help?

 linux-2.6.3-rc1-bk1-root/drivers/ide/pci/pdc202xx_new.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/ide/pci/pdc202xx_new.h~pdc202xx_old_oops drivers/ide/pci/pdc202xx_new.h
--- linux-2.6.3-rc1-bk1/drivers/ide/pci/pdc202xx_new.h~pdc202xx_old_oops	2004-02-09 02:20:24.816898368 +0100
+++ linux-2.6.3-rc1-bk1-root/drivers/ide/pci/pdc202xx_new.h	2004-02-09 02:20:57.167980256 +0100
@@ -172,7 +172,7 @@ static u8 pdcnew_proc;
 
 static int pdcnew_get_info(char *, char **, off_t, int);
 
-static ide_pci_host_proc_t pdcnew_procs[] __initdata = {
+static ide_pci_host_proc_t pdcnew_procs[] = {
 	{
 		.name		= "pdcnew",
 		.set		= 1,

_


  reply	other threads:[~2004-02-09  1:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-02-07  2:28 Linus Torvalds
2004-02-07  2:56 ` viro
2004-02-07 17:21   ` Kevin O'Connor
2004-02-07 19:20     ` Greg KH
2004-02-07  3:11 ` Måns Rullgård
2004-02-07  5:26   ` Greg KH
2004-02-07 10:24 ` Andre Tomt
2004-02-07 16:22   ` Bartlomiej Zolnierkiewicz
2004-02-08  6:02     ` Andre Tomt
2004-02-08  6:29       ` Andre Tomt
2004-02-08 21:34       ` Bartlomiej Zolnierkiewicz
2004-02-08 21:55         ` Andre Tomt
2004-02-08 22:51           ` Bartlomiej Zolnierkiewicz
2004-02-09  0:08             ` Andre Tomt
2004-02-09  1:34               ` Bartlomiej Zolnierkiewicz [this message]
2004-02-09  2:40                 ` Andre Tomt
2004-02-09 12:41                   ` Arkadiusz Miskiewicz
2004-02-09 14:41                     ` Bartlomiej Zolnierkiewicz
2004-02-09 13:01                   ` Bartlomiej Zolnierkiewicz
2004-02-09  1:53           ` Disassembling with gdb (Re: Linux 2.6.3-rc1) Matthew Reppert
2004-02-08 15:18 ` Linux 2.6.3-rc1 Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200402090234.20832.bzolnier@elka.pw.edu.pl \
    --to=b.zolnierkiewicz@elka.pw.edu.pl \
    --cc=andre@tomt.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®