Skip to content
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

Segfault from NTuple{N,Base.RefValue{...}} on Julia 1.7.1+ #55076

Closed
MilesCranmer opened this issue Jul 8, 2024 · 3 comments · Fixed by #55405
Closed

Segfault from NTuple{N,Base.RefValue{...}} on Julia 1.7.1+ #55076

MilesCranmer opened this issue Jul 8, 2024 · 3 comments · Fixed by #55405
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@MilesCranmer
Copy link
Member

MilesCranmer commented Jul 8, 2024

On Julia 1.7.1+, running the following valid code will cause a segfault and crash. Julia 1.7.0 is the last version which is not affected.

struct Node{D}
    children::NTuple{D,Base.RefValue{Node{D}}}
    Node(::Val{_D}) where {_D} = new{_D}()
end

Node(Val(2))

with the following traceback

[26695] signal (11.2): Segmentation fault: 11
in expression starting at /Users/mcranmer/PermaDocuments/SymbolicRegressionMonorepo/DynamicExpressions.jl/src/bug_report.jl:18
jl_compute_field_offsets at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/datatype.c:511
jl_struct_try_layout at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/datatype.c:342 [inlined]
jl_datatype_isinlinealloc at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/datatype.c:349 [inlined]
union_isinlinable at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/datatype.c:374
ijl_islayout_inline at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/datatype.c:397 [inlined]
jl_compute_field_offsets at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/datatype.c:577
inst_datatype_inner at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2193
inst_type_w_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2484
inst_type_w_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2438
inst_tuple_w_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2315
inst_ftypes at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2258
inst_datatype_inner at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2182
inst_type_w_ at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:2484
ijl_instantiate_unionall at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:1456 [inlined]
ijl_apply_type at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jltypes.c:1388
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1982 [inlined]
do_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/builtins.c:768
apply_type_tfunc at ./compiler/tfuncs.jl:1860
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1982 [inlined]
do_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/builtins.c:768
builtin_tfunction at ./compiler/tfuncs.jl:2480
abstract_call_builtin at ./compiler/abstractinterpretation.jl:1739
abstract_call_known at ./compiler/abstractinterpretation.jl:2014
abstract_call at ./compiler/abstractinterpretation.jl:2169
abstract_call at ./compiler/abstractinterpretation.jl:2162
abstract_call at ./compiler/abstractinterpretation.jl:2354
abstract_eval_call at ./compiler/abstractinterpretation.jl:2370
abstract_eval_statement_expr at ./compiler/abstractinterpretation.jl:2380
abstract_eval_statement at ./compiler/abstractinterpretation.jl:2624
abstract_eval_basic_statement at ./compiler/abstractinterpretation.jl:2913
typeinf_local at ./compiler/abstractinterpretation.jl:3098
typeinf_nocycle at ./compiler/abstractinterpretation.jl:3186
_typeinf at ./compiler/typeinfer.jl:247
typeinf at ./compiler/typeinfer.jl:216
typeinf_ext at ./compiler/typeinfer.jl:1051
typeinf_ext_toplevel at ./compiler/typeinfer.jl:1082
typeinf_ext_toplevel at ./compiler/typeinfer.jl:1078
jfptr_typeinf_ext_toplevel_35854.3 at /Users/mcranmer/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1982 [inlined]
jl_type_infer at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:394
jl_generate_fptr_impl at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jitlayers.cpp:504
jl_compile_method_internal at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:2481
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:2887 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1982 [inlined]
do_call at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/interpreter.c:126
eval_body at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/interpreter.c:0
jl_interpret_toplevel_thunk at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/interpreter.c:775
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:934
jl_toplevel_eval_flex at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:877
ijl_toplevel_eval at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:943 [inlined]
ijl_toplevel_eval_in at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/toplevel.c:985
eval at ./boot.jl:385 [inlined]
include_string at ./loading.jl:2076
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
_include at ./loading.jl:2136
include at ./Base.jl:495
jfptr_include_46536.3 at /Users/mcranmer/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
exec_options at ./client.jl:318
_start at ./client.jl:552
jfptr__start_82857.3 at /Users/mcranmer/.julia/juliaup/julia-1.10.4+0.aarch64.apple.darwin14/lib/julia/sys.dylib (unknown line)
_jl_invoke at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:0 [inlined]
ijl_apply_generic at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/gf.c:3077
jl_apply at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/./julia.h:1982 [inlined]
true_main at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jlapi.c:582
jl_repl_entrypoint at /Users/julia/.julia/scratchspaces/a66863c6-20e8-4ff4-8a62-49f30b1f605e/agent-cache/default-honeycrisp-XG3Q6T6R70.0/build/default-honeycrisp-XG3Q6T6R70-0/julialang/julia-release-1-dot-10/src/jlapi.c:731
Allocations: 2908 (Pool: 2901; Big: 7); GC: 0

