heap-use-after-free in script_load_addons test #83099

Closed
opened 2020-11-27 10:32:45 +01:00 by Ankit Meel · 17 comments
Member

Blender Version 1318eaf166

Run ctest -C debug -VV -R script_load_addons

(myenv) 14:54:05 build_darwin_lite$ctest -R script_load_addons -VV -C Debug
UpdateCTestConfiguration  from :/Users/ankitkumar/blender-build/build_darwin_lite/DartConfiguration.tcl
UpdateCTestConfiguration  from :/Users/ankitkumar/blender-build/build_darwin_lite/DartConfiguration.tcl
Test project /Users/ankitkumar/blender-build/build_darwin_lite
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 910
    Start script_load_addons

Test command: /Users/ankitkumar/blender-build/build_darwin_lite/bin/Debug/Blender.app/Contents/MacOS/Blender "--background" "-noaudio" "--factory-startup" "--debug-memory" "--debug-exit-on-error" "--python-exit-code" "1" "--python" "tests/python/bl_load_addons.py"
Environment variables: 
 LSAN_OPTIONS=exitcode=0:suppressions=/Users/ankitkumar/blender-build/resources/blender-lsan-suppressions.txt:exitcode=0
Test timeout computed to be: 10000000
Switching to fully guarded memory allocator.
Color management: using fallback mode for management
Color management: Error could not find role data role.
Blender 2.92.0 Alpha
Color management: scene view "Filmic" not found, setting default "Standard".
source/blender/depsgraph/intern/depsgraph_tag.cc:664:64: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:664:64 in 
source/blender/depsgraph/intern/depsgraph_tag.cc:366:7: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:366:7 in 
source/blender/depsgraph/intern/depsgraph_tag.cc:375:41: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:375:41 in 
source/blender/depsgraph/intern/depsgraph_tag.cc:160:7: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:160:7 in 
source/blender/depsgraph/intern/depsgraph_tag.cc:165:11: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:165:11 in 
Registering panel class: 'AMTH_NODE_PT_indices' misses category, please update the script
Registering panel class: 'AMTH_NODE_PT_simplify' misses category, please update the script
Registering panel class: 'IMAGE_PT_color_palette' misses category, please update the script
Registering panel class: 'TEXT_PT_POV_custom_code' misses category, please update the script
Error: =================================================================
==7227==ERROR: AddressSanitizer: heap-use-after-free on address 0x61100008a288 at pc 0x000121967953 bp 0x7ffee0c48ff0 sp 0x7ffee0c48778
READ of size 173 at 0x61100008a288 thread T0
    - 0 0x121967952 in printf_common(void*, char const*, __va_list_tag*) (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x21952)
    - 1 0x121966f31 in wrap_vprintf (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x20f31)
    - 2 0x110737ed7 in BKE_reportf source/blender/blenkernel/intern/report.c:142:5
    - 3 0x1134288da in rna_KeyMap_item_remove source/blender/makesrna/intern/rna_wm_api.c:359:5
    - 4 0x113428b7f in KeyMapItems_remove_call /Users/ankitkumar/blender-build/build_darwin_lite/source/blender/makesrna/intern/rna_wm_gen.c:4030:2
    - 5 0x11286fda0 in RNA_function_call source/blender/makesrna/intern/rna_access.c:7554:5
    - 6 0x1135e6161 in pyrna_func_call source/blender/python/intern/bpy_rna.c:6315:5
    - 7 0x11697105e in _PyObject_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:199:18
    - 8 0x116a47474 in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4619:17
    - 9 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23
    - 10 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 11 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 12 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23
    - 13 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 14 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 15 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12
    - 16 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 17 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19
    - 18 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 19 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 20 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19
    - 21 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 22 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 23 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12
    - 24 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 25 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19
    - 26 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 27 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 28 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19
    - 29 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 30 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 31 0x116a3d3bf in PyEval_EvalCodeEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3959:12
    - 32 0x116a3d3bf in PyEval_EvalCode /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:524
    - 33 0x116a7fa0d in run_mod /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:1035:9
    - 34 0x116a7fa0d in PyRun_FileExFlags /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:988
    - 35 0x1135899e5 in python_script_exec source/blender/python/intern/bpy_interface_run.c:159:19
    - 36 0x113589016 in BPY_run_filepath source/blender/python/intern/bpy_interface_run.c:216:10
    - 37 0x10efc3d39 in arg_handle_python_file_run source/creator/creator_args.c:1750:5
    - 38 0x1173bb4a3 in BLI_args_parse source/blender/blenlib/intern/BLI_args.c:300:22
    - 39 0x10efc6e5b in main_args_setup_post source/creator/creator_args.c:2233:3
    - 40 0x10efbaecf in main source/creator/creator.c:489:3
    - 41 0x7fff59dd23d4 in start (/usr/lib/system/libdyld.dylib:x86_64+0x163d4)

