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

x86_64 allyesconfig build hang #330

Closed
nickdesaulniers opened this issue Jan 26, 2019 · 14 comments
Closed

x86_64 allyesconfig build hang #330

nickdesaulniers opened this issue Jan 26, 2019 · 14 comments
Assignees
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 asm goto related to the implementation of asm goto [BUG] llvm A bug that should be fixed in upstream LLVM unreproducible Not or no longer reproducible wontfix This will not be worked on

Comments

@nickdesaulniers
Copy link
Member

forking from #319 ; it seems that D53765 diff 183714 the build seems to be hanging.

I'm not sure how to provide feedback to help debug; I feel like I'd need to dump the cycle of optimizations we keep bouncing between? Maybe a preprocessed source and command line flags are a good starting point?

@nickdesaulniers nickdesaulniers added [BUG] llvm A bug that should be fixed in upstream LLVM [ARCH] x86_64 This bug impacts ARCH=x86_64 asm goto related to the implementation of asm goto labels Jan 26, 2019
@nickdesaulniers
Copy link
Member Author

export.zip let me know if that works, @topperc

@nickdesaulniers
Copy link
Member Author

seems to be KASAN related (cc @dvyukov @ramosian-glider ).

$ make CC=clang allyesconfig
$ ./scripts/config -d KASAN
$ make CC=clang arch/x86/mm/fault.o
$ file arch/x86/mm/fault.o 
arch/x86/mm/fault.o: ELF 64-bit LSB relocatable, x86-64, version 1 (SYSV), not stripped

(I used menuconfig to turn off KASAN properly)

@nickdesaulniers
Copy link
Member Author

seems to be KASAN related

maybe not, even with KASAN disabled, I'm seeing different hangs:

~ ps -ef | grep clang | rev | cut -d " " -f 1 | rev | grep c$ | sort | uniq | wc -l
17
➜  ~ ps -ef | grep clang | rev | cut -d " " -f 1 | rev | grep c$ | sort | uniq        
drivers/ata/sata_dwc_460ex.c
drivers/char/pcmcia/cm4000_cs.c
drivers/extcon/extcon-max77843.c
drivers/i2c/busses/i2c-taos-evm.c
drivers/infiniband/hw/cxgb4/qp.c
drivers/pinctrl/intel/pinctrl-cherryview.c
drivers/spi/spi-topcliff-pch.c
drivers/tty/serial/sh-sci.c
drivers/usb/mtu3/mtu3_gadget.c
net/ipv6/netfilter/ip6t_rt.c
sound/pci/echoaudio/darla20.c
sound/pci/echoaudio/darla24.c
sound/pci/echoaudio/gina20.c
sound/pci/echoaudio/layla20.c
sound/pci/hda/patch_realtek.c
sound/soc/codecs/wm_adsp.c
sound/x86/intel_hdmi_audio.c

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Jan 27, 2019

Another reproducer

@nickdesaulniers
Copy link
Member Author

removing -fsanitize-coverage=trace-pc or -fsanitize-coverage=trace-cmp seems to help. Maybe these can't be used together?

@topperc
Copy link

topperc commented Jan 27, 2019

export.zip is hanging in BranchFolding.cpp operating on the function do_user_addr_fault. Waiting on a build with debug symbols so I can run lldb.

@nickdesaulniers
Copy link
Member Author

nickdesaulniers commented Jan 27, 2019

-fsanitize-coverage=trace-pc is added by CC_HAS_SANCOV_TRACE_PC which is depended on by CONFIG_KCOV. Turning that off, we can proceed. So allyesconfig minus CONFIG_KCOV I can proceed with both the second reproducer and the first. (KASAN not related)

Going to try to do a full build minus kcov, but it seems the diagnosis is that -fsanitize-coverage=trace-pc or -fsanitize-coverage=trace-cmp is currently broken with the current asm goto patch implementation.

@nickdesaulniers nickdesaulniers changed the title x86_64 allyesconfig build hung -fsanitize-coverage causes x86_64 allyesconfig build hang Jan 27, 2019
@nickdesaulniers nickdesaulniers removed their assignment Jan 27, 2019
@nickdesaulniers
Copy link
Member Author

but it seems the diagnosis is that -fsanitize-coverage=trace-pc or -fsanitize-coverage=trace-cmp is currently broken with the current asm goto patch implementation.

Spoke too soon. Still seeing hangs... let me see if I can diagnose further.

@nickdesaulniers nickdesaulniers changed the title -fsanitize-coverage causes x86_64 allyesconfig build hang x86_64 allyesconfig build hang Jan 27, 2019
@nickdesaulniers nickdesaulniers self-assigned this Jan 27, 2019
@nickdesaulniers
Copy link
Member Author

so turning off KASAN helped one of the problematic translation units build. Maybe it's BOTH KCOV AND KASAN that are broken (for different translations). Let me try that.

@topperc
Copy link

topperc commented Jan 27, 2019

Just put up a new patch that let me get through export.zip

@nickdesaulniers
Copy link
Member Author

w/ D53765 diff 183738 I can no longer repro hangs with the two above cases. Running an allyesconfig to triple check, but this is likely fixed. Will then revisit #319 .

@dileks
Copy link

dileks commented Jan 27, 2019

w/ D53765 diff 183738 I have also no hanging. I can boot into QEMU, but on bare metal I get...

Kernel panic - not syncing: stack-protector: Kernel stack is corrupted in intel_idle_probe

UPDATE: My kernel-config is attached.

config-5.0.0-rc3-3-amd64-cbl.txt

@nickdesaulniers
Copy link
Member Author

That's not good, but I wouldn't bother trying to boot on metal until #319 is solved.

@dileks
Copy link

dileks commented Jan 28, 2019

$ make CC=clang arch/x86/mm/fault.o

I had seen such breakage before without CONFIG_KASAN and CONFIG_KCOV set. My latest build was fine with D53765 diff 183738 (no breakage in arch/x86/mm/fault.o).

Can you comment why I can boot in QEMU (just curious)?

@nickdesaulniers nickdesaulniers added wontfix This will not be worked on and removed wontfix This will not be worked on labels May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[ARCH] x86_64 This bug impacts ARCH=x86_64 asm goto related to the implementation of asm goto [BUG] llvm A bug that should be fixed in upstream LLVM unreproducible Not or no longer reproducible wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

5 participants