You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(v1.3) pkg> status
Status `~/.julia/environments/v1.3/Project.toml`...
[682c06a0] JSON v0.21.0
[d9ec5142] NamedTupleTools v0.12.1...
julia>versioninfo()
Julia Version 1.3.1
Commit 2d5741174c (2019-12-3021:36 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.6.0)
CPU:Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
WORD_SIZE:64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
If you change the JSON.lower definition to the below then it no longer crashes but correctly runs forever due to the recursion (this is supposed to run forever since lower returns a NamedTuple, which itself needs to be lowered):
The text was updated successfully, but these errors were encountered:
yurivish
changed the title
Bus error when accessing typeof(x).name inside recursive JSON.lower
Bus error from string(typeof(x)) inside JSON.lower
Jan 3, 2020
On macOS Catalina 10.15.1 (19B2106) I definitely get a bus error:
julia> using JSON, NamedTupleTools
julia> JSON.lower(x) = (type=string(typeof(x)), ntfromstruct(x)...)
julia> struct Foo end
julia> JSON.json(Foo())
zsh: bus error julia
This is the best minimal example I've come up with so far. It happens reliably.
If you change the
JSON.lower
definition to the below then it no longer crashes but correctly runs forever due to the recursion (this is supposed to run forever sincelower
returns a NamedTuple, which itself needs to be lowered):The text was updated successfully, but these errors were encountered: