JuliaLang / IJulia.jl

Julia kernel for Jupyter
MIT License
2.79k stars 410 forks source link

Jupyter notebook freezes after typing "round"... #917

Closed mjherold closed 4 years ago

mjherold commented 4 years ago

The Jupiter notebook running the IJulia kernel seems to freeze up when I execute the following after a fresh start:

x = rand(4)
round.(x, digits=3)

function myround(x; kwargs...)
    round(x; kwargs...)
end

myround(3.223, digits=3)

using Polynomials
myround.(x, digits=3)

The moment I finish typing "round" in the next cell, the notebook seems to freeze up. I am not sure if this is a problem with IJulia or a conflict produced by Polynomials.js. If I wrap "round" in a function then the problem is avoided.

Thank you in advance for any help!

Michael test_round.txt

Julia Version 1.4.1
Commit 381693d3df* (2020-04-14 17:20 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i5-8279U CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_CMDSTAN_HOME = /Users/mj847/Documents/Stan

status output:

Status `~/.julia/environments/v1.4/Project.toml`
  [c52e3926] Atom v0.12.10
  [35d6a980] ColorSchemes v3.7.0
  [5ae59095] Colors v0.12.0
  [f65535da] Convex v0.13.3
  [31c24e10] Distributions v0.22.6
  [2fe49d83] Expectations v1.1.1
  [f6369f11] ForwardDiff v0.10.10
  [60bf3e95] GLPK v0.12.1
  [7073ff75] IJulia v1.21.2
  [c601a237] Interact v0.10.3
  [a98d9a8b] Interpolations v0.12.9
  [b6b21f68] Ipopt v0.6.1
  [42fd0dbc] IterativeSolvers v0.8.4
  [4076af6c] JuMP v0.21.2
  [e5e0dc1b] Juno v0.8.1
  [ba0b0d4f] Krylov v0.5.1
  [5c8ed15e] LinearOperators v1.1.0
  [2fda8390] LsqFit v0.10.0
  [6f286f6a] MultivariateStats v0.7.0
  [429524aa] Optim v0.20.1
  [3b7a836e] PGFPlots v3.2.1
  [91a5bcdd] Plots v1.0.11
  [f27b6e38] Polynomials v0.7.0
  [140ffc9f] ProximalAlgorithms v0.3.1
  [a725b495] ProximalOperators v0.10.3
  [c946c3f1] SCS v0.6.6
  [928aab9d] SpecialMatrices v1.0.0 #master (https://github.com/JuliaMatrices/SpecialMatrices.jl.git)
  [682df890] Stan v6.0.3
  [c1514b29] StanSample v2.1.2
  [2913bbd2] StatsBase v0.32.2
  [29a6e085] Wavelets v0.9.0
  [0f1e0344] WebIO v0.8.13 #master (https://github.com/JuliaGizmos/WebIO.jl)
twavv commented 4 years ago

The moment I finish typing "round" in the next cell, the notebook seems to freeze up. I am not sure if this is a problem with IJulia or a conflict produced by Polynomials.js. If I wrap "round" in a function then the problem is avoided.

Do you mean that the notebook window freezes up? If you open the browser task manager (in Chrome, through the top-right dropdown menu, then More Tools > Task Manager), do you see the tab using 100% of CPU?

If so this might be a CodeMirror bug (I recently discovered a bug where numbers with leading zeros lead to infinite loops in the syntax highlighting process).

stevengj commented 4 years ago

See also #907, #887, which are both codemirror bugs about leading zeros.

stevengj commented 4 years ago

See also codemirror/CodeMirror#6288

stevengj commented 4 years ago

You could try to update your codemirror installation as described here.

With the updated CodeMirror, I'm not having any problems with your code example above, so I'm closing this as fixed upstream.