[GHC] #10159: cabal build/ghc compiler causes sudden hard reboot of my computer!

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! -----------------------------------------+--------------------------------- Reporter: jamshid | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Keywords: | Operating System: Linux Architecture: x86_64 (amd64) | Type of failure: None/Unknown Test Case: | Blocked By: Blocking: | Related Tickets: Differential Revisions: | -----------------------------------------+--------------------------------- I know this sounds pretty nuts, but compiling using ghc, via "cabal build" often suddenly reboots my computer (not the slow "please save your settings" type, but the sudden harsh sound of a relay click and immediate blackness followed by the BIOS screen). This happens somewhat randomly, although the probability of it occurring definitely goes up with a larger codebase. Beyond a certain size, it is pretty much guaranteed to happen. This could possibly have something to do with faulty hardware.... but I am not so sure because.... 1. The reboot only occurs when compiling with GHC. Nothing else (movie watching, compiling with gcc, processing audio, etc) causes this to happen. Furthermore the reboot is as likely to happen on a computer with no other program running as one with tons of background stuff, the ghc build is the only factor. Other than this bug, it is a powerful and reliable machine. 2. The reboot only occurs when I type "cabal build", not "cabal install", even if the project has just been cleaned. If it were just an overheating microprocessor, I would expect the problem to exist in both cases. In fact, as long as I don't type in "cabal build" exactly, I can download large projects (like the ghc compiler source code itself) and build them without a problem. I am even at a loss of what info to give you. I would be happy to supply whatever info you request and even do some debugging. For starters, here is my configuration.... Ubuntu 14.10 Kernel version 3.16.0-31-generic ghc version 7.8.4 cabal-install version 1.22.0.1 using version 1.22.1.1 of the Cabal library CPU- Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz 16GB RAM Motherboard Gigabyte GA-Z87-D3HP I am not sure if logs will be of any use, because I am pretty sure that the sudden nature of the reboot prevents any info from being output.... -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Comment (by thomie): I'm sorry we can't really help you with this. Maybe try a different version of GHC or cabal. Change the `jobs` setting in your ~/.cabal/config file perhaps. Ask on stackoverflow or #haskell. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Comment (by goldfire): I wonder if we can at least get some more information before throwing our hands up in despair. Thanks for the detailed post and addressing some obvious responses (e.g. "That's clearly bogus hardware!") For a given package, does `cabal build` ''always'' trigger the reboot? Or is it just some of the time? (I take it that the odds increase with the size of the package.) Cabal folks: is there a way to get `cabal build` to spit out exactly what it's doing? I don't see a verbosity option in `cabal help build`. My guess, from the description above, is that some cabal behavior is perhaps triggering some latent bug in the GHC runtime. If we could get a record of what cabal is doing -- and find a way to spit a log to some file '''without buffering''' -- we might be able to learn more. But I'm afraid that's where my personal expertise runs out. Any advice from others? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Comment (by refold): Replying to [comment:2 goldfire]:
Cabal folks: is there a way to get `cabal build` to spit out exactly what it's doing?
`cabal build -v3`. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Changes (by rwbarton): * status: new => infoneeded Comment: Maybe build with `-v3` and point a 60 FPS camera at the screen while the build runs? :) -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: infoneeded Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Comment (by jamshid): OK, I've learned more, and have a better idea of what is going on. So, I started monitoring CPU usage during builds, and noticed that when I type in "cabal build", the CPU would go to about 400%, whereas when I type in "cabal install", it tops out at about 99%.... For some reason "cabal install" only uses one core of my CPU, "cabal build" tried to use more. I was able to fix this problem by adding a "ghc-options: -j8" in my cabal file (well, the full line was "ghc-options: -Wall -O2 -j8". As soon as I did this, "cabal install" started crashing my machine also. So, now I am more convinced that I have faulty hardware.... A CPU that overheats when I use multiple cores. There still are some open questions though. First, why doesn't anything else trigger this, even when I rev up all my cores with processes running an empty loop.... and second, why does "cabal install" use 1 core, while "cabal build" uses many (by default). BTW- I did film the build with -v3, but the last comments were pretty nondescript, a bunch of *** CPSZ: *** CPSZ: *** CPSZ: *** CPSZ: *** CPSZ: *** CPSZ: *** CPSZ: I have the full video if you want it, although at this point it seems less important. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: worksforme | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Changes (by thomie): * status: infoneeded => closed * resolution: => worksforme Comment: Replying to [comment:5 jamshid]:
First, why doesn't anything else trigger this, even when I rev up all my cores with processes running an empty loop....
I don't know, but regardless of what ghc does or doesn't do, your computer shouldn't just reboot itself. Try looking elsewhere for the cause of this problem, or workaround it by using `cabal build -jn`, where `n` is smaller than the number of cores you have.
and second, why does "cabal install" use 1 core, while "cabal build" uses many (by default).
For me multiple cores are only used with either `cabal build -j` or `cabal install -j`, or when I set the jobs field in .cabal/cabal.config. If you still get different results, please open an issue with [https://github.com/haskell/cabal/issues cabal]. ghc by default doesn't use multiple cores. I'm closing this bug, as we won't make any progress on it, and there is a workaround. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10159: cabal build/ghc compiler causes sudden hard reboot of my computer! ---------------------------------+----------------------------------------- Reporter: jamshid | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.8.4 Resolution: worksforme | Keywords: Operating System: Linux | Architecture: x86_64 (amd64) Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: ---------------------------------+----------------------------------------- Comment (by gidyn): Replying to [comment:5 jamshid]:
First, why doesn't anything else trigger this, even when I rev up all my cores with processes running an empty loop....
You need a proper CPU stress test. ''What'' the CPU is doing at 100% makes a big difference. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10159#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC