Closed
Description
When including the rust_example driver (not as module) I get a kernel panic:
[ 0.487414][ T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.9.0-rc2+ #3
[ 0.487414][ T1] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-48-gd9c812d4
[ 0.487414][ T1] RIP: 0010:__memcpy+0x12/0x20
[ 0.487414][ T1] Code: 8c 94 00 00 74 0a c7 05 a8 8c 94 00 0f 00 00 00 c3 31 c0 c3 cc cc cc cc 0f 14
[ 0.487414][ T1] RSP: 0000:ffffbcf0400133b8 EFLAGS: 00010202
[ 0.487414][ T1] RAX: ffffbcf040013496 RBX: 00000000000003d2 RCX: 000000000000007a
[ 0.487414][ T1] RDX: 0000000000000002 RSI: 3674fd8948f23948 RDI: ffffbcf040013496
[ 0.487414][ T1] RBP: ffffbcf0400133d0 R08: 0000000000000000 R09: ffffbcf040013480
[ 0.487414][ T1] R10: 0000000000000123 R11: ffffffff89997710 R12: ffffffff8a812258
[ 0.487414][ T1] R13: ffffffff8a5eadd0 R14: ffffbcf040013480 R15: ffffbcf040013898
[ 0.487414][ T1] FS: 0000000000000000(0000) GS:ffffa04c87a00000(0000) knlGS:0000000000000000
[ 0.487414][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 0.487414][ T1] CR2: 0000000000000000 CR3: 0000000005c0a000 CR4: 00000000000006f0
[ 0.487414][ T1] Call Trace:
[ 0.487414][ T1] ? do_one_initcall+0xb8/0x250
[ 0.487414][ T1] ? alloc_pages_current+0x10a/0x1b0
[ 0.487414][ T1] ? allocate_slab+0xf7/0x4c0
[ 0.487414][ T1] ? ida_alloc_range+0x391/0x3d0
[ 0.487414][ T1] ? parse_one+0x53/0x270
[ 0.487414][ T1] ? do_initcall_level+0x88/0x88
[ 0.487414][ T1] ? parse_args+0x118/0x220
[ 0.487414][ T1] ? do_initcall_level+0x88/0x88
[ 0.487414][ T1] ? do_initcall_level+0x7e/0x88
[ 0.487414][ T1] ? do_initcalls+0x44/0x6d
[ 0.487414][ T1] ? kernel_init_freeable+0xd6/0x11d
[ 0.487414][ T1] ? rest_init+0xa0/0xa0
[ 0.487414][ T1] ? kernel_init+0x5/0x180
[ 0.487414][ T1] ? ret_from_fork+0x22/0x30
[ 0.487414][ T1] Modules linked in:
[ 0.515297][ T1] ---[ end trace 13ad6358da39c417 ]---
[ 0.516114][ T1] RIP: 0010:__memcpy+0x12/0x20
[ 0.516796][ T1] Code: 8c 94 00 00 74 0a c7 05 a8 8c 94 00 0f 00 00 00 c3 31 c0 c3 cc cc cc cc 0f 1f 44 00 00 48 89 f8 48 89 d1 48 c1 e9 03 83 e2 07 <f3> 48 a5 89 d1 f3 a4 c3 66 0f 1f 44 00 00 48 89 f8 48 84
[ 0.519649][ T1] RSP: 0000:ffffbcf0400133b8 EFLAGS: 00010202
[ 0.520539][ T1] RAX: ffffbcf040013496 RBX: 00000000000003d2 RCX: 000000000000007a
[ 0.521701][ T1] RDX: 0000000000000002 RSI: 3674fd8948f23948 RDI: ffffbcf040013496
[ 0.522875][ T1] RBP: ffffbcf0400133d0 R08: 0000000000000000 R09: ffffbcf040013480
[ 0.524036][ T1] R10: 0000000000000123 R11: ffffffff89997710 R12: ffffffff8a812258
[ 0.525198][ T1] R13: ffffffff8a5eadd0 R14: ffffbcf040013480 R15: ffffbcf040013898
[ 0.526361][ T1] FS: 0000000000000000(0000) GS:ffffa04c87a00000(0000) knlGS:0000000000000000
[ 0.527666][ T1] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 0.528626][ T1] CR2: 0000000000000000 CR3: 0000000005c0a000 CR4: 00000000000006f0
[ 0.529790][ T1] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[ 0.530780][ T1] Kernel Offset: 0x8400000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
[ 0.530780][ T1] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
Config and kernel console here: https://gist.github.com/Kloenk/aad17db1adc313ec49a51712c03060b0
Activity
ojeda commentedon Oct 5, 2020
Edit: never mind, I didn't read the trace. There is this in the log above the panic:
and it comes while running the initialization for the example module (
do_one_initcall
). We get as far as printing:and then it crashes while copying some memory. Let me try to reproduce it.
kloenk commentedon Oct 5, 2020
Here is my initrd, if you want to use it.
initrd.cpio.gz
ojeda commentedon Oct 5, 2020
Reproduced with LLVM 10 on my side.
kloenk commentedon Oct 5, 2020
Mine was llvm11, as packages in my nix flake
Forbid rustc from using -f{function,data}-sections (fixes #20 panic)
ojeda commentedon Nov 26, 2020
@kloenk Can you please confirm #28 fixes this for you?
Forbid rustc from using -f{function,data}-sections (fixes #20 panic)
Merge pull request #28 from Rust-for-Linux/rust-fix-panic
perf metric: Release expr_parse_ctx after testing
perf test: Fix cpu and thread map leaks in code_reading test
arm64: fix strlen() with CONFIG_KASAN_HW_TAGS
ARM: 9170/1: fix panic when kasan and kprobe are enabled
net-sysfs: add check for netdevice being present to speed_show
15 remaining items