Skip to contentSkip to conversation

kernel unaligned acc on Alpha

DISCUSSION Marc Giger 3 participants 7 messages Feb 29, 2004 – Mar 1, 2004

lore
Share & tools
lore

Marc Giger

author
#0 lore raw

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Another question: What's the meaning of va?

Thank you very much!

Regards

Marc

#1 lore raw
Quoted 11 lines · Marc Giger

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Find the matching function in System.map. Look for the entry with the highest address less than or equal to the pc value.

Quoted 1 line

Another question: What's the meaning of va?

It's the virtual memory address being accessed. The va value is rather close to the pc, so I would guess that it is some static data from the same source file as the function that is being accessed.

Signature · 2 lines
Måns Rullgård
[email protected]
author
#2 lore raw

Hi Måns,

Quoted 9 lines · On Sun, 29 Feb 2004 22:24:45 +0100 [email protected] (Måns Rullgård) wrote:
Quoted 7 lines · Marc Giger

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

Quoted 7 lines
Quoted 4 lines

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Find the matching function in System.map. Look for the entry with the highest address less than or equal to the pc value.

The highest address in System.map is
fffffc000076fab0 A _end

/proc/ksyms is more informative. It seems the function is in a module.

fffffffc00254800 ipt_unregister_table [ip_tables]
fffffffc00256051 __insmod_ip_tables_S.rodata_L16 [ip_tables]

ipt_unregister_table is the most matching funtion, but makes no sense to me, since I don't load and unload it 2191330 times:-)

Do you have more tips how to find the right funtion in the modules?

Quoted 6 lines
Quoted 2 lines

Another question: What's the meaning of va?

It's the virtual memory address being accessed. The va value is rather close to the pc, so I would guess that it is some static data from the same source file as the function that is being accessed.

Thank you very much for your help!

Regards

Marc

author
#3 lore raw
Quoted 28 lines · On Sun, 29 Feb 2004 23:03:18 +0100 Marc Giger <[email protected]> wrote:

Hi Måns,

Quoted 9 lines · On Sun, 29 Feb 2004 22:24:45 +0100 [email protected] (Måns Rullgård) wrote:
Quoted 7 lines · Marc Giger

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

Quoted 7 lines
Quoted 4 lines

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Find the matching function in System.map. Look for the entry with the highest address less than or equal to the pc value.

The highest address in System.map is
fffffc000076fab0 A _end

/proc/ksyms is more informative. It seems the function is in a module.

Quoted 8 lines

fffffffc00254800 ipt_unregister_table [ip_tables]
fffffffc00256051 __insmod_ip_tables_S.rodata_L16 [ip_tables]

ipt_unregister_table is the most matching funtion, but makes no sense to me, since I don't load and unload it 2191330 times:-)

Do you have more tips how to find the right funtion in the modules?

Ok, I found it, because in 2.4.25 (2.6 too) is already fixed.

It would be nice if you could explain me how to find a function in a module with the given address.

Thank you and sorry for wasting your time!

Regards

Marc

#4 lore raw
In reply to Marc Giger
Quoted 19 lines · Marc Giger

Hi Måns,

Quoted 14 lines · On Sun, 29 Feb 2004 22:24:45 +0100 [email protected] (Måns Rullgård) wrote:
Quoted 11 lines · Marc Giger

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Quoted 8 lines
Quoted 2 lines

Find the matching function in System.map. Look for the entry with the highest address less than or equal to the pc value.

The highest address in System.map is
fffffc000076fab0 A _end

/proc/ksyms is more informative. It seems the function is in a module.

Yes, of course.

Quoted 2 lines

fffffffc00254800 ipt_unregister_table [ip_tables]
fffffffc00256051 __insmod_ip_tables_S.rodata_L16 [ip_tables]

That seems to support my suspicion that something is doing unaligned accesses of static data.

Quoted 2 lines

ipt_unregister_table is the most matching funtion, but makes no sense to me, since I don't load and unload it 2191330 times:-)

There is probably some function after ipt_unregister_table in the source code that is not being exported from the object file.

Quoted 1 line

Do you have more tips how to find the right funtion in the modules?

Disassemble (objdump -s) the module and look for load or store instructions with the same page offset as the reported pc value, in this case 0x17d8. You'll want to compile with debugging symbols so you get the function names printed even for static functions.

Another thing is to look for casts to (int *) or (long *) in the source code. There's often one somewhere close to the unaligned access. You might also check where static data is being accessed. Depending on the amount of static data and the number of accesses this might be more trouble than it's worth.

BTW, which kernel version is this?

Signature · 2 lines
Måns Rullgård
[email protected]
#5 lore raw
In reply to Måns Rullgård
Quoted 8 lines · [email protected] (Måns Rullgård) wrote:
Quoted 8 lines

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

Quoted 6 lines
Quoted 4 lines

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Find the matching function in System.map.

If this is 2.6, that message should be augmented to use print_symbol().

author
#6 lore raw
Quoted 14 lines · On Sun, 29 Feb 2004 14:22:18 -0800 Andrew Morton <[email protected]> wrote:
Quoted 13 lines · [email protected] (Måns Rullgård) wrote:
Quoted 12 lines

Hi All,

I have a lot of unaligned accesses in kernel space:

kernel unaligned acc : 2191330
(pc=fffffffc002557d8,va=fffffffc00256059)

It seems to be located in the networking part (iptables?) from the kernel. Can someone please help me how to find the location of these uac's? I already have recompiled the kernel with debugging enabled and tried to debug it with gdb.

Quoted 4 lines
Quoted 1 line

Find the matching function in System.map.

If this is 2.6, that message should be augmented to use print_symbol().

It's 2.4, and accessed via /proc/cpuinfo.