[prev in list] [next in list] [prev in thread] [next in thread]
List: user-mode-linux-user
Subject: Re: [uml-user] [SOLVED] Problem with module debugging
From: PaweÅ Rusak <pawel.rusak () wp ! pl>
Date: 2010-09-09 10:48:23
Message-ID: 4C88BB77.6090506 () wp ! pl
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
On 01.09.2010 13:52, PaweÅ Rusak wrote:
>
> Breakpoint 1, sys_init_module (umod=0x804b018, len=50866,
> uargs=0x804b008 "\377P\211\303\350×\001") at kernel/module.c:2591
> 2591 if (!capable(CAP_SYS_MODULE) || modules_disabled)
> (gdb) c
> Continuing.
>
> Breakpoint 2, sys_init_module (umod=0x804b018, len=50866,
> uargs=0x804b008 "\377P\211\303\350×\001") at kernel/module.c:2613
> 2613 if (mod->init != NULL)
> (gdb) p modules
> $1 = {next = 0x1256d7f0, prev = 0x125478dc}
> (gdb) p 0x1256d7ec
> $2 = 307681260
> (gdb) p *((struct module *)0x1256d7ec)
> $3 = {state = MODULE_STATE_COMING, list = {next = 0x125478dc,
> prev = 0x8236ab0}, name = "mapper_test", '\000' <repeats 48
> times>,
> mkobj = {kobj = {name = 0x10ac26e0 "mapper_test", entry = {
> next = 0x118499a0, prev = 0x12547924}, parent = 0x118499b8,
> kset = 0x118499a0, ktype = 0x82363c8, sd = 0x11a22198, kref = {
> refcount = {counter = 3}}, state_initialized = 1,
> state_in_sysfs = 1,
> state_add_uevent_sent = 1, state_remove_uevent_sent = 0,
> uevent_suppress = 0}, mod = 0x1256d7ec, drivers_dir = 0x0,
> mp = 0x0},
> modinfo_attrs = 0x11a062e0, version = 0x0, srcversion = 0x0,
> holders_dir = 0x119abd60, syms = 0x0, crcs = 0x0, num_syms = 0,
> kp = 0x0,
> num_kp = 0, num_gpl_syms = 0, gpl_syms = 0x0, gpl_crcs = 0x0,
> unused_syms = 0x0, unused_crcs = 0x0, num_unused_syms = 0,
> num_unused_gpl_syms = 0, unused_gpl_syms = 0x0, unused_gpl_crcs
> = 0x0,
> gpl_future_syms = 0x0, gpl_future_crcs = 0x0,
> num_gpl_future_syms = 0,
> num_exentries = 0, extable = 0x0, init = 0x1256d00a,
> module_init = 0x12570000, module_core = 0x1256d000, init_size =
> 2322,
> core_size = 3353, init_text_size = 421, core_text_size = 1039,
> arch = {<No data fields>}, taints = 0, num_bugs = 0, bug_list = {
> next = 0x125479d0, prev = 0x823a118}, bug_table = 0x0,
> symtab = 0x125701a8, core_symtab = 0x1256da74, num_symtab = 70,
> core_num_syms = 19, strtab = 0x12570608 "", core_strtab =
> 0x1256dba4 "",
> sect_attrs = 0x10ac4200, notes_attrs = 0x119abd20, percpu = 0x0,
> args = 0x10ac2880 "", modules_which_use_me = {next = 0x1256d918,
> prev = 0x1256d918}, waiter = 0x11874060, exit = 0x1256d000,
> ref = {a = {
> counter = 1}}}
> (gdb) add-symbol-file /home/dzwiedz/projekty/BIS/mapper_test.ko
> 0x1256d000
> add symbol table from file
> "/home/dzwiedz/projekty/BIS/mapper_test.ko" at
> .text_addr = 0x1256d000
> (y or n) y
> Reading symbols from /home/dzwiedz/projekty/BIS/mapper_test.ko...done.
> (gdb) p nf_mapper_init
> $7 = {int (void)} 0x274 <nf_mapper_init>
> (gdb) p nf_mapper_cleanup
> $8 = {void (void)} 0xa9 <nf_mapper_cleanup>
> (gdb) b nf_mapper_init
> Breakpoint 3 at 0x274: file
> /home/dzwiedz/projekty/BIS/nf_bis_mapper.c, line 48.
> (gdb) b nf_mapper_cleanup
> Breakpoint 4 at 0xa9: file
> /home/dzwiedz/projekty/BIS/nf_bis_mapper.c, line 75.
> (gdb) s
> Warning:
> Cannot insert breakpoint 4.
> Error accessing memory address 0xa9: Input/output error.
> Cannot insert breakpoint 3.
> Error accessing memory address 0x274: Input/output error.
>
> hard_handler (sig=29) at arch/um/os-Linux/sys-i386/signal.c:11
> 11 {
> (gdb)
>
Problem was solved. I had to disable code optimalization in my UML
kernel config. Also I it was needed to delete __init and __exit tag from
module init and cleanup function.
regards,
--
Pawel R.
<pawel.rusak@wp.pl>
[Attachment #5 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 01.09.2010 13:52, Paweł Rusak wrote:
<blockquote cite="mid:4C7E3E6D.1030607@wp.pl" type="cite">
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<blockquote><font face="Inconsolata">Breakpoint 1, sys_init_module
(umod=0x804b018, len=50866, <br>
</font> <font face="Inconsolata"> uargs=0x804b008
"\377P\211\303\350ג\001") at kernel/module.c:2591<br>
</font> <font face="Inconsolata">2591 if
(!capable(CAP_SYS_MODULE) ||
modules_disabled)<br>
</font> <font face="Inconsolata">(gdb) c<br>
</font> <font face="Inconsolata">Continuing.<br>
<br>
</font> <font face="Inconsolata">Breakpoint 2, sys_init_module
(umod=0x804b018, len=50866, <br>
</font> <font face="Inconsolata"> uargs=0x804b008
"\377P\211\303\350ג\001") at kernel/module.c:2613<br>
</font> <font face="Inconsolata">2613 if (mod->init !=
NULL)<br>
</font> <font face="Inconsolata">(gdb) p modules<br>
</font> <font face="Inconsolata">$1 = {next = 0x1256d7f0, prev =
0x125478dc}<br>
</font> <font face="Inconsolata">(gdb) p 0x1256d7ec<br>
</font> <font face="Inconsolata">$2 = 307681260<br>
</font> <font face="Inconsolata">(gdb) p *((struct module
*)0x1256d7ec)<br>
</font> <font face="Inconsolata">$3 = {state =
MODULE_STATE_COMING, list =
{next = 0x125478dc, <br>
</font> <font face="Inconsolata"> prev = 0x8236ab0}, name =
"mapper_test",
'\000' <repeats 48 times>, <br>
</font> <font face="Inconsolata"> mkobj = {kobj = {name =
0x10ac26e0
"mapper_test", entry = {<br>
</font> <font face="Inconsolata"> next = 0x118499a0, prev =
0x12547924}, parent = 0x118499b8, <br>
</font> <font face="Inconsolata"> kset = 0x118499a0, ktype =
0x82363c8,
sd = 0x11a22198, kref = {<br>
</font> <font face="Inconsolata"> refcount = {counter =
3}},
state_initialized = 1, state_in_sysfs = 1, <br>
</font> <font face="Inconsolata"> state_add_uevent_sent = 1,
state_remove_uevent_sent = 0, <br>
</font> <font face="Inconsolata"> uevent_suppress = 0}, mod =
0x1256d7ec, drivers_dir = 0x0, mp = 0x0}, <br>
</font> <font face="Inconsolata"> modinfo_attrs = 0x11a062e0,
version = 0x0,
srcversion = 0x0, <br>
</font> <font face="Inconsolata"> holders_dir = 0x119abd60, syms
= 0x0, crcs
= 0x0, num_syms = 0, kp = 0x0, <br>
</font> <font face="Inconsolata"> num_kp = 0, num_gpl_syms = 0,
gpl_syms =
0x0, gpl_crcs = 0x0, <br>
</font> <font face="Inconsolata"> unused_syms = 0x0, unused_crcs
= 0x0,
num_unused_syms = 0, <br>
</font> <font face="Inconsolata"> num_unused_gpl_syms = 0,
unused_gpl_syms =
0x0, unused_gpl_crcs = 0x0, <br>
</font> <font face="Inconsolata"> gpl_future_syms = 0x0,
gpl_future_crcs =
0x0, num_gpl_future_syms = 0, <br>
</font> <font face="Inconsolata"> num_exentries = 0, extable =
0x0, init =
0x1256d00a, <br>
</font> <font face="Inconsolata"> module_init = 0x12570000,
module_core =
0x1256d000, init_size = 2322, <br>
</font> <font face="Inconsolata"> core_size = 3353,
init_text_size = 421,
core_text_size = 1039, <br>
</font> <font face="Inconsolata"> arch = {<No data
fields>}, taints =
0, num_bugs = 0, bug_list = {<br>
</font> <font face="Inconsolata"> next = 0x125479d0, prev =
0x823a118},
bug_table = 0x0, <br>
</font> <font face="Inconsolata"> symtab = 0x125701a8,
core_symtab =
0x1256da74, num_symtab = 70, <br>
</font> <font face="Inconsolata"> core_num_syms = 19, strtab =
0x12570608
"", core_strtab = 0x1256dba4 "", <br>
</font> <font face="Inconsolata"> sect_attrs = 0x10ac4200,
notes_attrs =
0x119abd20, percpu = 0x0, <br>
</font> <font face="Inconsolata"> args = 0x10ac2880 "",
modules_which_use_me
= {next = 0x1256d918, <br>
</font> <font face="Inconsolata"> prev = 0x1256d918}, waiter =
0x11874060,
exit = 0x1256d000, ref = {a = {<br>
</font> <font face="Inconsolata"> counter = 1}}}<br>
</font> <font face="Inconsolata">(gdb) add-symbol-file
/home/dzwiedz/projekty/BIS/mapper_test.ko 0x1256d000<br>
</font> <font face="Inconsolata">add symbol table from file
"/home/dzwiedz/projekty/BIS/mapper_test.ko" at<br>
</font> <font face="Inconsolata"> .text_addr = 0x1256d000<br>
</font> <font face="Inconsolata">(y or n) y<br>
</font> <font face="Inconsolata">Reading symbols from
/home/dzwiedz/projekty/BIS/mapper_test.ko...done.<br>
</font> <font face="Inconsolata">(gdb) p nf_mapper_init<br>
</font> <font face="Inconsolata">$7 = {int (void)} 0x274
<nf_mapper_init><br>
</font> <font face="Inconsolata">(gdb) p nf_mapper_cleanup<br>
</font> <font face="Inconsolata">$8 = {void (void)} 0xa9
<nf_mapper_cleanup><br>
</font> <font face="Inconsolata">(gdb) b nf_mapper_init<br>
</font> <font face="Inconsolata">Breakpoint 3 at 0x274: file
/home/dzwiedz/projekty/BIS/nf_bis_mapper.c, line 48.<br>
</font> <font face="Inconsolata">(gdb) b nf_mapper_cleanup<br>
</font> <font face="Inconsolata">Breakpoint 4 at 0xa9: file
/home/dzwiedz/projekty/BIS/nf_bis_mapper.c, line 75.<br>
</font> <font face="Inconsolata">(gdb) s<br>
</font> <font face="Inconsolata">Warning:<br>
</font> <font face="Inconsolata">Cannot insert breakpoint 4.<br>
</font> <font face="Inconsolata">Error accessing memory address
0xa9:
Input/output error.<br>
</font> <font face="Inconsolata">Cannot insert breakpoint 3.<br>
</font> <font face="Inconsolata">Error accessing memory address
0x274:
Input/output error.<br>
<br>
</font> <font face="Inconsolata">hard_handler (sig=29) at
arch/um/os-Linux/sys-i386/signal.c:11<br>
</font> <font face="Inconsolata">11 {<br>
</font> <font face="Inconsolata">(gdb)</font><font
face="Envy Code R"></font></blockquote>
</blockquote>
Problem was solved. I had to disable code optimalization in my UML
kernel config. Also I it was needed to delete __init and __exit tag
from module init and cleanup function.<br>
<br>
regards,<br>
-- <br>
Pawel R.<br>
<a class="moz-txt-link-rfc2396E" href="mailto:pawel.rusak@wp.pl"><pawel.rusak@wp.pl></a><br>
<br>
</body>
</html>
------------------------------------------------------------------------------
This SF.net Dev2Dev email is sponsored by:
Show off your parallel programming skills.
Enter the Intel(R) Threading Challenge 2010.
http://p.sf.net/sfu/intel-thread-sfd
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic