jmorton06 / Lumos

Cross-Platform C++ 2D/3D game engine
MIT License
1.21k stars 130 forks source link

Lumos engine(Version 0.3.7) will crash when launching LumosEditor. #108

Closed Wuqiqi123 closed 1 year ago

Wuqiqi123 commented 1 year ago

Describe the bug

Lumos engine(commit ca484fca8ce5cf00c3c73db9bff17aa38290984b) will crash when calling ImFontAtlas::GetTexDataAsRGBA32.

To Reproduce

  1. git clone https://github.com/jmorton06/Lumos.git && cd Lumos

  2. Tools/linux/premake5 gmake2 && cd build

  3. make -j6

  4. cd ../bin/Debug-linux-x86_64

  5. gdb ./LumosEditor

  6. See error

    
    Reading symbols from LumosEditor...
    (gdb) run
    Starting program: /home/xyz/Lumos/bin/Debug-linux-x86_64/LumosEditor 
    [Thread debugging using libthread_db enabled]
    Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
    [New Thread 0x7ffff25a2700 (LWP 1705725)]
    [New Thread 0x7ffff1991700 (LWP 1705726)]
    [New Thread 0x7ffff0d80700 (LWP 1705727)]
    [New Thread 0x7ffff057f700 (LWP 1705728)]
    [14:50:03] Lumos Engine - Version 0.3.7
    [New Thread 0x7fffee0f8700 (LWP 1705729)]
    [New Thread 0x7fffed8f7700 (LWP 1705730)]
    [New Thread 0x7fffecce6700 (LWP 1705731)]
    [New Thread 0x7fffec0d5700 (LWP 1705732)]
    [New Thread 0x7fffeb8d4700 (LWP 1705733)]
    [14:50:03] Initialised JobSystem with [6 cores] [5 threads]
    [14:50:03] Initialising System
    [14:50:03] Loaded Editor Ini file Editor.ini
    [14:50:03] No saved Project file found ../ExampleProject/Example.lmproj
    [14:50:03] [SceneManager] - Enqueued scene : Empty Scene
    [14:50:03] VSync : True
    [14:50:03] Creating window - Title : App, Width : 1200, Height : 800
    [14:50:03] Failed to load app icon //Textures/icon.png
    [14:50:03] Initialised GLFW version : 3.3.4 X11 GLX EGL OSMesa clock_gettime evdev
    [14:50:03] Vulkan : Enabled Validation Layers
    [14:50:03] Vulkan : 1.3.194
    [14:50:03] GPU : NVIDIA GeForce RTX 2060
    [14:50:03] Memory : 6144 mb
    [14:50:03] Vendor : Nvidia
    [14:50:03] Vendor ID : 4318
    [14:50:03] Device Type : DISCRETE GPU
    [14:50:03] Driver Version : 510.108.3.0
    [14:50:03] APi Version : 1.0.195.2
    [14:50:03] Selected physical device has 154 extensions
    [New Thread 0x7fffd7e8c700 (LWP 1705734)]
    [New Thread 0x7fffd768b700 (LWP 1705735)]
    [New Thread 0x7fffd65d7700 (LWP 1705736)]
    [14:50:04] Loading shaders - files
    [14:50:04] Loading Shader : Skybox.shader
    [14:50:04] Loading Shader : ForwardPBR.shader
    [14:50:04] Loading Shader : Shadow.shader
    [14:50:04] Loading Shader : Batch2DPoint.shader
    [14:50:04] Loading Shader : Batch2DLine.shader
    [14:50:04] Loading Shader : Batch2D.shader
    [14:50:04] Loading Shader : ScreenPass.shader
    [14:50:04] Loading Shader : Grid.shader
    [14:50:04] Loading Shader : CreateEnvironmentMap.shader
    [14:50:04] Loading Shader : FXAA.shader
    [14:50:04] Loading Shader : Debanding.shader
    [14:50:04] Loading Shader : FilmicGrain.shader
    [14:50:04] Loading Shader : ChromaticAberation.shader
    [14:50:04] Loading Shader : DepthPrePass.shader
    [14:50:04] Loading Shader : ToneMapping.shader
    [14:50:04] Loading Shader : Bloom.shader
    [14:50:04] Loading Shader : DepthOfField.shader
    [14:50:04] Loading Shader : BRDFLUT.shader
    [14:50:04] Loading Shader : Text.shader
    [14:50:04] Loading Shader : SSAO.shader
    [14:50:04] ImGui Version : 1.89 WIP
    [14:50:04] ImConfig File : Source/Lumos/ImGui/ImConfig.h
    [New Thread 0x7fffd58fc700 (LWP 1705737)]
    [Thread 0x7fffd58fc700 (LWP 1705737) exited]
    [New Thread 0x7fff91b81700 (LWP 1705738)]
    [Thread 0x7fff91b81700 (LWP 1705738) exited]
    [New Thread 0x7fff91b81700 (LWP 1705739)]
    malloc(): corrupted top size

