Skip to content

AddressSanitizer: heap-use-after-free ./src/julia.h:1235:13 in jl_is_array_type(void*) #42498

@DilumAluthge

Description

@DilumAluthge

Seen in the asan job in CI. The full CI log is here.

Precompilation complete. Summary:
Total ─────── 731.294125 seconds
Generation ── 434.749219 seconds 59.4493%
Execution ─── 296.544906 seconds 40.5507%
=================================================================
==13821==ERROR: AddressSanitizer: heap-use-after-free on address 0x6110072336b8 at pc 0x7f070ee894b2 bp 0x7ffc97c9de50 sp 0x7ffc97c9de48
READ of size 8 at 0x6110072336b8 thread T0
    #0 0x7f070ee894b1 in jl_is_array_type(void*) /cache/build/amdci7-2/julialang/julia-master/src/julia.h:1235:13
    #1 0x7f070ee88e34 in dereferenceable_size(_jl_value_t*) /cache/build/amdci7-2/julialang/julia-master/src/cgutils.cpp:320:9
    #2 0x7f070ee88dd0 in maybe_mark_load_dereferenceable(llvm::Instruction*, bool, _jl_value_t*) /cache/build/amdci7-2/julialang/julia-master/src/cgutils.cpp:384:19
    #3 0x7f070eeb7ef3 in emit_varinfo(jl_codectx_t&, jl_varinfo_t&, _jl_sym_t*, _jl_value_t*) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:4069:9
    #4 0x7f070ee9c86e in emit_local(jl_codectx_t&, _jl_value_t*) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:4109:12
    #5 0x7f070ee93b29 in emit_expr(jl_codectx_t&, _jl_value_t*, long) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:4529:16
    #6 0x7f070eea070f in emit_call(jl_codectx_t&, jl_expr_t*, _jl_value_t*) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:3793:19
    #7 0x7f070ee95297 in emit_expr(jl_codectx_t&, _jl_value_t*, long) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:4632:26
    #8 0x7f070ef21ee2 in emit_ssaval_assign(jl_codectx_t&, long, _jl_value_t*) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:4274:16
    #9 0x7f070ef1d740 in emit_stmtpos(jl_codectx_t&, _jl_value_t*, int) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:4516:9
    #10 0x7f070ee601a3 in emit_function(_jl_method_instance_t*, _jl_code_info_t*, _jl_value_t*, jl_codegen_params_t&, bool) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:7359:13
    #11 0x7f070ee4f6ba in jl_emit_code(_jl_method_instance_t*, _jl_code_info_t*, _jl_value_t*, jl_codegen_params_t&) /cache/build/amdci7-2/julialang/julia-master/src/codegen.cpp:7721:30
    #12 0x7f070f21c3fb in ijl_create_native /cache/build/amdci7-2/julialang/julia-master/src/aotcompile.cpp:321:50
    #13 0x7f070f1203ca in jl_precompile /cache/build/amdci7-2/julialang/julia-master/src/precompile.c:401:25
    #14 0x7f070f11e68b in jl_write_compiler_output /cache/build/amdci7-2/julialang/julia-master/src/precompile.c:33:23
    #15 0x7f070f081703 in ijl_atexit_hook /cache/build/amdci7-2/julialang/julia-master/src/init.c:211:9
    #16 0x7f070f16d307 in jl_repl_entrypoint /cache/build/amdci7-2/julialang/julia-master/src/jlapi.c:691:5
    #17 0x7f0712a66af9 in jl_load_repl /cache/build/amdci7-2/julialang/julia-master/cli/loader_lib.c:225:12
    #18 0x4f7196 in main /cache/build/amdci7-2/julialang/julia-master/cli/loader_exe.c:59:15
    #19 0x7f0712ac409a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2409a)
    #20 0x41f319 in _start (/cache/build/amdci7-2/julialang/julia-master/tmp/test-asan/asan/usr/bin/julia-debug+0x41f319)
 
0x6110072336b8 is located 56 bytes inside of 192-byte region [0x611007233680,0x611007233740)
freed by thread T0 here:
    #0 0x4b13e4 in free /workspace/srcdir/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:127
    #1 0x7f070f149844 in jl_free_aligned /cache/build/amdci7-2/julialang/julia-master/src/gc.c:255:5
 
previously allocated by thread T0 here:
    #0 0x4b2374 in posix_memalign /workspace/srcdir/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:226
    #1 0x7f070f130f5d in jl_malloc_aligned /cache/build/amdci7-2/julialang/julia-master/src/gc.c:235:9
 
SUMMARY: AddressSanitizer: heap-use-after-free /cache/build/amdci7-2/julialang/julia-master/src/julia.h:1235:13 in jl_is_array_type(void*)
Shadow bytes around the buggy address:
  0x0c2280e3e680: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2280e3e690: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2280e3e6a0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c2280e3e6b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2280e3e6c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c2280e3e6d0: fd fd fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd
  0x0c2280e3e6e0: fd fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa
  0x0c2280e3e6f0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x0c2280e3e700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c2280e3e710: 00 04 fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c2280e3e720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
  Shadow gap:              cc
==13821==ABORTING

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviorciContinuous integrationcompiler:codegenGeneration of LLVM IR and native codeneeds more infoClarification or a reproducible example is required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions