haskell / cabal

Official upstream development repository for Cabal and cabal-install
https://haskell.org/cabal
Other
1.62k stars 697 forks source link

Interrupting cabal-3.8.0.0.20220526 and master with ctrl+c makes it hang on windows #8208

Open jneira opened 2 years ago

jneira commented 2 years ago

I am experiencing some weird behaviour interrupting cabal rc execution with ctrl+c in windows: Doing a ctrl+c in the Configuring component for my package, with ghc-pkg subprocesses, hangs the program with rc1

I cant reproduce with 3.6.0.0

ulysses4ever commented 1 year ago

Mmm, isn't it a bit premature to close it? Has anyone actually tried it on cabal?

Mistuke commented 1 year ago

Github closed it because it was linked

jneira commented 1 year ago

Hi, I have tried build cabal using process including the mentioned patch and i am afraid i continue experiencing it:

PS D:\dev\ws\haskell\cabal> git rev-parse HEAD
6c95f3fee3cdee859704b6476646cefd4628a850
PS D:\dev\ws\haskell\cabal> cat .\cabal.project | grep "process"
packages: ../process
PS D:\dev\ws\haskell\cabal> cd ../process
PS D:\dev\ws\haskell\process> git rev-parse HEAD
9dbb520d711b59f6ccaf32980fb794a369a3e9ed
PS D:\dev\ws\haskell\process> cd ../cabal
PS D:\dev\ws\haskell\cabal> cabal build cabal-install --disable-tests --disable-benchmarks
Resolving dependencies...
Up to date
PS D:\dev\ws\haskell\cabal> cabal list-bin cabal-install
D:\dev\ws\haskell\cabal\dist-newstyle\build\x86_64-windows\ghc-8.10.7\cabal-install-3.10.1.0\x\cabal\build\cabal\cabal.exe
PS D:\dev\ws\haskell\cabal> cd ../cabal-test
PS D:\dev\ws\haskell\cabal-test> D:\dev\ws\haskell\cabal\dist-newstyle\build\x86_64-windows\ghc-8.10.7\cabal-install-3.10.1.0\x\cabal\build\cabal\cabal.exe build
Warning: this is a debug build of cabal-install with assertions enabled.
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - hsc2hs-0.68.9 (exe:hsc2hs) (requires build)
 - network-3.1.2.8 (lib:network) (requires build)
 - cabal-test-0.1.0.0 (lib) (first run)
 - cabal-test-0.1.0.0 (exe:cabal-test) (first run)
Configuring executable 'hsc2hs' for hsc2hs-0.68.9..

In the las line i pressed ctrl+c and the execution was blocked 😞

Mikolaj commented 1 year ago

I wonder what version of process this binary (cabal-install-3.10.1.0 for Windows) has been built with... If that's the standard binary, coming from https://gitlab.haskell.org/haskell/cabal/-/pipelines/64225, we use there quite an old GHC and also needlessly old minor version of the GHC (TODO, PR welcome).

Mistuke commented 1 year ago

Hi, I have tried build cabal using process including the mentioned patch and i am afraid i continue experiencing it: ...



In the las line i pressed ctrl+c and the execution was blocked 😞

That's weird, lets first confirm it's stuck on the same issue :). Could you upload the binary that's failing again, and could you also do a new trace with process spy as before?

The new code in process shouldn't be able to deadlock unless the child process never actually exits.

Second question, could you like me to the cabal code that handles ctrl+c?

Mistuke commented 1 year ago

Also it would be very handy if you could replicate the issue with a standalone reproducer like the one in https://github.com/haskell/process/issues/273 this would likely increase my chances of reproducing the issue as it removes some timing variability.

jasagredo commented 3 months ago

I don't seem to get this behavior anymore with newer cabals. It works properly as expected. Unless a clear reproducer is provided I guess we can close this issue.