Thread 1 "LumosEditor" received signal SIGABRT, Aborted. __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50 50 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory. (gdb) bt

0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50

1 0x00007ffff780e859 in __GI_abort () at abort.c:79

2 0x00007ffff787926e in __libc_message (action=action@entry=do_abort, fmt=fmt@entry=0x7ffff79a3298 "%s\n")

at ../sysdeps/posix/libc_fatal.c:155

3 0x00007ffff78812fc in malloc_printerr (str=str@entry=0x7ffff79a1569 "malloc(): corrupted top size") at malloc.c:5347

4 0x00007ffff78846ba in _int_malloc (av=av@entry=0x7ffff79d8b80 , bytes=bytes@entry=33554432) at malloc.c:4107

5 0x00007ffff7886299 in __GI___libc_malloc (bytes=33554432) at malloc.c:3066

6 0x00005555563c91a3 in MallocWrapper (size=33554432, user_data=0x0) at ../Lumos/External/imgui/imgui.cpp:1077

7 0x00005555563d3552 in ImGui::MemAlloc (size=33554432) at ../Lumos/External/imgui/imgui.cpp:3800

8 0x000055555645d769 in ImFontAtlasBuildWithStbTruetype (atlas=0x555558e9b420) at ../Lumos/External/imgui/imgui_draw.cpp:2531

9 0x000055555645c51d in ImFontAtlas::Build (this=0x555558e9b420) at ../Lumos/External/imgui/imgui_draw.cpp:2295

10 0x000055555645b051 in ImFontAtlas::GetTexDataAsAlpha8 (this=0x555558e9b420, out_pixels=0x7fffffffcbc0, out_width=0x0,

out_height=0x0, out_bytes_per_pixel=0x0) at ../Lumos/External/imgui/imgui_draw.cpp:2051

11 0x000055555645b104 in ImFontAtlas::GetTexDataAsRGBA32 (this=0x555558e9b420, out_pixels=0x7fffffffcc68, out_width=0x7fffffffcc10,

out_height=0x7fffffffcc14, out_bytes_per_pixel=0x0) at ../Lumos/External/imgui/imgui_draw.cpp:2066

12 0x0000555555fb7472 in Lumos::Graphics::VKIMGUIRenderer::Init (this=0x555558c3c9a0)

at ../Lumos/Source/Lumos/Platform/Vulkan/VKIMGUIRenderer.cpp:200

13 0x00005555558fe26a in Lumos::ImGuiManager::OnInit (this=0x5555596dec90) at ../Lumos/Source/Lumos/ImGui/ImGuiManager.cpp:95

14 0x00005555556ebf86 in Lumos::Application::Init (this=0x5555570df8c0) at ../Lumos/Source/Lumos/Core/Application.cpp:258

15 0x00005555555bff0a in Lumos::Editor::Init (this=0x5555570df8c0) at ../Editor/Source/Editor.cpp:150

16 0x0000555555faf090 in Lumos::UnixOS::Run (this=0x5555570df8a0) at ../Lumos/Source/Lumos/Platform/Unix/UnixOS.cpp:17

17 0x00005555556c01a4 in main (argc=1, argv=0x7fffffffd908) at ../Lumos/Source/Lumos/Core/EntryPoint.h:60



**Desktop:**
 - OS: Ubuntu20.04

****
The old version of Lumos(0ef5f58f069550f8b609ad265916e2ee299ee26d) doesn't has this issue.
ghost commented 1 year ago

Same here on Windows, why was this version even released? Edit: Never mind, none of the windows releases I've tried are working anyway.

jmorton06 commented 1 year ago

This should be fixed now

Wuqiqi123 commented 1 year ago

This should be fixed now

Yes! Thanks a lot.