0x61100008a288 is located 72 bytes inside of 248-byte region [0x61100008a240,0x61100008a338)
freed by thread T0 here:
    - 0 0x12198c6f6 in wrap_free (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x466f6)
    - 1 0x1179a4e05 in rem_memblock intern/guardedalloc/intern/mallocn_guarded_impl.c:1019:5
    - 2 0x11799f9b5 in MEM_guarded_freeN intern/guardedalloc/intern/mallocn_guarded_impl.c:908:7
    - 3 0x1175c25c1 in BLI_freelinkN source/blender/blenlib/intern/listbase.c:290:3
    - 4 0x10f0e7fb2 in WM_keymap_remove_item source/blender/windowmanager/intern/wm_keymap.c:540:5
    - 5 0x113428844 in rna_KeyMap_item_remove source/blender/makesrna/intern/rna_wm_api.c:358:7
    - 6 0x113428b7f in KeyMapItems_remove_call /Users/ankitkumar/blender-build/build_darwin_lite/source/blender/makesrna/intern/rna_wm_gen.c:4030:2
    - 7 0x11286fda0 in RNA_function_call source/blender/makesrna/intern/rna_access.c:7554:5
    - 8 0x1135e6161 in pyrna_func_call source/blender/python/intern/bpy_rna.c:6315:5
    - 9 0x11697105e in _PyObject_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:199:18
    - 10 0x116a47474 in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4619:17
    - 11 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23
    - 12 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 13 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 14 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19
    - 15 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 16 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 17 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23
    - 18 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 19 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 20 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23
    - 21 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 22 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 23 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12
    - 24 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 25 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19
    - 26 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 27 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 28 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19
    - 29 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 30 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 31 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12

previously allocated by thread T0 here:
    - 0 0x12198c982 in wrap_calloc (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x46982)
    - 1 0x1179a0450 in MEM_guarded_callocN intern/guardedalloc/intern/mallocn_guarded_impl.c:555:21
    - 2 0x10f0e6511 in WM_keymap_add_item source/blender/windowmanager/intern/wm_keymap.c:505:23
    - 3 0x113425352 in rna_KeyMap_item_new source/blender/makesrna/intern/rna_wm_api.c:258:9
    - 4 0x1134265a2 in KeyMapItems_new_call /Users/ankitkumar/blender-build/build_darwin_lite/source/blender/makesrna/intern/rna_wm_gen.c:3937:9
    - 5 0x11286fda0 in RNA_function_call source/blender/makesrna/intern/rna_access.c:7554:5
    - 6 0x1135e6161 in pyrna_func_call source/blender/python/intern/bpy_rna.c:6315:5
    - 7 0x11697105e in _PyObject_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:199:18
    - 8 0x116a47474 in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4619:17
    - 9 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19
    - 10 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 11 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 12 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23
    - 13 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 14 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 15 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12
    - 16 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 17 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19
    - 18 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 19 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 20 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19
    - 21 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14
    - 22 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17
    - 23 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19
    - 24 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12
    - 25 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930
    - 26 0x116a3d3bf in PyEval_EvalCodeEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3959:12
    - 27 0x116a3d3bf in PyEval_EvalCode /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:524
    - 28 0x116a7fa0d in run_mod /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:1035:9
    - 29 0x116a7fa0d in PyRun_FileExFlags /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:988
    - 30 0x1135899e5 in python_script_exec source/blender/python/intern/bpy_interface_run.c:159:19
    - 31 0x113589016 in BPY_run_filepath source/blender/python/intern/bpy_interface_run.c:216:10
    - 32 0x10efc3d39 in arg_handle_python_file_run source/creator/creator_args.c:1750:5
    - 33 0x1173bb4a3 in BLI_args_parse source/blender/blenlib/intern/BLI_args.c:300:22

SUMMARY: AddressSanitizer: heap-use-after-free (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x21952) in printf_common(void*, char const*, __va_list_tag*)
Shadow bytes around the buggy address:
  0x1c2200011400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c2200011410: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
  0x1c2200011420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c2200011430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa
  0x1c2200011440: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd
