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

Added Import Defaults Editor in Project Settings #46354

Merged
merged 1 commit into from
Feb 24, 2021

Conversation

reduz
Copy link
Member

@reduz reduz commented Feb 23, 2021

  • Change importer defaults in project settings.
  • Ability to change them or reset them.

image

If somebody wants to give it a try, this should be easy to cherry-pick for 3.x.

-Change importer defaults in project settings.
-Ability to change them or reset them.
@akien-mga akien-mga merged commit 049d654 into godotengine:master Feb 24, 2021
@akien-mga
Copy link
Member

Thanks!

@bruvzg
Copy link
Member

bruvzg commented Feb 24, 2021

This cause use-after-free errors on editor exit, seems like something is freed in the incorrect order.

editor/import_defaults_editor.cpp:192:13: runtime error: member call on address 0x61b00022dd90 which does not point to an object of type 'EditorInspector'
0x61b00022dd90: note: object is of type 'Object'
 be be be be  30 45 31 26 01 00 00 00  00 00 00 00 00 00 00 00  00 be be be 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Object'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior editor/import_defaults_editor.cpp:192:13 in
editor/editor_inspector.cpp:2069:6: runtime error: member access within address 0x61b00022dd90 which does not point to an object of type 'EditorInspector'
0x61b00022dd90: note: object is of type 'Object'
 be be be be  30 45 31 26 01 00 00 00  00 00 00 00 00 00 00 00  00 be be be 00 00 00 00  00 00 00 00
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'Object'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior editor/editor_inspector.cpp:2069:6 in
=================================================================
==37117==ERROR: AddressSanitizer: heap-use-after-free on address 0x61b00022e270 at pc 0x0001109ad766 bp 0x7ffee8818210 sp 0x7ffee8818208
READ of size 8 at 0x61b00022e270 thread T0
    #0 0x1109ad765 in EditorInspector::edit(Object*) editor_inspector.cpp:2069
    #1 0x11162ca06 in ImportDefaultsEditor::~ImportDefaultsEditor() import_defaults_editor.cpp:192
    #2 0x11162cd54 in ImportDefaultsEditor::~ImportDefaultsEditor() import_defaults_editor.cpp:191
    #3 0x110b243b4 in void memdelete<Node>(Node*) memory.h:115
    #4 0x11475f760 in Node::_notification(int) node.cpp:169
    #5 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #6 0x1144b1af7 in CanvasItem::_notificationv(int, bool) canvas_item.h:164
    #7 0x1144b15c7 in Control::_notificationv(int, bool) control.h:47
    #8 0x1144d20d7 in Container::_notificationv(int, bool) container.h:37
    #9 0x115884147 in TabContainer::_notificationv(int, bool) tab_container.h:39
    #10 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #11 0x11e513954 in Object::_predelete() object.cpp:354
    #12 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #13 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #14 0x11475f760 in Node::_notification(int) node.cpp:169
    #15 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #16 0x11199c6d7 in Viewport::_notificationv(int, bool) viewport.h:87
    #17 0x11199c1a7 in Window::_notificationv(int, bool) window.h:40
    #18 0x111adeaf7 in AcceptDialog::_notificationv(int, bool) dialogs.h:45
    #19 0x111b5fb77 in ProjectSettingsEditor::_notificationv(int, bool) project_settings_editor.h:46
    #20 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #21 0x11e513954 in Object::_predelete() object.cpp:354
    #22 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #23 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #24 0x11475f760 in Node::_notification(int) node.cpp:169
    #25 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #26 0x1144b1af7 in CanvasItem::_notificationv(int, bool) canvas_item.h:164
    #27 0x1144b15c7 in Control::_notificationv(int, bool) control.h:47
    #28 0x11543d957 in Panel::_notificationv(int, bool) panel.h:37
    #29 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #30 0x11e513954 in Object::_predelete() object.cpp:354
    #31 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #32 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #33 0x11475f760 in Node::_notification(int) node.cpp:169
    #34 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #35 0x1144b1af7 in CanvasItem::_notificationv(int, bool) canvas_item.h:164
    #36 0x1144b15c7 in Control::_notificationv(int, bool) control.h:47
    #37 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #38 0x11e513954 in Object::_predelete() object.cpp:354
    #39 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #40 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #41 0x11475f760 in Node::_notification(int) node.cpp:169
    #42 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #43 0x110c94497 in EditorNode::_notificationv(int, bool) editor_node.h:93
    #44 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #45 0x11e513954 in Object::_predelete() object.cpp:354
    #46 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #47 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #48 0x11475f760 in Node::_notification(int) node.cpp:169
    #49 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #50 0x11199c6d7 in Viewport::_notificationv(int, bool) viewport.h:87
    #51 0x11199c1a7 in Window::_notificationv(int, bool) window.h:40
    #52 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #53 0x11e513954 in Object::_predelete() object.cpp:354
    #54 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #55 0x114a050bd in void memdelete<Window>(Window*) memory.h:111
    #56 0x1148c0229 in SceneTree::finalize() scene_tree.cpp:525
    #57 0x1073f01d0 in OS_OSX::run() os_osx.mm:332
    #58 0x107526f36 in main godot_main_osx.mm:79
    #59 0x7fff2039b620 in start+0x0 (libdyld.dylib:x86_64+0x15620)

0x61b00022e270 is located 1264 bytes inside of 1456-byte region [0x61b00022dd80,0x61b00022e330)
freed by thread T0 here:
    #0 0x13afb3fa6 in wrap_free+0xa6 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x45fa6)
    #1 0x11c7b44d1 in Memory::free_static(void*, bool) memory.cpp:169
    #2 0x110b243c2 in void memdelete<Node>(Node*) memory.h:118
    #3 0x11475f760 in Node::_notification(int) node.cpp:169
    #4 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #5 0x1144b1af7 in CanvasItem::_notificationv(int, bool) canvas_item.h:164
    #6 0x1144b15c7 in Control::_notificationv(int, bool) control.h:47
    #7 0x1144d20d7 in Container::_notificationv(int, bool) container.h:37
    #8 0x1144d1b47 in BoxContainer::_notificationv(int, bool) box_container.h:37
    #9 0x1144d4afc in VBoxContainer::_notificationv(int, bool) box_container.h:78
    #10 0x11162e92c in ImportDefaultsEditor::_notificationv(int, bool) import_defaults_editor.h:48
    #11 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #12 0x11e513954 in Object::_predelete() object.cpp:354
    #13 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #14 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #15 0x11475f760 in Node::_notification(int) node.cpp:169
    #16 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #17 0x1144b1af7 in CanvasItem::_notificationv(int, bool) canvas_item.h:164
    #18 0x1144b15c7 in Control::_notificationv(int, bool) control.h:47
    #19 0x1144d20d7 in Container::_notificationv(int, bool) container.h:37
    #20 0x115884147 in TabContainer::_notificationv(int, bool) tab_container.h:39
    #21 0x11e513d6c in Object::notification(int, bool) object.cpp:793
    #22 0x11e513954 in Object::_predelete() object.cpp:354
    #23 0x11e55f832 in predelete_handler(Object*) object.cpp:1814
    #24 0x110b2425d in void memdelete<Node>(Node*) memory.h:111
    #25 0x11475f760 in Node::_notification(int) node.cpp:169
    #26 0x1144b1ede in Node::_notificationv(int, bool) node.h:45
    #27 0x11199c6d7 in Viewport::_notificationv(int, bool) viewport.h:87
    #28 0x11199c1a7 in Window::_notificationv(int, bool) window.h:40
    #29 0x111adeaf7 in AcceptDialog::_notificationv(int, bool) dialogs.h:45

previously allocated by thread T0 here:
    #0 0x13afb3e5d in wrap_malloc+0x9d (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x45e5d)
    #1 0x11c7b2ec1 in Memory::alloc_static(unsigned long, bool) memory.cpp:76
    #2 0x11c7b2d34 in operator new(unsigned long, char const*) memory.cpp:41
    #3 0x11162a135 in ImportDefaultsEditor::ImportDefaultsEditor() import_defaults_editor.cpp:178
    #4 0x11162c7d4 in ImportDefaultsEditor::ImportDefaultsEditor() import_defaults_editor.cpp:165
    #5 0x111b59979 in ProjectSettingsEditor::ProjectSettingsEditor(EditorData*) project_settings_editor.cpp:697
    #6 0x111b5e03c in ProjectSettingsEditor::ProjectSettingsEditor(EditorData*) project_settings_editor.cpp:509
    #7 0x110c263dd in EditorNode::EditorNode() editor_node.cpp:6170
    #8 0x110c8f4a4 in EditorNode::EditorNode() editor_node.cpp:5611
    #9 0x107585d18 in Main::start() main.cpp:2142
    #10 0x107526e92 in main godot_main_osx.mm:78
    #11 0x7fff2039b620 in start+0x0 (libdyld.dylib:x86_64+0x15620)

SUMMARY: AddressSanitizer: heap-use-after-free editor_inspector.cpp:2069 in EditorInspector::edit(Object*)
Shadow bytes around the buggy address:
  0x1c3600045bf0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c3600045c00: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c3600045c10: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c3600045c20: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c3600045c30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
=>0x1c3600045c40: fd fd fd fd fd fd fd fd fd fd fd fd fd fd[fd]fd
  0x1c3600045c50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
  0x1c3600045c60: fd fd fd fd fd fd fa fa fa fa fa fa fa fa fa fa
  0x1c3600045c70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3600045c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c3600045c90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
==37117==ABORTING

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants