Page MenuHome

heap-use-after-free when button is active and property search starts
Closed, ResolvedPublicBUG

Description

Blender Version
Broken: 2.91

Exact steps for others to reproduce the error

  • Hover over a number button
  • Press ctrl-F
  • With ASAN active, see Blender close with the following report:
home/hans/Documents/Blender-Git/blender/source/blender/editors/space_buttons/buttons_context.c:883:36: runtime error: member access within null pointer of type 'struct Tex'
=================================================================
==215965==ERROR: AddressSanitizer: heap-use-after-free on address 0x619000887ca0 at pc 0x00000488d94c bp 0x7fff4a4146e0 sp 0x7fff4a4146d0
READ of size 4 at 0x619000887ca0 thread T0
    #0 0x488d94b in panel_remove_invisible_layouts_recursive /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface_panel.c:969
    #1 0x488de01 in region_panels_remove_invisible_layouts /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface_panel.c:987
    #2 0x489bd84 in UI_panels_end /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface_panel.c:1892
    #3 0x38f6e56 in ED_region_panels_layout_ex /home/hans/Documents/Blender-Git/blender/source/blender/editors/screen/area.c:2960
    #4 0x886d47b in buttons_main_region_layout_properties /home/hans/Documents/Blender-Git/blender/source/blender/editors/space_buttons/space_buttons.c:305
    #5 0x88704ae in buttons_main_region_layout /home/hans/Documents/Blender-Git/blender/source/blender/editors/space_buttons/space_buttons.c:474
    #6 0x38d2055 in ED_region_do_layout /home/hans/Documents/Blender-Git/blender/source/blender/editors/screen/area.c:512
    #7 0x37a1026 in wm_draw_window_offscreen /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm_draw.c:684
    #8 0x37a292f in wm_draw_window /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm_draw.c:872
    #9 0x37a3d73 in wm_draw_update /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm_draw.c:1075
    #10 0x3794ec0 in WM_main /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm.c:489
    #11 0x378542f in main /home/hans/Documents/Blender-Git/blender/source/creator/creator.c:519
    #12 0x7ffbcc088041 in __libc_start_main ../csu/libc-start.c:308
    #13 0x378488d in _start (/home/hans/Documents/Blender-Git/build_linux_debug_lite/bin/blender+0x378488d)

0x619000887ca0 is located 32 bytes inside of 1024-byte region [0x619000887c80,0x619000888080)
freed by thread T0 here:
    #0 0x7ffbcc636307 in __interceptor_free (/lib64/libasan.so.6+0xb0307)
    #1 0x9193984 in MEM_lockfree_freeN /home/hans/Documents/Blender-Git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:129
    #2 0x46fd9a9 in ui_but_free /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:3369
    #3 0x46e2e4b in ui_but_update_from_old_block /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:911
    #4 0x46ea043 in UI_block_update_from_old /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:1771
    #5 0x46ead18 in UI_block_end_ex /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:1821
    #6 0x46ebbfb in UI_block_end /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:1911
    #7 0x38f42eb in ed_panel_draw /home/hans/Documents/Blender-Git/blender/source/blender/editors/screen/area.c:2729
    #8 0x38f66c7 in ED_region_panels_layout_ex /home/hans/Documents/Blender-Git/blender/source/blender/editors/screen/area.c:2913
    #9 0x886d47b in buttons_main_region_layout_properties /home/hans/Documents/Blender-Git/blender/source/blender/editors/space_buttons/space_buttons.c:305
    #10 0x88704ae in buttons_main_region_layout /home/hans/Documents/Blender-Git/blender/source/blender/editors/space_buttons/space_buttons.c:474
    #11 0x38d2055 in ED_region_do_layout /home/hans/Documents/Blender-Git/blender/source/blender/editors/screen/area.c:512
    #12 0x37a1026 in wm_draw_window_offscreen /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm_draw.c:684
    #13 0x37a292f in wm_draw_window /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm_draw.c:872
    #14 0x37a3d73 in wm_draw_update /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm_draw.c:1075
    #15 0x3794ec0 in WM_main /home/hans/Documents/Blender-Git/blender/source/blender/windowmanager/intern/wm.c:489
    #16 0x378542f in main /home/hans/Documents/Blender-Git/blender/source/creator/creator.c:519
    #17 0x7ffbcc088041 in __libc_start_main ../csu/libc-start.c:308

previously allocated by thread T0 here:
    #0 0x7ffbcc636837 in __interceptor_calloc (/lib64/libasan.so.6+0xb0837)
    #1 0x9194062 in MEM_lockfree_callocN /home/hans/Documents/Blender-Git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:235
    #2 0x4703947 in ui_but_alloc /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:3902
    #3 0x470464c in ui_def_but /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:3999
    #4 0x470add9 in ui_def_but_rna /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:4532
    #5 0x470dd79 in uiDefButR_prop /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface.c:5161
    #6 0x494ae08 in uiDefAutoButR /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface_utils.c:165
    #7 0x4828ed9 in uiItemFullR /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface_layout.c:2308
    #8 0x625602c in rna_uiItemR /home/hans/Documents/Blender-Git/blender/source/blender/makesrna/intern/rna_ui_api.c:136
    #9 0x6263904 in UILayout_prop_call /home/hans/Documents/Blender-Git/build_linux_debug_lite/source/blender/makesrna/intern/rna_ui_gen.c:1837
    #10 0x5a8d980 in RNA_function_call /home/hans/Documents/Blender-Git/blender/source/blender/makesrna/intern/rna_access.c:7676
    #11 0x65d6f35 in pyrna_func_call /home/hans/Documents/Blender-Git/blender/source/blender/python/intern/bpy_rna.c:6300
    #12 0x86e1f06 in _PyObject_FastCallKeywords Objects/call.c:199

SUMMARY: AddressSanitizer: heap-use-after-free /home/hans/Documents/Blender-Git/blender/source/blender/editors/interface/interface_panel.c:969 in panel_remove_invisible_layouts_recursive
Shadow bytes around the buggy address:
  0x0c3280108f40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c3280108f50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0c3280108f60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fa
  0x0c3280108f70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c3280108f80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x0c3280108f90: fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd fd
  0x0c3280108fa0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3280108fb0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3280108fc0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3280108fd0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c3280108fe0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
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
==215965==ABORTING