=>0x1c2200011450: fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c2200011460: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa
  0x1c2200011470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x1c2200011480: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 fa fa
  0x1c2200011490: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00
  0x1c22000114a0: 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
==7227==ABORTING
1/1 Test #script_load_addons ...............Child aborted***Exception:   5.47 sec

0% tests passed, 1 tests failed out of 1

Total Test time (real) =   5.76 sec

The following tests FAILED:
  910 - script_load_addons (Child aborted)
Errors while running CTest

Blender Version 1318eaf166947e080c05ed689dbc295817496f1a Run `ctest -C debug -VV -R script_load_addons` ```lines=30 (myenv) 14:54:05 build_darwin_lite$ctest -R script_load_addons -VV -C Debug UpdateCTestConfiguration from :/Users/ankitkumar/blender-build/build_darwin_lite/DartConfiguration.tcl UpdateCTestConfiguration from :/Users/ankitkumar/blender-build/build_darwin_lite/DartConfiguration.tcl Test project /Users/ankitkumar/blender-build/build_darwin_lite Constructing a list of tests Done constructing a list of tests Updating test list for fixtures Added 0 tests to meet fixture requirements Checking test dependency graph... Checking test dependency graph end test 910 Start script_load_addons Test command: /Users/ankitkumar/blender-build/build_darwin_lite/bin/Debug/Blender.app/Contents/MacOS/Blender "--background" "-noaudio" "--factory-startup" "--debug-memory" "--debug-exit-on-error" "--python-exit-code" "1" "--python" "tests/python/bl_load_addons.py" Environment variables: LSAN_OPTIONS=exitcode=0:suppressions=/Users/ankitkumar/blender-build/resources/blender-lsan-suppressions.txt:exitcode=0 Test timeout computed to be: 10000000 Switching to fully guarded memory allocator. Color management: using fallback mode for management Color management: Error could not find role data role. Blender 2.92.0 Alpha Color management: scene view "Filmic" not found, setting default "Standard". source/blender/depsgraph/intern/depsgraph_tag.cc:664:64: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:664:64 in source/blender/depsgraph/intern/depsgraph_tag.cc:366:7: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:366:7 in source/blender/depsgraph/intern/depsgraph_tag.cc:375:41: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:375:41 in source/blender/depsgraph/intern/depsgraph_tag.cc:160:7: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:160:7 in source/blender/depsgraph/intern/depsgraph_tag.cc:165:11: runtime error: load of value 33554432, which is not a valid value for type 'IDRecalcFlag' SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior source/blender/depsgraph/intern/depsgraph_tag.cc:165:11 in Registering panel class: 'AMTH_NODE_PT_indices' misses category, please update the script Registering panel class: 'AMTH_NODE_PT_simplify' misses category, please update the script Registering panel class: 'IMAGE_PT_color_palette' misses category, please update the script Registering panel class: 'TEXT_PT_POV_custom_code' misses category, please update the script Error: ================================================================= ==7227==ERROR: AddressSanitizer: heap-use-after-free on address 0x61100008a288 at pc 0x000121967953 bp 0x7ffee0c48ff0 sp 0x7ffee0c48778 READ of size 173 at 0x61100008a288 thread T0 - 0 0x121967952 in printf_common(void*, char const*, __va_list_tag*) (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x21952) - 1 0x121966f31 in wrap_vprintf (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x20f31) - 2 0x110737ed7 in BKE_reportf source/blender/blenkernel/intern/report.c:142:5 - 3 0x1134288da in rna_KeyMap_item_remove source/blender/makesrna/intern/rna_wm_api.c:359:5 - 4 0x113428b7f in KeyMapItems_remove_call /Users/ankitkumar/blender-build/build_darwin_lite/source/blender/makesrna/intern/rna_wm_gen.c:4030:2 - 5 0x11286fda0 in RNA_function_call source/blender/makesrna/intern/rna_access.c:7554:5 - 6 0x1135e6161 in pyrna_func_call source/blender/python/intern/bpy_rna.c:6315:5 - 7 0x11697105e in _PyObject_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:199:18 - 8 0x116a47474 in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4619:17 - 9 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23 - 10 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 11 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 12 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23 - 13 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 14 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 15 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12 - 16 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 17 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19 - 18 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 19 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 20 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19 - 21 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 22 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 23 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12 - 24 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 25 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19 - 26 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 27 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 28 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19 - 29 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 30 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 31 0x116a3d3bf in PyEval_EvalCodeEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3959:12 - 32 0x116a3d3bf in PyEval_EvalCode /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:524 - 33 0x116a7fa0d in run_mod /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:1035:9 - 34 0x116a7fa0d in PyRun_FileExFlags /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:988 - 35 0x1135899e5 in python_script_exec source/blender/python/intern/bpy_interface_run.c:159:19 - 36 0x113589016 in BPY_run_filepath source/blender/python/intern/bpy_interface_run.c:216:10 - 37 0x10efc3d39 in arg_handle_python_file_run source/creator/creator_args.c:1750:5 - 38 0x1173bb4a3 in BLI_args_parse source/blender/blenlib/intern/BLI_args.c:300:22 - 39 0x10efc6e5b in main_args_setup_post source/creator/creator_args.c:2233:3 - 40 0x10efbaecf in main source/creator/creator.c:489:3 - 41 0x7fff59dd23d4 in start (/usr/lib/system/libdyld.dylib:x86_64+0x163d4) 0x61100008a288 is located 72 bytes inside of 248-byte region [0x61100008a240,0x61100008a338) freed by thread T0 here: - 0 0x12198c6f6 in wrap_free (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x466f6) - 1 0x1179a4e05 in rem_memblock intern/guardedalloc/intern/mallocn_guarded_impl.c:1019:5 - 2 0x11799f9b5 in MEM_guarded_freeN intern/guardedalloc/intern/mallocn_guarded_impl.c:908:7 - 3 0x1175c25c1 in BLI_freelinkN source/blender/blenlib/intern/listbase.c:290:3 - 4 0x10f0e7fb2 in WM_keymap_remove_item source/blender/windowmanager/intern/wm_keymap.c:540:5 - 5 0x113428844 in rna_KeyMap_item_remove source/blender/makesrna/intern/rna_wm_api.c:358:7 - 6 0x113428b7f in KeyMapItems_remove_call /Users/ankitkumar/blender-build/build_darwin_lite/source/blender/makesrna/intern/rna_wm_gen.c:4030:2 - 7 0x11286fda0 in RNA_function_call source/blender/makesrna/intern/rna_access.c:7554:5 - 8 0x1135e6161 in pyrna_func_call source/blender/python/intern/bpy_rna.c:6315:5 - 9 0x11697105e in _PyObject_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:199:18 - 10 0x116a47474 in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4619:17 - 11 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23 - 12 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 13 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 14 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19 - 15 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 16 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 17 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23 - 18 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 19 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 20 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23 - 21 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 22 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 23 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12 - 24 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 25 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19 - 26 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 27 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 28 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19 - 29 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 30 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 31 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12 previously allocated by thread T0 here: - 0 0x12198c982 in wrap_calloc (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x46982) - 1 0x1179a0450 in MEM_guarded_callocN intern/guardedalloc/intern/mallocn_guarded_impl.c:555:21 - 2 0x10f0e6511 in WM_keymap_add_item source/blender/windowmanager/intern/wm_keymap.c:505:23 - 3 0x113425352 in rna_KeyMap_item_new source/blender/makesrna/intern/rna_wm_api.c:258:9 - 4 0x1134265a2 in KeyMapItems_new_call /Users/ankitkumar/blender-build/build_darwin_lite/source/blender/makesrna/intern/rna_wm_gen.c:3937:9 - 5 0x11286fda0 in RNA_function_call source/blender/makesrna/intern/rna_access.c:7554:5 - 6 0x1135e6161 in pyrna_func_call source/blender/python/intern/bpy_rna.c:6315:5 - 7 0x11697105e in _PyObject_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:199:18 - 8 0x116a47474 in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4619:17 - 9 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19 - 10 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 11 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 12 0x116a43edd in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3093:23 - 13 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 14 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 15 0x1169711f8 in _PyFunction_FastCallKeywords /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:433:12 - 16 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 17 0x116a3da03 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3139:19 - 18 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 19 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 20 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19 - 21 0x11697171c in function_code_fastcall /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Objects/call.c:283:14 - 22 0x116a4747b in call_function /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:4616:17 - 23 0x116a43f77 in _PyEval_EvalFrameDefault /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3124:19 - 24 0x116a4820c in PyEval_EvalFrameEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:547:12 - 25 0x116a4820c in _PyEval_EvalCodeWithName /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3930 - 26 0x116a3d3bf in PyEval_EvalCodeEx /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:3959:12 - 27 0x116a3d3bf in PyEval_EvalCode /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/ceval.c:524 - 28 0x116a7fa0d in run_mod /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:1035:9 - 29 0x116a7fa0d in PyRun_FileExFlags /Users/brecht/dev/build_darwin/deps/build/python/src/external_python/Python/pythonrun.c:988 - 30 0x1135899e5 in python_script_exec source/blender/python/intern/bpy_interface_run.c:159:19 - 31 0x113589016 in BPY_run_filepath source/blender/python/intern/bpy_interface_run.c:216:10 - 32 0x10efc3d39 in arg_handle_python_file_run source/creator/creator_args.c:1750:5 - 33 0x1173bb4a3 in BLI_args_parse source/blender/blenlib/intern/BLI_args.c:300:22 SUMMARY: AddressSanitizer: heap-use-after-free (/Users/ankitkumar/Applications/usr/lib/clang/11.0.1/lib/darwin/libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x21952) in printf_common(void*, char const*, __va_list_tag*) Shadow bytes around the buggy address: 0x1c2200011400: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c2200011410: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x1c2200011420: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c2200011430: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fa 0x1c2200011440: fa fa fa fa fa fa fa fa fd fd fd fd fd fd fd fd =>0x1c2200011450: fd[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd 0x1c2200011460: fd fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa 0x1c2200011470: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0x1c2200011480: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 fa fa 0x1c2200011490: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00 0x1c22000114a0: 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 ==7227==ABORTING 1/1 Test #script_load_addons ...............Child aborted***Exception: 5.47 sec 0% tests passed, 1 tests failed out of 1 Total Test time (real) = 5.76 sec The following tests FAILED: 910 - script_load_addons (Child aborted) Errors while running CTest ```
Author
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Author
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Ankit Meel changed title from Heap buffer overflow in script_load_addons test to heap-use-after-free in script_load_addons test 2020-11-27 10:33:10 +01:00
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

hit this one on windows during testing, natecraddock was able to repro on chat on linux as well. i'm bumping this to high, crashing tests are not something that ought to drag on too long.

hit this one on windows during testing, natecraddock was able to repro on chat on linux as well. i'm bumping this to high, crashing tests are not something that ought to drag on too long.
Member

Added subscriber: @EAW

Added subscriber: @EAW
Member

Some additional details that may or may not help:

Run blender_debug_log.cmd
Turn Amaranth on
Go to the compositor workspace
Add an ID Mask node

rna_uiItemR: property not found: CompositorNodeIDMask.use_matching_indices

Python: Traceback (most recent call last):

File "C:\blender-git\build_windows_x64_vc16_Release\bin\2.92\scripts\addons\amaranth\node_editor\id_panel.py", line 84, in draw
if ob and node.use_matching_indices \

AttributeError: 'CompositorNodeIDMask' object has no attribute 'use_matching_indices'

location: <unknown location>:-1```
Some additional details that may or may not help: Run `blender_debug_log.cmd` Turn Amaranth on Go to the compositor workspace Add an ID Mask node ```C:\blender-git\build_windows_x64_vc16_Release\bin\2.92\scripts\addons\amaranth\node_editor\id_panel.py:63 rna_uiItemR: property not found: CompositorNodeIDMask.use_matching_indices Python: Traceback (most recent call last): ``` File "C:\blender-git\build_windows_x64_vc16_Release\bin\2.92\scripts\addons\amaranth\node_editor\id_panel.py", line 84, in draw if ob and node.use_matching_indices \ ``` AttributeError: 'CompositorNodeIDMask' object has no attribute 'use_matching_indices' location: <unknown location>:-1```
Member

That's something else, the crash appears to be caused by the object carver addon there's something wonky with its keymap

That's something else, the crash appears to be caused by the object carver addon there's something wonky with its keymap

Added subscriber: @rjg

Added subscriber: @rjg

The keymap issue appears to be caused by the greasepencil tools. In register() it tries to retrieve an existing keymap with the name "3D View", stores a reference to it and doesn't store references to the keymap items it creates and intends to remove later on. Instead in unregister() it removes all keymap items in the keymap. This may include keymap entries of another add-on, like the object carver.

Modifying the code like this, seems to avoid the problem, but I haven't tested it with ASAN yet.

diff --git a/greasepencil_tools/prefs.py b/greasepencil_tools/prefs.py
index 4c146220..fb15f4c6 100644
--- a/greasepencil_tools/prefs.py
+++ b/greasepencil_tools/prefs.py
@@ -218,21 +218,18 @@ def register_keymaps():
         return
     addon = bpy.context.window_manager.keyconfigs.addon
 
-    km = bpy.context.window_manager.keyconfigs.addon.keymaps.get("3D View")
-    if not km:
-        km = addon.keymaps.new(name = "3D View", space_type = "VIEW_3D")
+    km = addon.keymaps.new(name = "3D View", space_type = "VIEW_3D")
     
     if 'view3d.rotate_canvas' not in km.keymap_items:
         km = addon.keymaps.new(name='3D View', space_type='VIEW_3D')
         kmi = km.keymap_items.new('view3d.rotate_canvas',
         type=pref.mouse_click, value="PRESS", alt=pref.use_alt, ctrl=pref.use_ctrl, shift=pref.use_shift, any=False)
 
-        addon_keymaps.append(km)
+        addon_keymaps.append((km, kmi))
 
 def unregister_keymaps():
-    for km in addon_keymaps:
-        for kmi in km.keymap_items:
-            km.keymap_items.remove(kmi)
+    for km, kmi in addon_keymaps:
+        km.keymap_items.remove(kmi)
     addon_keymaps.clear()
The keymap issue appears to be caused by the greasepencil tools. In `register()` it tries to retrieve an existing keymap with the name "3D View", stores a reference to it and doesn't store references to the keymap items it creates and intends to remove later on. Instead in `unregister()` it removes all keymap items in the keymap. This may include keymap entries of another add-on, like the object carver. Modifying the code like this, seems to avoid the problem, but I haven't tested it with ASAN yet. ``` diff --git a/greasepencil_tools/prefs.py b/greasepencil_tools/prefs.py index 4c146220..fb15f4c6 100644 --- a/greasepencil_tools/prefs.py +++ b/greasepencil_tools/prefs.py @@ -218,21 +218,18 @@ def register_keymaps(): return addon = bpy.context.window_manager.keyconfigs.addon - km = bpy.context.window_manager.keyconfigs.addon.keymaps.get("3D View") - if not km: - km = addon.keymaps.new(name = "3D View", space_type = "VIEW_3D") + km = addon.keymaps.new(name = "3D View", space_type = "VIEW_3D") if 'view3d.rotate_canvas' not in km.keymap_items: km = addon.keymaps.new(name='3D View', space_type='VIEW_3D') kmi = km.keymap_items.new('view3d.rotate_canvas', type=pref.mouse_click, value="PRESS", alt=pref.use_alt, ctrl=pref.use_ctrl, shift=pref.use_shift, any=False) - addon_keymaps.append(km) + addon_keymaps.append((km, kmi)) def unregister_keymaps(): - for km in addon_keymaps: - for kmi in km.keymap_items: - km.keymap_items.remove(kmi) + for km, kmi in addon_keymaps: + km.keymap_items.remove(kmi) addon_keymaps.clear() ```
Author
Member

Modifying the code like this, seem to avoid the problem, but I haven't tested it with ASAN yet.

This patch is clean as per ASAN too.

> Modifying the code like this, seem to avoid the problem, but I haven't tested it with ASAN yet. This patch is clean as per ASAN too.
Robert Guetzkow self-assigned this 2020-11-28 10:46:15 +01:00
Member

Added subscriber: @Pullup

Added subscriber: @Pullup
Member

Tagging in @Pullup, the author of Grease Pencil Tools add-on, since they wrote the code in question.
Just to let them know about the issue as @rjg has claimed the task and mentioned he will submit a diff in chat.

Tagging in @Pullup, the author of Grease Pencil Tools add-on, since they wrote the code in question. Just to let them know about the issue as @rjg has claimed the task and mentioned he will submit a diff in chat.

I will submit a patch for review on Monday.

I will submit a patch for review on Monday.
Member

@rjg I'm sorry for messing up with the addon keymap ! Now I see the major flaw you mentioned ! Did you apply your patch or there is something I need to do ?
Sorry everyone !

@rjg I'm sorry for messing up with the addon keymap ! Now I see the major flaw you mentioned ! Did you apply your patch or there is something I need to do ? Sorry everyone !

@Pullup No worries. There's nothing you have to do, I will submit a patch on Monday for review and it should then be committed soon after, once approved.

@Pullup No worries. There's nothing you have to do, I will submit a patch on Monday for review and it should then be committed soon after, once approved.

This issue was referenced by blender/blender-addons@73976fd55a

This issue was referenced by blender/blender-addons@73976fd55a45d48b8e86c163375f26d5c5a7be68

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
6 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#83099
No description provided.