Hi
I have compiled linux code with llvm/clang version 11 and enabled code coverage (GCOV) in kernel configs.
.gcno files are generated fine but device is fail to boot. I see kernel panic as below and restarting.
Seems it is a page fault with supervisor read access failure.
I searched for funtion implementation __llvm_gcov_writeout in kernel which is not present though.
Seems llvm should support this funtion.
Any help in this regards is much appreciated.
[ 2.016708] BUG: unable to handle page fault for address: 000000003430382a
[ 2.017606] #PF: supervisor read access in kernel mode
[ 2.017606] #PF: error_code(0x0000) - not-present page
*[ 2.017606] PGD 0 P4D 0 *
[ 2.017606] Oops: 0000 [#1] PREEMPT SMP NOPTI
[ 2.017606] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.4.19-android-x86_64 #1
[ 2.017606] Hardware name: ADVANCED MICRO DEVICES, INC. Mauna/Mauna, BIOS WMN1305N Mar 4 2021
[ 2.017606] RIP: 0010:llvm_gcda_start_file+0x1e/0x27
[ 2.017606] Code: 00 48 ff 05 9b 4b 7c 03 5b 41 5e c3 0f 1f 44 00 00 48 ff 05 c3 4b 7c 03 48 ff 05 c4 4b 7c 03 48 8b 05 2d 4b 7c 03 48 89 78 10 <8b> 0e 89 48 18 89 50 1c c3 0f 1f 44 00 00 55 41 57 41 56 41 55 41
[ 2.017606] RSP: 0018:ffffabcc8004beb0 EFLAGS: 00010202
[ 2.017606] RAX: ffff926b3f95a040 RBX: ffff926b3f95a040 RCX: ffff926b27f89040
[ 2.017606] RDX: 00000000bfcd4e6a RSI: 000000003430382a RDI: ffffffffad0fd7a7
[ 2.017606] RBP: 0000000000000000 R08: 0000000000000002 R09: 0000000000000002
[ 2.017606] R10: ffffffffad6da168 R11: ffffffffaa201c20 R12: 0000000000000000
[ 2.017606] R13: 0000000000000000 R14: ffffffffaa201c20 R15: 0000000000000001
[ 2.017606] FS: 0000000000000000(0000) GS:ffff926b3b800000(0000) knlGS:0000000000000000
[ 2.017606] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2.017606] CR2: 000000003430382a CR3: 000000015c80a000 CR4: 0000000000140ef0
[ 2.017606] Call Trace:
[ 2.017606] __llvm_gcov_writeout+0x1d/0x90
[ 2.017606] ? trace_initcall_level+0x227/0x227
[ 2.017606] llvm_gcov_init+0x1f0/0x259
[ 2.017606] do_ctors+0x38/0x57
[ 2.017606] do_basic_setup+0x27/0x3e
[ 2.017606] kernel_init_freeable+0x24b/0x352
[ 2.017606] ? rest_init+0x128/0x128
[ 2.017606] kernel_init+0x11/0x20a
[ 2.017606] ret_from_fork+0x22/0x40
[ 2.017606] Modules linked in:
[ 2.017606] CR2: 000000003430382a
[ 2.017606] —[ end trace 592c0e5abde7757d ]—
[ 2.017606] RIP: 0010:llvm_gcda_start_file+0x1e/0x27
[ 2.017606] Code: 00 48 ff 05 9b 4b 7c 03 5b 41 5e c3 0f 1f 44 00 00 48 ff 05 c3 4b 7c 03 48 ff 05 c4 4b 7c 03 48 8b 05 2d 4b 7c 03 48 89 78 10 <8b> 0e 89 48 18 89 50 1c c3 0f 1f 44 00 00 55 41 57 41 56 41 55 41
[ 2.017606] RSP: 0018:ffffabcc8004beb0 EFLAGS: 00010202
[ 2.017606] RAX: ffff926b3f95a040 RBX: ffff926b3f95a040 RCX: ffff926b27f89040
[ 2.017606] RDX: 00000000bfcd4e6a RSI: 000000003430382a RDI: ffffffffad0fd7a7
[ 2.017606] RBP: 0000000000000000 R08: 0000000000000002 R09: 0000000000000002
[ 2.017606] R10: ffffffffad6da168 R11: ffffffffaa201c20 R12: 0000000000000000
[ 2.017606] R13: 0000000000000000 R14: ffffffffaa201c20 R15: 0000000000000001
[ 2.017606] FS: 0000000000000000(0000) GS:ffff926b3b800000(0000) knlGS:0000000000000000
[ 2.017606] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2.017606] CR2: 000000003430382a CR3: 000000015c80a000 CR4: 0000000000140ef0
[ 2.017606] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000009
[ 2.017606] Rebooting in 5 seconds…