Page MenuHome

Assign Shortcut bug to x-ray
Closed, DuplicatePublic

Description

System Information
Operating system: Windows-10-10.0.17763 64 Bits
Graphics card: GeForce GTX 1050/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 417.71

Blender Version
Broken: version: 2.80 (sub 75), branch: master, commit date: 2019-07-29 14:47, hash: rBf6cb5f54494e
Worked: (optional)

Short description of error
[Please fill out a short description of the error here]

Exact steps for others to reproduce the error
I right clicked on xray, selected assign shortcut, assigned 'shift + alt + x' , went to viewport and tried it. Got this error:
https://media.discordapp.net/attachments/439399976993292293/607608954448642083/unknown.png?width=1120&height=630

xray did not toggle. I then went into preferences and assigned the same keyboard shortcut and it works. Something is wrong with the right click, assign shortcut for xrays as it seems to work fine for the other ones i have assigned such as wireframe.

Details

Type
Bug

Event Timeline

Same thing happened to me. This button doesn't work well with two bindings.
For now if you want to change it, you'll have to find it in the keymap and set it there.
It's normally set to Alt-Z in the "Blender" Keymap.


This normally has a binding but you can still "Assign" a shortcut to it.

Sybren A. Stüvel (sybren) triaged this task as Confirmed, Medium priority.Tue, Aug 6, 3:35 PM
Sybren A. Stüvel (sybren) removed Sybren A. Stüvel (sybren) as the assignee of this task.

The problem lies in the fact that the shortcut assignment binds to the wm.context_toggle operator with parameter '(null).shading.show_xray'. I can't quite figure out how this data path is constructed, so I'll leave this task to someone more versed in the ins and outs of UI code.

While debugging this, ASAN showed me the following error. Strangely enough this error only occurs when I've attached gdb as debugger. Running the same debug build without a debugger attached doesn't trigger this error.

=================================================================
==17562==ERROR: AddressSanitizer: heap-use-after-free on address 0x6190006fcb28 at pc 0x555569ee353e bp 0x7fffffffcb70 sp 0x7fffffffcb60
READ of size 8 at 0x6190006fcb28 thread T0
    #0 0x555569ee353d in shortcut_get_operator_property /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_context_menu.c:95
    #1 0x555569ee3bb0 in but_shortcut_name_func /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_context_menu.c:130
    #2 0x555569c98927 in ui_apply_but_funcs_after /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_handlers.c:862
    #3 0x555569d18170 in ui_popup_handler /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_handlers.c:10259
    #4 0x555568ae9b7e in wm_handler_ui_call /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:623
    #5 0x555568afff64 in wm_handlers_do_intern /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2699
    #6 0x555568b02c09 in wm_handlers_do /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:2945
    #7 0x555568b07c2e in wm_event_do_handlers /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_event_system.c:3323
    #8 0x555568acf8f3 in WM_main /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm.c:417
    #9 0x555566d0c8b5 in main /home/sybren/workspace/blender-git/blender/source/creator/creator.c:491
    #10 0x7ffff2a31b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)
    #11 0x555566d0bc29 in _start (/home/sybren/workspace/blender-git/build_debug/bin/blender+0x117b7c29)

0x6190006fcb28 is located 936 bytes inside of 1064-byte region [0x6190006fc780,0x6190006fcba8)
freed by thread T0 here:
    #0 0x7ffff767504f in __interceptor_free (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10c04f)
    #1 0x55556809fbef in MEM_lockfree_freeN /home/sybren/workspace/blender-git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:157
    #2 0x555569c47083 in ui_but_free /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:3095
    #3 0x555569c2da1e in ui_but_update_from_old_block /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:841
    #4 0x555569c33408 in UI_block_update_from_old /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:1488
    #5 0x555569c33d3d in UI_block_end_ex /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:1515
    #6 0x555569c349b3 in UI_block_end /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:1599
    #7 0x55556b04ff08 in ED_region_header_layout /home/sybren/workspace/blender-git/blender/source/blender/editors/screen/area.c:2654
    #8 0x55556b050368 in ED_region_header /home/sybren/workspace/blender-git/blender/source/blender/editors/screen/area.c:2688
    #9 0x55556ac385fc in view3d_header_region_draw /home/sybren/workspace/blender-git/blender/source/blender/editors/space_view3d/space_view3d.c:1101
    #10 0x55556b02d77b in ED_region_do_draw /home/sybren/workspace/blender-git/blender/source/blender/editors/screen/area.c:567
    #11 0x555568ae0841 in wm_draw_window_offscreen /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_draw.c:621
    #12 0x555568ae1afe in wm_draw_window /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_draw.c:757
    #13 0x555568ae2eb4 in wm_draw_update /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm_draw.c:939
    #14 0x555568acf90b in WM_main /home/sybren/workspace/blender-git/blender/source/blender/windowmanager/intern/wm.c:423
    #15 0x555566d0c8b5 in main /home/sybren/workspace/blender-git/blender/source/creator/creator.c:491
    #16 0x7ffff2a31b6a in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x26b6a)

previously allocated by thread T0 here:
    #0 0x7ffff767563e in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0x10c63e)
    #1 0x5555680a033b in MEM_lockfree_callocN /home/sybren/workspace/blender-git/blender/intern/guardedalloc/intern/mallocn_lockfree_impl.c:267
    #2 0x555569c4c8cb in ui_but_alloc /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:3550
    #3 0x555569c4cc05 in ui_def_but /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:3598
    #4 0x555569c53b21 in ui_def_but_rna /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:4141
    #5 0x555569c56d1b in uiDefIconButR_prop /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface.c:5128
    #6 0x555569e3f3c7 in uiDefAutoButR /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_utils.c:75
    #7 0x555569d4eee8 in uiItemFullR /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_layout.c:2164
    #8 0x5555689c48aa in rna_uiItemR /home/sybren/workspace/blender-git/blender/source/blender/makesrna/intern/rna_ui_api.c:136
    #9 0x5555689d1bfd in UILayout_prop_call source/blender/makesrna/intern/rna_ui_gen.c:1778
    #10 0x55556827616e in RNA_function_call /home/sybren/workspace/blender-git/blender/source/blender/makesrna/intern/rna_access.c:7422
    #11 0x555568116933 in pyrna_func_call /home/sybren/workspace/blender-git/blender/source/blender/python/intern/bpy_rna.c:6116
    #12 0x7ffff6f92c52 in _PyObject_FastCallKeywords Objects/call.c:199

SUMMARY: AddressSanitizer: heap-use-after-free /home/sybren/workspace/blender-git/blender/source/blender/editors/interface/interface_context_menu.c:95 in shortcut_get_operator_property
Shadow bytes around the buggy address:
  0x0c32800d7910: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c32800d7920: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c32800d7930: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c32800d7940: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c32800d7950: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x0c32800d7960: fd fd fd fd fd[fd]fd fd fd fd fd fd fd fd fd fd
  0x0c32800d7970: fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa fa
  0x0c32800d7980: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0c32800d7990: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c32800d79a0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x0c32800d79b0: 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
==17562==ABORTING