Other info:

julia> versioninfo()
Julia Version 1.10.4
Commit 48d4fd48430 (2024-06-04 10:41 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: macOS (arm64-apple-darwin22.4.0)
  CPU: 8 × Apple M1 Pro
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, apple-m1)
Threads: 6 default, 0 interactive, 3 GC (on 6 virtual cores)
Environment:
  JULIA_FORMATTER_SO = /Users/mcranmer/julia_formatter.so
  JULIA_NUM_THREADS = auto
  JULIA_OPTIMIZE = 3
  JULIA_EDITOR = code

I have reproduced this bug on the following versions, on the same machine:

  • 1.12.0-DEV.772
  • 1.11.0-rc1
  • 1.10.4
  • 1.9.4
  • 1.8.4
  • 1.7.3
  • 1.7.2
  • 1.7.1

However, the bug is not present on:

  • 1.7.0
  • 1.6.7

So the bug was created sometime between 1.7.0 and 1.7.1: v1.7.0...v1.7.1

@MilesCranmer MilesCranmer changed the title Segfault from NTuple{N,Base.RefValue{...}} on Julia 1.7+ Segfault from NTuple{N,Base.RefValue{...}} on Julia 1.7.1+ Jul 8, 2024
@MilesCranmer
Copy link
Member Author

Could be this: #43306? I don't see any other matching changes.

@nsajko nsajko added the bug Indicates an unexpected problem or unintended behavior label Jul 8, 2024
@nsajko
Copy link
Contributor

nsajko commented Jul 8, 2024

Reproducible without the internal RefValue:

julia> struct Node{D}
           children::NTuple{D,Memory{Node{D}}}
           Node(::Val{_D}) where {_D} = new{_D}()
       end

julia> Node(Val(2))

[225608] signal 11 (1): Segmentation fault
in expression starting at REPL[2]:1
jl_compute_field_offsets at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:621
jl_struct_try_layout at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:352 [inlined]
jl_struct_try_layout at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:345
jl_datatype_isinlinealloc at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:359
union_isinlinable at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:384 [inlined]
union_isinlinable at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:373 [inlined]
ijl_islayout_inline at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:407
jl_get_genericmemory_layout at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:506
jl_compute_field_offsets at /cache/build/builder-amdci5-7/julialang/julia-master/src/datatype.c:602
inst_datatype_inner at /cache/build/builder-amdci5-7/julialang/julia-master/src/jltypes.c:2238

@MilesCranmer
Copy link
Member Author

MilesCranmer commented Jul 8, 2024

👍

On 1.10.4 here is the lldb backtrace.

lldb -- ~/.julia/bin/julia-1.10 --startup-file=no src/bug_report.jl
(lldb) target create "/Users/mcranmer/.julia/bin/julia-1.10"
Current executable set to '/Users/mcranmer/.julia/bin/julia-1.10' (arm64).
(lldb) settings set -- target.run-args  "--startup-file=no" "src/bug_report.jl"
(lldb) r
Process 43606 launched: '/Users/mcranmer/.julia/bin/julia-1.10' (arm64)
Process 43606 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
    frame #0: 0x0000000100a4ded4 libjulia-internal.1.10.4.dylib`jl_compute_field_offsets(st=0x000000010b293910) at datatype.c:511:25 [opt]
(lldb) thread backtrace
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x0)
  * frame #0: 0x0000000100a4ded4 libjulia-internal.1.10.4.dylib`jl_compute_field_offsets(st=0x000000010b293910) at datatype.c:511:25 [opt]
    frame #1: 0x0000000100a4ed74 libjulia-internal.1.10.4.dylib`union_isinlinable [inlined] jl_struct_try_layout(dt=0x000000010b293910) at datatype.c:342:5 [opt]
    frame #2: 0x0000000100a4ed60 libjulia-internal.1.10.4.dylib`union_isinlinable [inlined] jl_datatype_isinlinealloc(ty=0x000000010b293910, pointerfree=0) at datatype.c:349:37 [opt]
    frame #3: 0x0000000100a4ed3c libjulia-internal.1.10.4.dylib`union_isinlinable(ty=0x000000010b293910, pointerfree=0, nbytes=0x000000016fdf8aa8, align=0x000000016fdf8aa0, asfield=1) at datatype.c:374:31 [opt]
    frame #4: 0x0000000100a4e2dc libjulia-internal.1.10.4.dylib`jl_compute_field_offsets [inlined] ijl_islayout_inline(eltype=0x000000010b293910, fsz=0x000000016fdf8aa8, al=0x000000016fdf8aa0) at datatype.c:397:26 [opt]
    frame #5: 0x0000000100a4e2c4 libjulia-internal.1.10.4.dylib`jl_compute_field_offsets(st=<unavailable>) at datatype.c:577:17 [opt]
    frame #6: 0x0000000100a09460 libjulia-internal.1.10.4.dylib`inst_datatype_inner(dt=0x000000010b293010, p=<unavailable>, iparams=<unavailable>, ntp=<unavailable>, stack=0x000000016fdf8b78, env=<unavailable>, check=<unavailable>, nothrow=<unavailable>) at jltypes.c:2193:13 [opt]
    frame #7: 0x0000000100a0727c libjulia-internal.1.10.4.dylib`inst_type_w_(t=0x000000010b293010, env=0x000000016fdf92a8, stack=0x000000016fdf90e8, check=1, nothrow=<unavailable>) at jltypes.c:2484:13 [opt]
    frame #8: 0x0000000100a07490 libjulia-internal.1.10.4.dylib`inst_type_w_(t=0x000000010b20edd0, env=0x000000016fdf92a8, stack=0x000000016fdf90e8, check=1, nothrow=0) at jltypes.c:2438:17 [opt]
    frame #9: 0x0000000100a0eabc libjulia-internal.1.10.4.dylib`inst_tuple_w_(t=<unavailable>, env=0x000000016fdf92a8, stack=0x000000016fdf90e8, check=1, nothrow=0) at jltypes.c:2315:26 [opt]
    frame #10: 0x0000000100a07598 libjulia-internal.1.10.4.dylib`inst_type_w_(t=<unavailable>, env=<unavailable>, stack=<unavailable>, check=<unavailable>, nothrow=<unavailable>) at jltypes.c:2465:16 [opt] [artificial]
    frame #11: 0x0000000100a09b20 libjulia-internal.1.10.4.dylib`inst_ftypes(p=<unavailable>, env=0x000000016fdf92a8, stack=0x000000016fdf90e8) at jltypes.c:2258:18 [opt]
    frame #12: 0x0000000100a093a4 libjulia-internal.1.10.4.dylib`inst_datatype_inner(dt=0x000000010b292fd0, p=<unavailable>, iparams=<unavailable>, ntp=<unavailable>, stack=0x000000016fdf90e8, env=<unavailable>, check=<unavailable>, nothrow=<unavailable>) at jltypes.c:2182:30 [opt]
    frame #13: 0x0000000100a0727c libjulia-internal.1.10.4.dylib`inst_type_w_(t=0x000000010b292fd0, env=0x000000016fdf92a8, stack=0x0000000000000000, check=1, nothrow=<unavailable>) at jltypes.c:2484:13 [opt]
    frame #14: 0x0000000100a06ae4 libjulia-internal.1.10.4.dylib`ijl_apply_type [inlined] ijl_instantiate_unionall(u=0x000000010b20ecf0, p=0x0000000100044280) at jltypes.c:1456:12 [opt]
    frame #15: 0x0000000100a06ac0 libjulia-internal.1.10.4.dylib`ijl_apply_type(tc=<unavailable>, params=0x000000016fdf9400, n=1) at jltypes.c:1388:14 [opt]
    frame #16: 0x0000000100a17d7c libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000011ed8f290, args=0x000000016fdf93f8, nargs=2, mfunc=0x000000011ba8e730, world=<unavailable>) at gf.c:0 [opt]
    frame #17: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000011ed8f290, args=0x000000016fdf93f8, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #18: 0x0000000100a25ae4 libjulia-internal.1.10.4.dylib`do_apply [inlined] jl_apply(args=<unavailable>, nargs=3) at julia.h:1982:12 [opt]
    frame #19: 0x0000000100a25ad4 libjulia-internal.1.10.4.dylib`do_apply(args=0x000000016fdf9838, nargs=<unavailable>, iterate=0x000000011b5fb2c0) at builtins.c:768:26 [opt]
    frame #20: 0x000000011a12886c sys.dylib`japi1_apply_type_tfunc_33500.4 at tfuncs.jl:1860
    frame #21: 0x0000000100a17d7c libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000011b6529e0, args=0x000000016fdf9988, nargs=3, mfunc=0x000000011d9e5790, world=<unavailable>) at gf.c:0 [opt]
    frame #22: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000011b6529e0, args=0x000000016fdf9988, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #23: 0x0000000100a25ae4 libjulia-internal.1.10.4.dylib`do_apply [inlined] jl_apply(args=<unavailable>, nargs=4) at julia.h:1982:12 [opt]
    frame #24: 0x0000000100a25ad4 libjulia-internal.1.10.4.dylib`do_apply(args=0x000000016fdf9c08, nargs=<unavailable>, iterate=0x000000011b5fb2c0) at builtins.c:768:26 [opt]
    frame #25: 0x000000011961ce38 sys.dylib`julia_builtin_tfunction_33790.4 at tfuncs.jl:2480
    frame #26: 0x000000011aa531d4 sys.dylib`julia_abstract_call_builtin_34766.4 at abstractinterpretation.jl:1739
    frame #27: 0x000000011921ed10 sys.dylib`julia_abstract_call_known_34880.4 at abstractinterpretation.jl:2014
    frame #28: 0x0000000118bf112c sys.dylib`julia_abstract_call_35061.4 at abstractinterpretation.jl:2169
    frame #29: 0x000000011abbf124 sys.dylib`julia_abstract_call_35089.4 at abstractinterpretation.jl:2162
    frame #30: 0x0000000119fbe450 sys.dylib`julia_abstract_call_35053.4 at abstractinterpretation.jl:2354
    frame #31: 0x000000011891d230 sys.dylib`julia_abstract_eval_call_35181.4 at abstractinterpretation.jl:2370
    frame #32: 0x000000011a294f44 sys.dylib`julia_abstract_eval_statement_expr_35198.4 at abstractinterpretation.jl:2380
    frame #33: 0x000000011947c060 sys.dylib`julia_abstract_eval_statement_35380.3 at abstractinterpretation.jl:2624
    frame #34: 0x000000011a12ff08 sys.dylib`julia_abstract_eval_basic_statement_35465.3 at abstractinterpretation.jl:2913
    frame #35: 0x000000011931d79c sys.dylib`julia_typeinf_local_35480.4 at abstractinterpretation.jl:3098
    frame #36: 0x0000000119e88cfc sys.dylib`julia_typeinf_nocycle_35561.4 at abstractinterpretation.jl:3186
    frame #37: 0x0000000118775218 sys.dylib`julia__typeinf_35602.4 at typeinfer.jl:247
    frame #38: 0x00000001192f0220 sys.dylib`julia_typeinf_35570.4 at typeinfer.jl:216
    frame #39: 0x000000011abb2030 sys.dylib`julia_typeinf_ext_35828.3 at typeinfer.jl:1051
    frame #40: 0x00000001194827a8 sys.dylib`julia_typeinf_ext_toplevel_35858.3 at typeinfer.jl:1082
    frame #41: 0x000000011a15f68c sys.dylib`julia_typeinf_ext_toplevel_35853.3 at typeinfer.jl:1078
    frame #42: 0x0000000118aae738 sys.dylib`jfptr_typeinf_ext_toplevel_35854.3 + 56
    frame #43: 0x0000000100a17d7c libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000011f393cc0, args=0x000000016fdfbb28, nargs=2, mfunc=0x000000011da1ffe0, world=<unavailable>) at gf.c:0 [opt]
    frame #44: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000011f393cc0, args=0x000000016fdfbb28, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #45: 0x0000000100a0fdcc libjulia-internal.1.10.4.dylib`jl_type_infer [inlined] jl_apply(args=<unavailable>, nargs=3) at julia.h:1982:12 [opt]
    frame #46: 0x0000000100a0fdc0 libjulia-internal.1.10.4.dylib`jl_type_infer(mi=0x000000010b24e2c0, world=31457, force=<unavailable>) at gf.c:394:32 [opt]
    frame #47: 0x000000010081a43c libjulia-codegen.1.10.4.dylib`jl_generate_fptr_impl(mi=0x000000010b24e2c0, world=31457, did_compile=0x000000016fdfbd9c) at jitlayers.cpp:504:19 [opt]
    frame #48: 0x0000000100a14b08 libjulia-internal.1.10.4.dylib`jl_compile_method_internal(mi=0x000000010b24e2c0, world=31457) at gf.c:2481:16 [opt]
    frame #49: 0x0000000100a17d44 libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000010b20ecf0, args=0x000000016fdfbea8, nargs=1, mfunc=0x000000010b24e2c0, world=31457) at gf.c:2887:16 [opt]
    frame #50: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000010b20ecf0, args=0x000000016fdfbea8, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #51: 0x0000000100a32484 libjulia-internal.1.10.4.dylib`do_call [inlined] jl_apply(args=<unavailable>, nargs=2) at julia.h:1982:12 [opt]
    frame #52: 0x0000000100a32474 libjulia-internal.1.10.4.dylib`do_call(args=<unavailable>, nargs=2, s=0x000000016fdfc0d0) at interpreter.c:126:26 [opt]
    frame #53: 0x0000000100a30c80 libjulia-internal.1.10.4.dylib`eval_body(stmts=0x000000010b24e1d0, s=0x000000016fdfc0d0, ip=1, toplevel=<unavailable>) at interpreter.c:0 [opt]
    frame #54: 0x0000000100a312a0 libjulia-internal.1.10.4.dylib`jl_interpret_toplevel_thunk(m=0x000000011f393cd0, src=<unavailable>) at interpreter.c:775:21 [opt]
    frame #55: 0x0000000100a497e4 libjulia-internal.1.10.4.dylib`jl_toplevel_eval_flex(m=0x000000011f393cd0, e=0x000000010b20e0d0, fast=1, expanded=<unavailable>) at toplevel.c:934:18 [opt]
    frame #56: 0x0000000100a495ac libjulia-internal.1.10.4.dylib`jl_toplevel_eval_flex(m=0x000000011f393cd0, e=0x000000010b20e210, fast=1, expanded=<unavailable>) at toplevel.c:877:19 [opt]
    frame #57: 0x0000000100a4a494 libjulia-internal.1.10.4.dylib`ijl_toplevel_eval_in [inlined] ijl_toplevel_eval(m=0x000000011f393cd0, v=0x000000010b20e210) at toplevel.c:943:12 [opt]
    frame #58: 0x0000000100a4a488 libjulia-internal.1.10.4.dylib`ijl_toplevel_eval_in(m=0x000000011f393cd0, ex=0x000000010b20e210) at toplevel.c:985:13 [opt]
    frame #59: 0x000000011a2db0e8 sys.dylib`japi1_include_string_81110.4 at boot.jl:385
    frame #60: 0x0000000100a17d7c libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000011e7b8b30, args=0x000000016fdfc900, nargs=4, mfunc=0x000000011e7b98b0, world=<unavailable>) at gf.c:0 [opt]
    frame #61: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000011e7b8b30, args=0x000000016fdfc900, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #62: 0x000000011ac9fd48 sys.dylib`japi1__include_81118.4 at loading.jl:2136
    frame #63: 0x00000001188fc09c sys.dylib`julia_include_46535.3 at Base.jl:495
    frame #64: 0x0000000119456dc0 sys.dylib`jfptr_include_46536.3 + 60
    frame #65: 0x0000000100a17d7c libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000011b6d2eb0, args=0x000000016fdfe530, nargs=2, mfunc=0x000000011b6d3470, world=<unavailable>) at gf.c:0 [opt]
    frame #66: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000011b6d2eb0, args=0x000000016fdfe530, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #67: 0x00000001183f5b34 sys.dylib`julia_exec_options_82718.4 at client.jl:318
    frame #68: 0x0000000118fa6ab4 sys.dylib`julia__start_82856.3 at client.jl:552
    frame #69: 0x0000000119b04bf4 sys.dylib`jfptr__start_82857.3 + 36
    frame #70: 0x0000000100a17d7c libjulia-internal.1.10.4.dylib`ijl_apply_generic [inlined] _jl_invoke(F=0x000000011b5a1d30, args=0x000000016fdfea58, nargs=0, mfunc=0x000000011b5a1bc0, world=<unavailable>) at gf.c:0 [opt]
    frame #71: 0x0000000100a17d10 libjulia-internal.1.10.4.dylib`ijl_apply_generic(F=0x000000011b5a1d30, args=0x000000016fdfea58, nargs=<unavailable>) at gf.c:3077:12 [opt]
    frame #72: 0x0000000100a75910 libjulia-internal.1.10.4.dylib`true_main [inlined] jl_apply(args=0x000000016fdfea50, nargs=1) at julia.h:1982:12 [opt]
    frame #73: 0x0000000100a758fc libjulia-internal.1.10.4.dylib`true_main(argc=<unavailable>, argv=<unavailable>) at jlapi.c:582:13 [opt]
    frame #74: 0x0000000100a75804 libjulia-internal.1.10.4.dylib`jl_repl_entrypoint(argc=<unavailable>, argv=<unavailable>) at jlapi.c:731:15 [opt]
    frame #75: 0x0000000100003f6c julia-1.10`main + 12
    frame #76: 0x00000001847ed0e0 dyld`start + 2360

On nightly, this line is

size_t i, nfields = jl_svec_len(st->types);

MilesCranmer added a commit to SymbolicML/DynamicExpressions.jl that referenced this issue Jul 8, 2024
MilesCranmer added a commit to SymbolicML/DynamicExpressions.jl that referenced this issue Jul 8, 2024
vtjnash added a commit that referenced this issue Aug 7, 2024
Comparing objects by `==` will happily answer nonsense for malformed
type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that
query. Additionally, need to recourse through Vararg when examining type
structure to make decisions.

Fix #55076
Fix #55189
vtjnash added a commit that referenced this issue Aug 7, 2024
Comparing objects by `==` will happily answer nonsense for malformed
type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that
query. Additionally, need to recourse through Vararg when examining type
structure to make decisions.

Fix #55076
Fix #55189
KristofferC pushed a commit that referenced this issue Aug 13, 2024
Comparing objects by `==` will happily answer nonsense for malformed
type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that
query. Additionally, need to recourse through Vararg when examining type
structure to make decisions.

Fix #55076
Fix #55189

(cherry picked from commit 32423a8)
lazarusA pushed a commit to lazarusA/julia that referenced this issue Aug 17, 2024
Comparing objects by `==` will happily answer nonsense for malformed
type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that
query. Additionally, need to recourse through Vararg when examining type
structure to make decisions.

Fix JuliaLang#55076
Fix JuliaLang#55189
KristofferC pushed a commit that referenced this issue Feb 14, 2025
Comparing objects by `==` will happily answer nonsense for malformed
type comparisons, such as `unwrap_unionall(A) == A`. Avoid forming that
query. Additionally, need to recourse through Vararg when examining type
structure to make decisions.

Fix #55076
Fix #55189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants