
Friends I'm trying to update my installation of alex, on Unix (Ubuntu). But I get the dump below It's complaining about a lock file being an invalid argument (see highlight below). If I manually remove the file I get past that, it successfully installs tf-random, but the same thing happens on the next package. So I can install packages one at a time, but that's silly. Any ideas? Simon cabal install alex Resolving dependencies... Configuring tf-random-0.5... Building tf-random-0.5... Failed to install tf-random-0.5 Build log ( /home/simonpj/.cabal/logs/tf-random-0.5.log ): cabal: Entering directory '/tcabal mp/cabal-tmp-26141/tf-random-0.5' Configuring tf-random-0.5... Building tf-random-0.5... Preprocessing library tf-random-0.5... [1 of 4] Compiling System.Random.TF.Gen ( src/System/Random/TF/Gen.hs, dist/build/System/Random/TF/Gen.o ) [2 of 4] Compiling System.Random.TF.Init ( src/System/Random/TF/Init.hs, dist/build/System/Random/TF/Init.o ) src/System/Random/TF/Init.hs:94:5: warning: [-Wdeprecations] In the use of 'bitSize' (imported from Data.Bits): Deprecated: "Use 'bitSizeMaybe' or 'finiteBitSize' instead" | 94 | | bitSize n > 64 = error "mkTFGen: case where size of Int > 64 not implemented" | ^^^^^^^ [3 of 4] Compiling System.Random.TF ( src/System/Random/TF.hs, dist/build/System/Random/TF.o ) [4 of 4] Compiling System.Random.TF.Instances ( src/System/Random/TF/Instances.hs, dist/build/System/Random/TF/Instances.o ) Creating package registration file: /tmp/pkgConf-tf-random-05965166491189641421.5 Installing library in /home/simonpj/.cabal/lib/x86_64-linux-ghc-8.2.1/tf-random-0.5-ABDhxe3mXYlHUEE5hzgewx Registering tf-random-0.5... cabal: '/usr/local/bin/ghc-pkg' exited with an error: ghc-pkg: Couldn't open database /home/simonpj/.ghc/x86_64-linux-8.2.1/package.conf.d for modification: {handle: /home/simonpj/.ghc/x86_64-linux-8.2.1/package.conf.d/package.cache.lock}: hLock: invalid argument (Bad file descriptor) cabal: Leaving directory '/tmp/cabal-tmp-26141/tf-random-0.5' cabal: Error: some packages failed to install: QuickCheck-2.10.0.1 depends on tf-random-0.5 which failed to install. alex-3.2.1 depends on tf-random-0.5 which failed to install. tf-random-0.5 failed during the final install step. The exception was: ExitFailure 1 simonpj@cam-05-unx:~/code/HEAD$

Simon Peyton Jones via ghc-devs
Friends I'm trying to update my installation of alex, on Unix (Ubuntu). But I get the dump below It's complaining about a lock file being an invalid argument (see highlight below). If I manually remove the file I get past that, it successfully installs tf-random, but the same thing happens on the next package. So I can install packages one at a time, but that's silly.
Hmm. Here's a shot in the dark: is home home directory mounted via NFS by any chance? Cheers, - Ben

On Fri, Aug 18, 2017 at 8:04 AM, Ben Gamari
Simon Peyton Jones via ghc-devs
writes: I'm trying to update my installation of alex, on Unix (Ubuntu). But I get the dump below It's complaining about a lock file being an invalid argument (see highlight below). If I manually remove the file I get past that, it successfully installs tf-random, but the same thing happens on the next package. So I can install packages one at a time, but that's silly.
Hmm. Here's a shot in the dark: is home home directory mounted via NFS by any chance?
I was thinking CIFS, but pretty much the same issue. Or NTFS via FUSE module. -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

| Hmm. Here's a shot in the dark: is home home directory mounted via NFS by
| any chance?
Direct hit! (for the shot in the dark). Yes it's NFS mounted I think. So what?
Simon
| -----Original Message-----
| From: Ben Gamari [mailto:ben@smart-cactus.org]
| Sent: 18 August 2017 13:05
| To: Simon Peyton Jones

On Sat, Aug 19, 2017 at 12:43 AM, Simon Peyton Jones via ghc-devs
| Hmm. Here's a shot in the dark: is home home directory mounted via NFS by | any chance?
Direct hit! (for the shot in the dark). Yes it's NFS mounted I think. So what?
Then you're another victim of https://ghc.haskell.org/trac/ghc/ticket/13945 :-/

| Then you're another victim of
|
| https://ghc.haskell.org/trac/ghc/ticket/13945
[Reads ticket]. Blimey. This looks serious. As in release-blocker (except that we have released). Why does it only happen with 8.2.1? The ticket has no how-to-fix plan.
Simon
| -----Original Message-----
| From: Herbert Valerio Riedel [mailto:hvriedel@gmail.com]
| Sent: 18 August 2017 23:53
| To: Simon Peyton Jones

Simon Peyton Jones
| Then you're another victim of | | https://ghc.haskell.org/trac/ghc/ticket/13945
Oh dear, yes, it looks like I lost track of this one.
[Reads ticket]. Blimey. This looks serious. As in release-blocker (except that we have released). Why does it only happen with 8.2.1? The ticket has no how-to-fix plan.
The problem is that we don't really know what the issue is yet. Some have hypothesized that it's due to SELinux, I suspect the problem is NFS. Perhaps there are multiple issues. More information about the environments under which this is observed would certainly be helpful. If someone could describe their environment I would be happy to try reproducing and investigate. Cheers, - Ben

Simon Peyton Jones
| Hmm. Here's a shot in the dark: is home home directory mounted via NFS by | any chance?
Direct hit! (for the shot in the dark). Yes it's NFS mounted I think. So what?
Well, as others have pointed out NFS and locking tends to be a bit of a can of worms. Some broken systems don't even run the locking daemon by default; even when configured properly locking can still be problematic, especially under contention (although I doubt this is the case in your situation). It's been quite a while since I have configured NFS, but IIRC one thing to verify is that there is at least one lockd process and one portmapper process running. I doubt this is problematic under Ubuntu in 2017, but it's worth checking. It might also be a good idea to grab an strace log of ghc-pkg to see what precisely is going on. Perhaps also check the system log. Regardless, we should try getting to the bottom of this; ghc-pkg failing is quite bad, even if the system's locking configuration happens to be broken. Cheers, - Ben

Simon Peyton Jones
| Hmm. Here's a shot in the dark: is home home directory mounted via NFS by | any chance?
Direct hit! (for the shot in the dark). Yes it's NFS mounted I think. So what?
Hi Simon, Sorry for the rather belated reply; I was knocked off my feet for a few days by a rather nasty tetanus vaccination. Anyways, I have a patch which I suspect will help. It seems that some NFS implementations incur a rather long delay (order of seconds) between the time a file handle is closed and an open flock lock on the handle being released. I suspect this delay won't exist in cases where we explicitly funlock before closing the file handle. I have implemented this in wip/ghc-pkg-locking. Do you think you could give this branch a try? If it still fails then we'll have to try to debug things in-situ. Cheers, - Ben

