GentenStudios / Phoenix-OLD

Phoenix is an open world sandbox style voxel game designed to make all content optional.
BSD 3-Clause "New" or "Revised" License
30 stars 10 forks source link

Game segfaults when placing a block. #350

Closed JosiahWI closed 3 years ago

JosiahWI commented 3 years ago

Describe the bug

When the user attempts to place a block the game crashes. This bug was first discovered by Gerold55, running a build I compiled on my system, and confirmed by me running the same build on my system.

To Reproduce

Steps to reproduce the behavior:

  1. Open game
  2. Right click on any block

Expected behavior

We expected it to place a block.

Screenshots

Environment/System

Additional context

JosiahWI commented 3 years ago

==6218== Memcheck, a memory error detector ==6218== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al. ==6218== Using Valgrind-3.14.0 and LibVEX; rerun with -h for copyright info ==6218== Command: ./PhoenixClient ==6218== ==6218== Conditional jump or move depends on uninitialised value(s) ==6218== at 0x74477A7: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x73E5163: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x73E7DAE: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x7526214: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x7527C62: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x741F247: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x741F54C: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x741F5B6: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x75263CB: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x752FD8B: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x70A72C1: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x70A7645: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== ==6218== Conditional jump or move depends on uninitialised value(s) ==6218== at 0x74477A7: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x73E5163: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x73E5BA3: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x7561E7D: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x7563404: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x741F247: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x741F54C: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x741F5B6: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x756227D: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x75346E8: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x73DE57F: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== by 0x73B8668: ??? (in /usr/lib/i386-linux-gnu/libnvidia-glcore.so.340.108) ==6218== [INFO][SAVES] Save doesn't exist, creating. [INFO][MODULE] Load mod 3 [INFO][MAIN] Registering world [INFO][MAIN] Prepare rendering [INFO][MAIN] Register GUI [INFO][MAIN] Game layer attached ==6218== Invalid read of size 4 ==6218== at 0x12B2B6: std::cxx11::basic_string<char, std::char_traits, std::allocator >::size() const (basic_string.h:931) ==6218== by 0x13A54A: std::cxx11::basic_string<char, std::char_traits, std::allocator >::empty() const (basic_string.h:1032) ==6218== by 0x1F229D: phx::ActorSystem::action2(entt::basic_registry*, entt::entity) (Actor.cpp:167) ==6218== by 0x189093: phx::client::Game::onEvent(phx::events::Event&) (Game.cpp:282) ==6218== by 0x127796: phx::gfx::LayerStack::onEvent(phx::events::Event) (LayerStack.cpp:158) ==6218== by 0x1815FB: phx::client::Client::onEvent(phx::events::Event) (Client.cpp:138) ==6218== by 0x12580F: phx::gfx::Window::dispatchToListeners(phx::events::Event&) (Window.cpp:326) ==6218== by 0x1251C3: phx::gfx::Window::pollEvents() (Window.cpp:166) ==6218== by 0x125566: phx::gfx::Window::endFrame() (Window.cpp:286) ==6218== by 0x181835: phx::client::Client::run() (Client.cpp:169) ==6218== by 0x1CBE65: main (Main.cpp:50) ==6218== Address 0x38 is not stack'd, malloc'd or (recently) free'd ==6218== ==6218== ==6218== Process terminating with default action of signal 11 (SIGSEGV) ==6218== Access not within mapped region at address 0x38 ==6218== at 0x12B2B6: std::cxx11::basic_string<char, std::char_traits, std::allocator >::size() const (basic_string.h:931) ==6218== by 0x13A54A: std::cxx11::basic_string<char, std::char_traits, std::allocator >::empty() const (basic_string.h:1032) ==6218== by 0x1F229D: phx::ActorSystem::action2(entt::basic_registry*, entt::entity) (Actor.cpp:167) ==6218== by 0x189093: phx::client::Game::onEvent(phx::events::Event&) (Game.cpp:282) ==6218== by 0x127796: phx::gfx::LayerStack::onEvent(phx::events::Event) (LayerStack.cpp:158) ==6218== by 0x1815FB: phx::client::Client::onEvent(phx::events::Event) (Client.cpp:138) ==6218== by 0x12580F: phx::gfx::Window::dispatchToListeners(phx::events::Event&) (Window.cpp:326) ==6218== by 0x1251C3: phx::gfx::Window::pollEvents() (Window.cpp:166) ==6218== by 0x125566: phx::gfx::Window::endFrame() (Window.cpp:286) ==6218== by 0x181835: phx::client::Client::run() (Client.cpp:169) ==6218== by 0x1CBE65: main (Main.cpp:50) ==6218== If you believe this happened as a result of a stack ==6218== overflow in your program's main thread (unlikely but ==6218== possible), you can try to increase the size of the ==6218== main thread stack using the --main-stacksize= flag. ==6218== The main thread stack size used in this run was 8388608. ==6218== ==6218== HEAP SUMMARY: ==6218== in use at exit: 88,461,459 bytes in 5,929 blocks ==6218== total heap usage: 56,654 allocs, 50,725 frees, 486,428,154 bytes allocated ==6218== ==6218== LEAK SUMMARY: ==6218== definitely lost: 205 bytes in 7 blocks ==6218== indirectly lost: 104 bytes in 4 blocks ==6218== possibly lost: 78,458,908 bytes in 497 blocks ==6218== still reachable: 10,002,242 bytes in 5,421 blocks ==6218== of which reachable via heuristic: ==6218== newarray : 8 bytes in 1 blocks ==6218== multipleinheritance: 60 bytes in 1 blocks ==6218== suppressed: 0 bytes in 0 blocks ==6218== Rerun with --leak-check=full to see details of leaked memory ==6218== ==6218== For counts of detected and suppressed errors, rerun with: -v ==6218== Use --track-origins=yes to see where uninitialised values come from ==6218== ERROR SUMMARY: 18 errors from 3 contexts (suppressed: 0 from 0) Segmentation fault

apachano commented 3 years ago

GCC 3.8? Also, did you build debug or release?

JosiahWI commented 3 years ago

Sorry, the version should be 8.3.0, and it was a Debug build.

JosiahWI commented 3 years ago

This issue is resolved by #347.

vyomfadia commented 3 years ago

Resolved in #352