DanielG / ghc-mod

Happy Haskell Hacking for editors. DEPRECATED
Other
677 stars 175 forks source link

Freezes when using automounts in home dir #774

Closed japgolly closed 7 years ago

japgolly commented 8 years ago

From /tmp:

golly@golly-laptop: /tmp 
> ghc-mod --verbose 7 debug
Root directory:       /tmp
Current directory:    /tmp
GHC Package flags:
    -i/tmp -i/tmp -global-package-db -user-package-db -Wall
GHC System libraries: /usr/lib/ghc-7.10.3
GHC user options:

From ~, from an empty ~/1/1 and from a project in ~/projects/blah/blah, running ghc-mod --verbose 7 debug (anything else) causes it to hang. Running it from /tmp or /home it works.

I've cleared and reinstalled ghc, cabal, stack, ghc-mod many times. Same goes for all the settings dirs. I've tried installing and running ghc-mod via cabal and via stack.

Versions:

golly@golly-laptop: /tmp 
> cabal --version
cabal-install version 1.22.9.0
using version 1.22.5.0 of the Cabal library 
golly@golly-laptop: /tmp 
> ghc --version  
The Glorious Glasgow Haskell Compilation System, version 7.10.3
golly@golly-laptop: /tmp 
> stack --version
Version 1.0.4.2 i386
golly@golly-laptop: /tmp 
> cabal list ghc-mod
* ghc-mod
    Synopsis: Happy Haskell Programming
    Default available version: 5.5.0.0
    Installed versions: 5.5.0.0
    Homepage: http://www.mew.org/~kazu/proj/ghc-mod/
    License:  AGPL-3
DanielG commented 8 years ago

That is really strange. It just hangs instantly? No output even with --verbose? Weird. I'd get out strace and maybe gdb (now that there's DWARF support) to find out what if anything it does just before it hangs.

DanielG commented 8 years ago

Erm and what OS are you using etc.

japgolly commented 8 years ago

I'm on Arch Linux. Yeah no output even with --verbose.

I know what the problem is. I was on my laptop away from home. In my /etc/fstab I have some home-network drives that automount (which weren't mounting with me not being at home). In my home directory I have a symlink to a another directory on the network drive. When I commented-out my network drive entries in fstab and rebooted, viola! Problem goes away and ghc-mod works again!

So it's really weird that ghc-mod would freeze like that for an unrelated file in my home dir. Is it scanning everything? If so, maybe it should be more selective. If it must, then maybe it should make some more noise when --verbose is flagged.

DanielG commented 8 years ago

Sounds like running strace -e trace=open,stat ... on it would reveal the blocking read. Probably something related to searching for the project root but why guess when you can know for sure :)