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

Freeze when importing files #49324

Closed
tomasantunes opened this issue Jun 4, 2021 · 2 comments
Closed

Freeze when importing files #49324

tomasantunes opened this issue Jun 4, 2021 · 2 comments

Comments

@tomasantunes
Copy link
Contributor

Godot version:

4.0 766c6db

OS/device including version:
Windows 10

Issue description:
Editor freezes when importing files.

Steps to reproduce:

  1. Create new project
  2. Drag and drop files from folder to FileSystem tab.

godot-screenshot1
godot-screenshot2

@qarmin
Copy link
Contributor

qarmin commented Jun 4, 2021

Looks that something corrupt underlying memory.
For me importing 1000 images causes it - FF2.zip

Address sanitizer

ERROR: Condition "p_node == _data._nil && p_color == RED" is true.
   at: _set_color (./core/templates/set.h:121)
ERROR: Condition "p_node == _data._nil && p_color == RED" is true.
   at: _set_color (./core/templates/set.h:121)
==430245==ERROR: AddressSanitizer: global-buffer-overflow on address 0x00005013ea00 at pc 0x00000219d0ca bp 0x7f6141828040 sp 0x7f6141828030
WRITE of size 8 at 0x00005013ea00 thread T54
    #0 0x219d0c9 in Set<String, Comparator<String>, DefaultAllocator>::_insert(String const&) core/templates/set.h:330
    #1 0x2194ebb in Set<String, Comparator<String>, DefaultAllocator>::insert(String const&) core/templates/set.h:514
    #2 0x9e5ccb1 in EditorFileSystem::_reimport_file(String const&, Map<StringName, Variant, Comparator<StringName>, DefaultAllocator> const*, String const&) editor/editor_file_system.cpp:1728
    #3 0x9e69770 in EditorFileSystem::_reimport_thread(unsigned int, EditorFileSystem::ImportThreadData*) editor/editor_file_system.cpp:1933
    #4 0x9eb106b in ThreadWorkPool::Work<EditorFileSystem, void (EditorFileSystem::*)(unsigned int, EditorFileSystem::ImportThreadData*), EditorFileSystem::ImportThreadData*>::work() core/templates/thread_work_pool.h:61
    #5 0x1620db07 in ThreadWorkPool::_thread_function(void*) core/templates/thread_work_pool.cpp:42
    #6 0x14fac1a4 in Thread::callback(Thread*, Thread::Settings const&, void (*)(void*), void*) core/os/thread.cpp:72
    #7 0x14fb0319 in void std::__invoke_impl<void, void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>(std::__invoke_other, void (*&&)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*&&, Thread::Settings&&, void (*&&)(void*), void*&&) /usr/include/c++/10/bits/invoke.h:60
    #8 0x14fafbe7 in std::__invoke_result<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>::type std::__invoke<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*>(void (*&&)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*&&, Thread::Settings&&, void (*&&)(void*), void*&&) /usr/include/c++/10/bits/invoke.h:95
    #9 0x14faf74f in void std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> >::_M_invoke<0ul, 1ul, 2ul, 3ul, 4ul>(std::_Index_tuple<0ul, 1ul, 2ul, 3ul, 4ul>) /usr/include/c++/10/thread:264
    #10 0x14faf3e6 in std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> >::operator()() /usr/include/c++/10/thread:271
    #11 0x14faf39e in std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)(Thread*, Thread::Settings const&, void (*)(void*), void*), Thread*, Thread::Settings, void (*)(void*), void*> > >::_M_run() /usr/include/c++/10/thread:215
    #12 0x174e41e3 in execute_native_thread_routine (/usr/bin/godot4s+0x174e41e3)
    #13 0x7f618612644f in start_thread nptl/pthread_create.c:473
    #14 0x7f618557fd52 in clone (/lib/x86_64-linux-gnu/libc.so.6+0x117d52)

0x00005013ea00 is located 0 bytes to the right of global variable '_nil' defined in 'core/os/memory.cpp:200:12' (0x5013e9e0) of size 32
SUMMARY: AddressSanitizer: global-buffer-overflow core/templates/set.h:330 in Set<String, Comparator<String>, DefaultAllocator>::_insert(String const&)
Shadow bytes around the buggy address:
  0x00008a01fcf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f9
  0x00008a01fd00: f9 f9 f9 f9 00 00 00 00 00 00 00 f9 f9 f9 f9 f9
  0x00008a01fd10: 00 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9
  0x00008a01fd20: 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x00008a01fd30: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00
=>0x00008a01fd40:[f9]f9 f9 f9 00 00 00 00 01 f9 f9 f9 f9 f9 f9 f9
  0x00008a01fd50: 00 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9
  0x00008a01fd60: f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x00008a01fd70: f9 f9 f9 f9 00 00 00 00 00 f9 f9 f9 f9 f9 f9 f9
  0x00008a01fd80: 00 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9 f9 f9 f9 f9
  0x00008a01fd90: 00 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9
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
Thread T54 created by T0 here:
    #0 0x7f61863b16d5 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216
    #1 0x174e44a8 in std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) (/usr/bin/godot4s+0x174e44a8)
    #2 0x14fac694 in Thread::start(void (*)(void*), void*, Thread::Settings const&) core/os/thread.cpp:88
    #3 0x1620e6e0 in ThreadWorkPool::init(int) core/templates/thread_work_pool.cpp:58
    #4 0x9e7675d in EditorFileSystem::EditorFileSystem() editor/editor_file_system.cpp:2193
    #5 0xa23ff92 in EditorNode::EditorNode() editor/editor_node.cpp:5851
    #6 0x217db94 in Main::start() main/main.cpp:2151
    #7 0x2024f74 in main platform/linuxbsd/godot_linuxbsd.cpp:57
    #8 0x7f6185490564 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x28564)

@lyuma
Copy link
Contributor

lyuma commented Jun 17, 2021

@tomasantunes your issue is addressed in #49682
@qarmin your issue is addressed in #49683

Godot 4.0 alpha TODOs automation moved this from Blocker bugs to Done Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

5 participants