Skip to content

Undefined struct field type causes process crash #3195

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
PatrickHaecker opened this issue Apr 17, 2025 · 7 comments
Open

Undefined struct field type causes process crash #3195

PatrickHaecker opened this issue Apr 17, 2025 · 7 comments
Labels
bug Something isn't working

Comments

@PatrickHaecker
Copy link

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.

@PatrickHaecker
Copy link
Author

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().

@PatrickHaecker
Copy link
Author

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

@fonsp
Copy link
Owner

fonsp commented Apr 21, 2025

@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.

@fonsp
Copy link
Owner

fonsp commented Apr 21, 2025

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?

@PatrickHaecker
Copy link
Author

PatrickHaecker commented Apr 22, 2025

Steps to reproduce:

  1. Create new Pluto notebook (or empty an existing one)
  2. Create a cell with the following content:
struct MyName
	distance::Int
	index::Int # If `Int` is changed into `MyError`, Pluto crashes
end
  1. Create another cell with the following content:
MyName |> sizeof
  1. Change the type of the index field into MyError
  2. Hit Ctrl+s
  3. 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.

@fonsp fonsp changed the title Update to Julia 1.11.5 and Pluto v0.20.6 decreased robustness Undefined struct field type causes process crash Apr 23, 2025
@fonsp fonsp added the bug Something isn't working label Apr 23, 2025
@fonsp
Copy link
Owner

fonsp commented Apr 23, 2025

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.

@PatrickHaecker
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants