JunoLab / Juno.jl

MIT License
144 stars 23 forks source link

println("...") sometimes does not work #617

Open Volker-Weissmann opened 3 years ago

Volker-Weissmann commented 3 years ago

In some cases, println("...") reproducible does not print anything when run in Juno. This is a critical bug.

How to reproduce:

Open a file in Juno with the following contents:

println("beginning of the program")
using DifferentialEquations
prob = ODEProblem((u,p,t) -> -u, 0, (0.0, 1.0))
println("starting to solve dgl")
sol = solve(prob, Tsit5())
println("solved dgl")
println("end of program")

Press Ctrl + Shift + Enter to "Run all". The output is:

Press Enter to start Julia. 
Starting Julia...
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

starting to solve dgl
solved dgl
end of program

julia> 

Notice, how there is no "beginning of the program" in the output. Press Ctrl + Shift + Enter to "Run all" again, and the output is:

Press Enter to start Julia. 
Starting Julia...
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.3 (2020-11-09)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |

starting to solve dgl
solved dgl
end of program

starting to solve dgl
solved dgl
end of program
beginning of the program

solved dgl
end of program

julia> 

Notice how there is no second "starting to solve dgl" in the output.

Device info: I can reproduce this bug on two separate machines.

OS: Arch Linux

$ atom --version
Atom    : 1.53.0
Electron: 6.1.12
Chrome  : 76.0.3809.146
Node    : 12.4.0
$ julia --version
julia version 1.5.3
jullit31 commented 2 years ago

I don't know if this helps, but I found an even simpler way to produce this error:

for _ in 1:10^8
    rand()
end
print("test1")
print("test2")
print("test3")

outputs test2test3. Interestingly, running only 10^7 iterations of the loop, produces the correct output. As does running the script in PowerShell instead of Juno.

OS: Windows 10

> atom --version
Atom    : 1.56.0
Electron: 9.4.4
Chrome  : 83.0.4103.122
Node    : 12.14.1
> julia --version
julia version 1.6.2