Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RISCV panic due to stackprotector support #1092

Closed
nathanchance opened this issue Jul 15, 2020 · 1 comment · Fixed by ClangBuiltLinux/continuous-integration#305
Closed
Labels
[ARCH] risc-v This bug impacts ARCH=riscv [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.9 This bug was fixed in Linux 5.9

Comments

@nathanchance
Copy link
Member

On next-20200715:

$ make -skj"$(nproc)" ARCH=riscv CROSS_COMPILE=riscv64-linux-gnu- LD=riscv64-linux-gnu-ld LLVM=1 LLVM_IAS=1 O=out/riscv distclean defconfig Image.gz

$ ../../cbl/github/boot-utils/boot-qemu.sh -a riscv -k out/riscv -t 20s
...
+ timeout --foreground 20s unbuffer qemu-system-riscv64 -bios default -M virt -append '' -display none -initrd /home/nathan/cbl/github/boot-utils/images/riscv/rootfs.cpio -kernel /home/nathan/src/linux-next/out/riscv/arch/riscv/boot/Image -m 512m -nodefaults -serial mon:stdio

OpenSBI v0.5 (Oct  9 2019 12:03:04)
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name          : QEMU Virt Machine
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs     : 8
Current Hart           : 0
Firmware Base          : 0x80000000
Firmware Size          : 116 KB
Runtime SBI Version    : 0.2

PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 5.8.0-rc5-next-20200715 (nathan@ubuntu-n2-xlarge-x86) (ClangBuiltLinux clang version 11.0.0 (https://github.com/llvm/llvm-project.git 05a21b7b6da853090628bcaa57c1ac26bc6bbc63), GNU ld (GNU Binutils) 2.34) #1 SMP Wed Jul 15 15:56:16 MST 2020
[    0.000000] Initial ramdisk at: 0x(____ptrval____) (5446144 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000] software IO TLB: mapped [mem 0x9b8fb000-0x9f8fb000] (64MB)
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x5
[    0.000000] riscv: ISA extensions acdfimsu
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 17 pages/cpu s32104 r8192 d29336 u69632
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 128775
[    0.000000] Kernel command line: 
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 427412K/522240K available (9425K kernel code, 3460K rwdata, 2048K rodata, 279K init, 448K bss, 94828K reserved, 0K cma-reserved)
[    0.000000] Virtual kernel memory layout:
[    0.000000]       fixmap : 0xffffffcefee00000 - 0xffffffceff000000   (2048 kB)
[    0.000000]       pci io : 0xffffffceff000000 - 0xffffffcf00000000   (  16 MB)
[    0.000000]      vmemmap : 0xffffffcf00000000 - 0xffffffcfffffffff   (4095 MB)
[    0.000000]      vmalloc : 0xffffffd000000000 - 0xffffffdfffffffff   (65535 MB)
[    0.000000]       lowmem : 0xffffffe000000000 - 0xffffffe01fe00000   ( 510 MB)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: 	RCU debug extended QS entry/exit.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@c000000: mapped 53 interrupts with 1 handlers for 2 contexts.
[    0.000000] random: get_random_bytes called from start_kernel+0x1de/0x39e with crng_init=0
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.000279] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.011410] Console: colour dummy device 80x25
[    0.015569] printk: console [tty0] enabled
[    0.018971] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[    0.019380] pid_max: default: 32768 minimum: 301
[    0.021979] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.022226] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.075176] rcu: Hierarchical SRCU implementation.
[    0.086244] smp: Bringing up secondary CPUs ...
[    0.086587] smp: Brought up 1 node, 1 CPU
[    0.105053] devtmpfs: initialized
[    0.118558] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.119042] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.130528] NET: Registered protocol family 16
[    0.240428] vgaarb: loaded
[    0.246714] SCSI subsystem initialized
[    0.251171] usbcore: registered new interface driver usbfs
[    0.251983] usbcore: registered new interface driver hub
[    0.252552] usbcore: registered new device driver usb
[    0.272405] clocksource: Switched to clocksource riscv_clocksource
[    0.334606] NET: Registered protocol family 2
[    0.344512] tcp_listen_portaddr_hash hash table entries: 256 (order: 1, 10240 bytes, linear)
[    0.344985] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.345565] TCP bind hash table entries: 4096 (order: 5, 131072 bytes, linear)
[    0.346957] TCP: Hash tables configured (established 4096 bind 4096)
[    0.349422] UDP hash table entries: 256 (order: 2, 24576 bytes, linear)
[    0.350128] UDP-Lite hash table entries: 256 (order: 2, 24576 bytes, linear)
[    0.353213] NET: Registered protocol family 1
[    0.360602] RPC: Registered named UNIX socket transport module.
[    0.360854] RPC: Registered udp transport module.
[    0.361015] RPC: Registered tcp transport module.
[    0.361156] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.361535] PCI: CLS 0 bytes, default 64
[    0.370406] Unpacking initramfs...
[    0.760888] Freeing initrd memory: 5316K
[    0.765466] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[    0.791745] NFS: Registering the id_resolver key type
[    0.793340] Key type id_resolver registered
[    0.793557] Key type id_legacy registered
[    0.793889] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    0.796000] 9p: Installing v9fs 9p2000 file system support
[    0.798862] NET: Registered protocol family 38
[    0.799518] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    0.799809] io scheduler mq-deadline registered
[    0.800043] io scheduler kyber registered
[    0.817068] pci-host-generic 30000000.pci: host bridge /soc/pci@30000000 ranges:
[    0.818667] pci-host-generic 30000000.pci:       IO 0x0003000000..0x000300ffff -> 0x0000000000
[    0.820086] pci-host-generic 30000000.pci:      MEM 0x0040000000..0x007fffffff -> 0x0040000000
[    0.824088] pci-host-generic 30000000.pci: ECAM at [mem 0x30000000-0x3fffffff] for [bus 00-ff]
[    0.825787] pci-host-generic 30000000.pci: PCI host bridge to bus 0000:00
[    0.826257] pci_bus 0000:00: root bus resource [bus 00-ff]
[    0.826542] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    0.826699] pci_bus 0000:00: root bus resource [mem 0x40000000-0x7fffffff]
[    0.828808] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
[    1.117635] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.134577] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 1, base_baud = 230400) is a 16550A
[    1.181374] printk: console [ttyS0] enabled
[    1.186602] [drm] radeon kernel modesetting enabled.
[    1.225551] loop: module loaded
[    1.232481] libphy: Fixed MDIO Bus: probed
[    1.235595] e1000e: Intel(R) PRO/1000 Network Driver
[    1.236100] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.237215] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.237862] ehci-pci: EHCI PCI platform driver
[    1.238594] ehci-platform: EHCI generic platform driver
[    1.239764] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.240475] ohci-pci: OHCI PCI platform driver
[    1.241230] ohci-platform: OHCI generic platform driver
[    1.244348] usbcore: registered new interface driver uas
[    1.245172] usbcore: registered new interface driver usb-storage
[    1.247481] mousedev: PS/2 mouse device common for all mice
[    1.250422] usbcore: registered new interface driver usbhid
[    1.250812] usbhid: USB HID core driver
[    1.252990] NET: Registered protocol family 10
[    1.262964] Segment Routing with IPv6
[    1.264284] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.267898] NET: Registered protocol family 17
[    1.269926] 9pnet: Installing 9P2000 support
[    1.270551] Key type dns_resolver registered
[    1.315658] Freeing unused kernel memory: 276K
[    1.322375] Run /init as init process
[    1.565710] init[38]: unhandled signal 11 code 0x1 at 0x0000000000000000
[    1.566457] CPU: 0 PID: 38 Comm: init Not tainted 5.8.0-rc5-next-20200715 #1
[    1.567300] epc: 0000003fde11b980 ra : 0000003fde04f92c sp : 0000003ffff08880
[    1.567840]  gp : 00000000000e8528 tp : 0000003fde11a820 t0 : 000000000000001e
[    1.568389]  t1 : 000000000000000a t2 : 0000003ffff0881e s0 : 0000003ffff088a0
[    1.568922]  s1 : 0000000000000000 a0 : 0000003ffff088c0 a1 : 0000000000000000
[    1.569482]  a2 : 0000000000000000 a3 : 0000000000000000 a4 : fffffffffbad8000
[    1.569868]  a5 : 0000003fde11b970 a6 : 0000000000000000 a7 : 0000000000000000
[    1.570415]  s2 : 0000000000000001 s3 : 0000003fde10012c s4 : 0000000000000010
[    1.570982]  s5 : 0000000000000016 s6 : 00000000000d0e38 s7 : 0000003ffff089f0
[    1.571736]  s8 : 0000000000000000 s9 : 0000000000000000 s10: 0000003ffff088e0
[    1.572271]  s11: 00000000000e1637 t3 : 0000000000000000 t4 : 0000003ffff08820
[    1.572655]  t5 : 0000000000000000 t6 : 0000000000000000
[    1.572948] status: 8000000000006020 badaddr: 0000000000000000 cause: 000000000000000d
[    1.574739] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    1.575293] CPU: 0 PID: 1 Comm: init Not tainted 5.8.0-rc5-next-20200715 #1
[    1.575685] Call Trace:
[    1.575970] [<ffffffe000202934>] walk_stackframe+0x0/0xba
[    1.576313] [<ffffffe0004d26e8>] dump_stack+0x9c/0xd8
[    1.576607] [<ffffffe000209442>] panic+0x11c/0x2cc
[    1.576891] [<ffffffe00020bb1a>] exit_mm+0x0/0x134
[    1.577171] [<ffffffe00020bcfa>] do_group_exit+0x70/0x86
[    1.577485] [<ffffffe000215864>] get_signal+0x4ec/0x636
[    1.577779] [<ffffffe000201fea>] do_notify_resume+0x42/0x388
[    1.578086] [<ffffffe0002014a2>] ret_from_exception+0x0/0xc
[    1.578987] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b ]---
+ RET=124
+ set +x

I have done no additional triage beyond the initial bisect and I probably won't have time to do so for quite a while:

$ git bisect log
# bad: [ca0e494af5edb59002665bf12871e94b4163a257] Add linux-next specific files for 20200715
# good: [e9919e11e219eaa5e8041b7b1a196839143e9125] Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
git bisect start 'ca0e494af5edb59002665bf12871e94b4163a257' 'e9919e11e219eaa5e8041b7b1a196839143e9125'
# bad: [8a21074e4724ce86b4e1a8fdc271081a86303014] Merge remote-tracking branch 'crypto/master'
git bisect bad 8a21074e4724ce86b4e1a8fdc271081a86303014
# bad: [4f6c452675e5480e108acf31214280b8362155ec] Merge remote-tracking branch 'hid/for-next'
git bisect bad 4f6c452675e5480e108acf31214280b8362155ec
# good: [074074965e19f8c1a4e5474ec4c210821feb0353] Merge remote-tracking branch 'uniphier/for-next'
git bisect good 074074965e19f8c1a4e5474ec4c210821feb0353
# bad: [585fcbb07daf35b82cded52a779d6c5bfe2e3572] Merge remote-tracking branch 'nfsd/nfsd-next'
git bisect bad 585fcbb07daf35b82cded52a779d6c5bfe2e3572
# bad: [93d7381b4ca61b47c498a2303a8e28dd1f2530a3] Merge remote-tracking branch 'fscrypt/master'
git bisect bad 93d7381b4ca61b47c498a2303a8e28dd1f2530a3
# good: [a9d57272c89ef176b6d4c5b185ef3d8e2806d8f9] Merge remote-tracking branch 'h8300/h8300-next'
git bisect good a9d57272c89ef176b6d4c5b185ef3d8e2806d8f9
# good: [7dbea40fff2de5157ab828c9f4326fd6cdcdcef4] Merge remote-tracking branch 'powerpc/next'
git bisect good 7dbea40fff2de5157ab828c9f4326fd6cdcdcef4
# good: [6589c93f99894e007a1260f009018effc958ab69] s390: add trace events for idle enter/exit
git bisect good 6589c93f99894e007a1260f009018effc958ab69
# good: [41e8333123e25f54476c0d62f0e612f328eefb38] riscv: Add kmemleak support
git bisect good 41e8333123e25f54476c0d62f0e612f328eefb38
# bad: [dcadb5c0f1056114f2d205ac725199faf3a8d899] Merge remote-tracking branch 'sh/for-next'
git bisect bad dcadb5c0f1056114f2d205ac725199faf3a8d899
# bad: [94efd6d16a1bc5a711ac6902a2de7606b739b971] Merge remote-tracking branch 's390/features'
git bisect bad 94efd6d16a1bc5a711ac6902a2de7606b739b971
# bad: [375e2bad2f8c6b7292f5ebf3d43dd4fdfc5baf34] riscv: Add STACKPROTECTOR supported
git bisect bad 375e2bad2f8c6b7292f5ebf3d43dd4fdfc5baf34
# good: [7f2d2223169f596d91dac975574e04669988f17a] riscv: Fix typo in asm/hwcap.h uapi header
git bisect good 7f2d2223169f596d91dac975574e04669988f17a
# first bad commit: [375e2bad2f8c6b7292f5ebf3d43dd4fdfc5baf34] riscv: Add STACKPROTECTOR supported
@nathanchance nathanchance added [BUG] Untriaged Something isn't working [ARCH] risc-v This bug impacts ARCH=riscv [BUG] linux-next This is an issue only seen in linux-next labels Jul 15, 2020
nathanchance added a commit to nathanchance/continuous-integration that referenced this issue Jul 27, 2020
As reported at ClangBuiltLinux/linux#1092.

[skip ci]

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
@nathanchance
Copy link
Member Author

@nathanchance nathanchance added [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.9 This bug was fixed in Linux 5.9 and removed [BUG] Untriaged Something isn't working [BUG] linux-next This is an issue only seen in linux-next labels Aug 26, 2020
nathanchance added a commit to nathanchance/continuous-integration that referenced this issue Aug 26, 2020
This reverts commit 590e483.

This has been fixed: ClangBuiltLinux/linux#1092

Unfortunately, the build will still be broken; still pending
investigation. I am only doing this so that I do not forget.

[skip ci]

Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] risc-v This bug impacts ARCH=riscv [BUG] linux A bug that should be fixed in the mainline kernel. [FIXED][LINUX] 5.9 This bug was fixed in Linux 5.9
Projects
None yet
1 participant