| I have implemented this in wip/ghc-pkg-locking. Do you think you could give
| this branch a try? If it still fails then we'll have to try to debug things
| in-situ.
Alas, no go.
* I'm on wip/ghc-pkg-locking
* I checked that the lock file was removed
then I tried this:
simonpj@cam-05-unx:~/code/HEAD-2$ cabal install lens --with-ghc=/home/simonpj/5builds/HEAD-2/inplace/bin/ghc-stage2
Resolving dependencies...
Configuring base-orphans-0.6...
Configuring cabal-doctest-1.0.2...
Configuring call-stack-0.1.0...
Configuring fail-4.9.0.0...
Configuring hashable-1.2.6.1...
Configuring parallel-3.2.1.1...
Configuring prelude-extras-0.4.0.3...
Configuring primitive-0.6.2.0...
Configuring reflection-2.1.2...
Configuring semigroups-0.18.3...
Configuring stm-2.4.4.1...
Configuring th-abstraction-0.2.5.0...
Configuring transformers-compat-0.5.1.4...
Configuring void-0.7.2...
Building base-orphans-0.6...
Building cabal-doctest-1.0.2...
Building fail-4.9.0.0...
Building call-stack-0.1.0...
Building parallel-3.2.1.1...
Building hashable-1.2.6.1...
Building primitive-0.6.2.0...
Building prelude-extras-0.4.0.3...
Building reflection-2.1.2...
Building semigroups-0.18.3...
Building stm-2.4.4.1...
Building void-0.7.2...
Building th-abstraction-0.2.5.0...
Building transformers-compat-0.5.1.4...
Installed fail-4.9.0.0
Failed to install base-orphans-0.6
Build log ( /home/simonpj/.cabal/logs/base-orphans-0.6.log ):
cabal: Entering directory '/tmp/cabal-tmp-28239/base-orphans-0.6'
Configuring base-orphans-0.6...
Building base-orphans-0.6...
Preprocessing library base-orphans-0.6...
[1 of 2] Compiling Data.Orphans ( src/Data/Orphans.hs, dist/build/Data/Orphans.o )
[2 of 2] Compiling Data.Orphans.Prelude ( src/Data/Orphans/Prelude.hs, dist/build/Data/Orphans/Prelude.o )
Creating package registration file:
/tmp/pkgConf-base-orphans-010599613932089018456.6
Installing library in
/home/simonpj/.cabal/lib/x86_64-linux-ghc-8.3.20170825/base-orphans-0.6-9iPDLrUqQ5yHb9fb9OUZ9L
Registering base-orphans-0.6...
cabal: '/home/simonpj/5builds/HEAD-2/inplace/bin/ghc-pkg' exited with an
error:
ghc-pkg: Couldn't open database
/home/simonpj/.ghc/x86_64-linux-8.3.20170825/package.conf.d for modification:
{handle:
/home/simonpj/.ghc/x86_64-linux-8.3.20170825/package.conf.d/package.cache.lock}:
hLock: invalid argument (Bad file descriptor)
cabal: Leaving directory '/tmp/cabal-tmp-28239/base-orphans-0.6'
Failed to install void-0.7.2
Build log ( /home/simonpj/.cabal/logs/void-0.7.2.log ):
cabal: Entering directory '/tmp/cabal-tmp-28252/void-0.7.2'
Configuring void-0.7.2...
Building void-0.7.2...
Preprocessing library void-0.7.2...
[1 of 1] Compiling Data.Void.Unsafe ( src/Data/Void/Unsafe.hs, dist/build/Data/Void/Unsafe.o )
Creating package registration file: /tmp/pkgConf-void-0.76281750111656478042.2
Installing library in
/home/simonpj/.cabal/lib/x86_64-linux-ghc-8.3.20170825/void-0.7.2-KNNEd7XG9bDRysTndgnf2
Registering void-0.7.2...
cabal: '/home/simonpj/5builds/HEAD-2/inplace/bin/ghc-pkg' exited with an
error:
ghc-pkg: Couldn't open database
/home/simonpj/.ghc/x86_64-linux-8.3.20170825/package.conf.d for modification:
{handle:
/home/simonpj/.ghc/x86_64-linux-8.3.20170825/package.conf.d/package.cache.lock}:
hLock: invalid argument (Bad file descriptor)
cabal: Leaving directory '/tmp/cabal-tmp-28252/void-0.7.2'
Failed to install semigroups-0.18.3
Build log ( /home/simonpj/.cabal/logs/semigroups-0.18.3.log ):
cabal: Entering directory '/tmp/cabal-tmp-28248/semigroups-0.18.3'
Configuring semigroups-0.18.3...
Building semigroups-0.18.3...
Preprocessing library semigroups-0.18.3...
[1 of 1] Compiling Data.Semigroup.Generic ( src/Data/Semigroup/Generic.hs, dist/build/Data/Semigroup/Generic.o )
Creating package registration file:
/tmp/pkgConf-semigroups-0.188594844211914544919.3
Installing library in
/home/simonpj/.cabal/lib/x86_64-linux-ghc-8.3.20170825/semigroups-0.18.3-9GRyDnRvoqO5HfdYR3Qz4o
Registering semigroups-0.18.3...
cabal: '/home/simonpj/5builds/HEAD-2/inplace/bin/ghc-pkg' exited with an
error:
ghc-pkg: Couldn't open database
/home/simonpj/.ghc/x86_64-linux-8.3.20170825/package.conf.d for modification:
{handle:
/home/simonpj/.ghc/x86_64-linux-8.3.20170825/package.conf.d/package.cache.lock}:
hLock: invalid argument (Bad file descriptor)
cabal: Leaving directory '/tmp/cabal-tmp-28248/semigroups-0.18.3'
C-c C-c
simonpj@cam-05-unx:~/code/HEAD-2$
| -----Original Message-----
| From: Ben Gamari [mailto:ben@well-typed.com]
| Sent: 24 August 2017 13:53
| To: Simon Peyton Jones

Simon Peyton Jones via ghc-devs
| I have implemented this in wip/ghc-pkg-locking. Do you think you could give | this branch a try? If it still fails then we'll have to try to debug things | in-situ.
Alas, no go.
Hmm, alright then. What do the following say, * ps -Af | grep lockd * ps -Af | grep portmap * ps -Af | grep rpcbind * mount | grep nfs Cheers, - Ben

| Hmm, alright then. What do the following say,
|
| * ps -Af | grep lockd
| * ps -Af | grep portmap
| * ps -Af | grep rpcbind
| * mount | grep nfs
|
simonpj@cam-05-unx:~/tmp$ ps -Af | grep locd
simonpj 20138 1184 0 12:46 pts/7 00:00:00 grep locd
simonpj@cam-05-unx:~/tmp$ ps -Af | grep portmap
simonpj 22601 1184 0 12:46 pts/7 00:00:00 grep portmap
simonpj@cam-05-unx:~/tmp$ ps -Af | grep rpcbind
root 1472 1 0 2016 ? 00:00:13 rpcbind -w
simonpj 26634 1184 0 12:46 pts/7 00:00:00 grep rpcbind
simonpj@cam-05-unx:~/tmp$ mount | grep nfs
camresunxa02:/home on /home type nfs (rw,intr,vers=4,addr=10.190.50.19,clientaddr=10.190.108.81)
| -----Original Message-----
| From: Ben Gamari [mailto:ben@well-typed.com]
| Sent: 25 August 2017 17:46
| To: Simon Peyton Jones
participants (5)
-
Ben Gamari
-
Ben Gamari
-
Brandon Allbery
-
Herbert Valerio Riedel
-
Simon Peyton Jones