Pluto.jl
Pluto.jl copied to clipboard
Undefined struct field type causes process crash
With Julia 1.11.4 and Pluto v0.20.5 I think when one cell was using broken syntax, the other (independent) cells still worked. With Julia 1.11.5 and Pluto v0.20.6 one broken cell seems to crash the Pluto process and therefore no cell works anymore.
This takes time because the document needs to be calculated from scratch.
I know this is not much, because I am in the middle of something, and therefore do not have a reproducer, but it seemed to happen when using undefined types in structs.
I hope I can complete the report when I have something to work with.
In this case, the cell with the field with the undefined type gets an UndefVarError and all the other cells get an InterruptException: or sometimes a Malt.TerminatedWorkerException().
Ok, I think I boiled it down. The crash can simply be activated and deactivated. This is with Julia 1.11.5:
### A Pluto.jl notebook ###
# v0.20.6
using Markdown
using InteractiveUtils
# ╔═╡ 0f5b68f4-19bd-4bf0-9c57-0f2df367f080
struct MyName
distance::Int
index::Int # If `Int` is changed into `MyError`, Pluto crashes
end
# ╔═╡ 01340cee-5835-4549-9cbd-950db8f6614f
MyName |> sizeof
# ╔═╡ Cell order:
# ╠═0f5b68f4-19bd-4bf0-9c57-0f2df367f080
# ╠═01340cee-5835-4549-9cbd-950db8f6614f
@PatrickHaecker Can you write a regular bug report?
Clearly state:
- what did you do? which steps should i follow?
- what did you see? and what did you expect to see and why?
videos and screenshots help a lot.
And thanks for finding which Julia+Pluto version caused it. Can you find out which of the two (julia or pluto update) is the culprit?
Steps to reproduce:
- Create new Pluto notebook (or empty an existing one)
- Create a cell with the following content:
struct MyName
distance::Int
index::Int # If `Int` is changed into `MyError`, Pluto crashes
end
- Create another cell with the following content:
MyName |> sizeof
- Change the type of the
indexfield intoMyError - Hit
Ctrl+s - Watch the Pluto process crashing
Crash happens for Julia 1.11.5 and Pluto 0.20.6 Crash happens for Julia 1.11.4 and Pluto 0.20.6 Crash happens for Julia 1.11.4 and Pluto 0.20.5 Crash happens for Julia 1.11.4 and Pluto 0.20.1
I weren't able to test Julia 1.11.4 and Pluto 0.19.1 as they didn't work together. I weren't able to test Julia 1.11.5 and Pluto 0.20.5 as they didn't work together.
So it does not seem to be so easy to see which version introduced it and the problem exists for longer than I had experienced. But hopefully the test case is so simple, that regular debugging leads to the root cause.
Thanks! It seems to be broken for all Julia + Pluto versions.
I noticed that the crash happens only once you run a second cell that references MyName. Just running the struct definition does not break.
Yes, that matches my observations.
And that is probably the reason I initially thought it would have to do with a Julia/Pluto update. Probably I introduced some of these references around the same time I updated Julia/Pluto and I only observed the crashes the first time with the updated version, although the problem would have occurred independent of the update.