traversing vma on nommu
Hajime Tazaki
thehajime at gmail.com
Wed Nov 6 13:47:00 PST 2024
Hello,
Thanks for the detail information.
> Can you add some (totally untested) debug to the exit path in
> kernel/acct.c?
>
> +#include <linux/maple_tree.h>
>
> ...
> mmap_read_lock(mm);
> + mt_dump(&mm->mm_mt, mt_dump_hex);
> + mt_validate(&mm->mm_mt);
> for_each_vma(vmi, vma)
> vsize += vma->vm_end - vma->vm_start;
> mmap_read_unlock(mm);
>
> You will need to enable CONFIG_DEBUG_MAPLE_TREE on the kernel.
I quickly added the code and here is the just part of the output.
It's being so long; I put the full output at below.
https://gist.github.com/thehajime/30485f105ab78a09b66691eb024dc011
# I'm not yet looking at carefully the log but will do.
maple_tree(00000000f764061f) flags 30B, height 2 root 000000003376012e
0-ffffffffffffffff: node 00000000d6b3edbb depth 0 type 3 parent 0000000053daa24c contents: 60bc0000 7000 ffffffff90d5d000 0 0 0 0 0 0 0 | 02 02| 00000000381b1378 61498FFF 00000000b86a0936 614E7FFF 00000000984290a2 FFFFFFFFFFFFFFFF 000000000
(snip)
Pass: 1072 Run:1104
CPU: 0 UID: 0 PID: 38 Comm: apk Not tainted 6.12.0-rc6-00064-g0ff2a82b0c13-dirty #16
Stack:
6f3afc90 603acf13 200000000 00000001
ffffff00 604a3f8c 603c7883 603b0cf1
6f3afcc0 603cf6c2 60564230 614a1180
Call Trace:
[<603c7883>] ? _printk+0x0/0x98
[<600237c4>] show_stack+0x102/0x15d
[<603acf13>] ? dump_stack_print_info+0x12f/0x142
[<603c7883>] ? _printk+0x0/0x98
[<603b0cf1>] ? ma_slots+0x0/0x26
[<603cf6c2>] dump_stack_lvl+0x62/0x7d
[<603cf6fb>] dump_stack+0x1e/0x20
[<603b6bb7>] mt_validate_nulls+0x16a/0x1e0
[<603b823f>] mt_validate+0x1612/0x1621
[<603b37a6>] ? mas_find+0x0/0x10b
[<603b37a6>] ? mas_find+0x0/0x10b
[<600932f0>] acct_collect+0xcc/0x21b
[<600337d1>] ? unblock_signals+0x0/0xc1
[<600337be>] ? block_signals+0x0/0x13
[<6003df3a>] do_exit+0x2aa/0x9f7
[<6003e91a>] sys_exit_group+0x0/0x1a
[<60022b40>] ? interrupt_end+0x9a/0xe4
[<6003e934>] pid_child_should_wake+0x0/0x46
[<60038996>] do_syscall_64+0xeb/0x1f3
[<60038b03>] __kernel_vsyscall+0x65/0x96
Thread 1 "vmlinux" received signal SIGSEGV, Segmentation fault.
acct_collect (exitcode=exitcode at entry=25344, group_dead=group_dead at entry=1) at ../kernel/acct.c:568
568 vsize += vma->vm_end - vma->vm_start;
(gdb)
-- Hajime
More information about the maple-tree
mailing list