Julia 'sometimes' hangs (until a key is pressed) - Windows10 - Does anybody ever encounter that?

Sometimes when I am calculating a lot of ‘models’ Julia will hang. This happens in ‘cmd’ but also with Powershell.

In my case, my code continuously produces output to the console (files that are being written, progress, …).
When there is no new output to the console for quite some time the program ‘hangs’ (in my view).
When I press any key, the code will continue.

Unfortunately, I cannot share the code I am running. Apologies for that.
I am using the packages below thought (from python I use xlsxwriter and pandas).

Has anyone ever encountered something like that?

Sometimes this happens with the REPL, sometimes it happens when I directly invoke julia.exe with a *.jl file.

I can see that you will probably want to see my code, to better understand my problem. I can see whether I can create an MWE. It would seem that it is probably an issue somewhere in my code, but I thought it wouldn’t hurt to ask.

Also, I can check what the process is doing (cpu/memory) next time I encounter this. Notably, I cannot reproduce it right now.

using OnlineStats, StatsFuns, SQLite, DataFrames, DataArrays, ProgressMeter, Iterators, PyCall, HDF5, JLD

Luckily Julia got stuck again and I was able to take a screenshot!![code_which was running|690x144]

Picture 1: the code which was running (readtable in this case)
Picture 2: Julia being stuck (task manager shows ‘nothing’…)
Picture 3: Julia continues after I click a button.

Interestingly the time reported to read the file is ‘correct’.
I do not know how long it was stuck (maybe 30minutes or so), but it was certainly more than 10s.
(the second time which is shown is from additional code that is not shown)


IIRC I’ve seen something similar when Pkg.update()ing, where the REPL got stuck but could be convinced to do something again by pressing Enter a couple of times.


I’ve also seen something similar where a function will seem to run indefinitely / hang, but as soon as enter is pressed once or twice, the result pops out and the REPL is once again responsive.

1 Like

Ok. Thanks for your replies.
I normally just press a random key (a letter in general), but certainly, Enter would do the job as well.

Obviously, the behavior can be annoying when one wants to run something that takes a while (only to come back to the terminal/computer and find it actually ‘paused’ for no reason)

I note that this is still happening in 0.7-dev.

I just had Julia hang during Pkg.update() (until I pressed enter).
It is not too big of an issue, but it can be annoying. And I would say, it can be furstrating, if not bizarre, for new users.

I had the same in Windows 10 when running in a VM and trying out some Pkg3 functionality. Was very odd.

Did you accidentally highlight something in the console (e.g. by making a selection with your mouse)? Windows will suspend all output in that case (i.e. block the program) until the selection is cleared (e.g. by pressing a key).

No I did not.
At times I will bring a different window into focus or minimize the console, but that should be fine as far as I know.
May some of the others can add their experience. As far as I can tell it is rather random (and rare).

I’m encountering a similar issue while estimating some parameters of a model. I left code running over weekend hoping to come back to some estimated parameters, but turns out the julia paused (and then unpaused when I pressed a key this morning) - it was running in cmd

This is a bug in the Windows command prompt, it can be fixed by disabling the QuickEdit mode (right click on the title bar -> Properties or Defaults for all future prompts). The new Windows terminal does not have these issues, but I have experienced it randomly crashing after long running times.


It isn’t really a bug (https://stackoverflow.com/a/30517482/10447964). It is just a really dumb feature.