hackage-security icon indicating copy to clipboard operation
hackage-security copied to clipboard

May be a case where hackage-security client uses 100% CPU and does not terminate

Open mgsloan opened this issue 8 years ago • 4 comments

See this stack issue: https://github.com/commercialhaskell/stack/issues/3572

Assuming it's from a relatively recent version of stack, this is likely a bug in hackage-security.

mgsloan avatar Nov 14 '17 01:11 mgsloan

Is there any chance to get a reasonably reliable repro-case? It's going to be quite difficult to track this down without additional information; and from the logging output in that ticket it's not clear to me which entry-point into hackage-security got stuck.

hvr avatar Nov 14 '17 09:11 hvr

how can I give useful log-output. I have this as a docker image so it's fairly easy to repro.

alexanderkjeldaas avatar Nov 14 '17 20:11 alexanderkjeldaas

@alexanderkjeldaas That sounds promising! I'm not familiar with Stack, but I'd try turning up verbosity to the max in the hopes to get as much log-messages from hackage-security (as well as from the transport layer; if there doesn't appear to be enough logging for the transport layer, tcpdump would be worth a try) emitted as possible. If this also doesn't give enough hints, good old printf-style debugging might be in order...; but let's cross that bridge when we come to it...

hvr avatar Nov 14 '17 21:11 hvr

I do not think that verbosity is likely to help much. Stack does very little between Updating package index ... and running code from hackage security. In all codepaths after hackage security returns, there are further messages.

However, it may be helpful to know that -v --cabal-verbose is the max verbosity (verbose stack logs + verbose cabal logs). This will not have an effect on the output of hackage security, because it doesn't seem to have verbosity settings. The function we are passing in for it to use for output (7th argument of withRepossitory), is a function that always outputs regardless of verbosity level.

mgsloan avatar Nov 15 '17 15:11 mgsloan