vegastrike / Vega-Strike-Engine-Source

Vega Strike Engine
Other
260 stars 44 forks source link

Revert "Big refactor to fix crash in mesh destructor" #779

Closed BenjamenMeyer closed 1 year ago

BenjamenMeyer commented 1 year ago

Reverts vegastrike/Vega-Strike-Engine-Source#754

BenjamenMeyer commented 1 year ago

Confirmed changes from #771 are still present. That was the only PR after #754 that was merged in.

BenjamenMeyer commented 1 year ago

Disabled Manjaro from the PR CI builds

evertvorster commented 1 year ago

Reverting this one will bring back the graphics on the menus? If that's the case, I can't wait for it to be merged. :)

royfalk commented 1 year ago

I don't know about the code, but the game works again. Approved.

BenjamenMeyer commented 1 year ago

@evertvorster yes I can confirm the game generally plays how it use to. I was playing it some last night to confirm; though ran into a crash after saving the game and having issues with that saved game and getting some odd stacktrace that are not tracking back to the code properly (see frame 9 below which should track to our code). I don't think it's an issue with the engine in particular so I wouldn't block this on it but still can't figure out why GDB won't actually go to the source line in question for that frame. I probably need to regen my local assets.

Thread 1 "vegastrike-engi" received signal SIGSEGV, Segmentation fault.
__memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317
317     ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S: No such file or directory.
(gdb) bt
#0  __memmove_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:317
#1  0x000055555559bdb5 in std::char_traits<char>::copy (__n=49, __s2=0x30 <error: Cannot access memory at address 0x30>, __s1=<optimized out>) at /usr/include/c++/11/bits/char_traits.h:437
#2  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy (__n=49, __s=0x30 <error: Cannot access memory at address 0x30>, __d=<optimized out>) at /usr/include/c++/11/bits/basic_string.h:359
#3  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_S_copy_chars (__k2=<optimized out>, __k1=0x30 <error: Cannot access memory at address 0x30>, __p=<optimized out>)
    at /usr/include/c++/11/bits/basic_string.h:401
#4  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*> (this=this@entry=0x7fffffffa3e0, __beg=0x30 <error: Cannot access memory at address 0x30>, __end=<optimized out>)
    at /usr/include/c++/11/bits/basic_string.tcc:225
#5  0x0000555555a97eaf in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct_aux<char*> (__end=<optimized out>, __beg=<optimized out>, this=0x7fffffffa3e0)
    at /usr/include/c++/11/bits/basic_string.h:251
#6  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*> (__end=<optimized out>, __beg=<optimized out>, this=0x7fffffffa3e0) at /usr/include/c++/11/bits/basic_string.h:274
#7  std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string (__str=..., this=0x7fffffffa3e0) at /usr/include/c++/11/bits/basic_string.h:459
#8  UpgradeableUnit::UpgradeUnit (this=this@entry=0x55555c2bf320, upgrades="360") at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/cmd/upgradeable_unit.cpp:98
#9  0x0000555555a3519b in Unit::LoadRow (this=this@entry=0x55555c2bef30, unit_identifier="Llama.begin", modification="player", saved_game=saved_game@entry=true) at /usr/include/c++/11/ext/new_allocator.h:89
#10 0x0000555555a7ad97 in Unit::Init (this=this@entry=0x55555c2bef30, filename=<optimized out>, filename@entry=0x55555b220900 "Llama.begin", SubU=SubU@entry=false, faction=faction@entry=25, unitModifications="player", 
    flightgrp=flightgrp@entry=0x55555baa5dc0, fg_subnumber=0) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/cmd/unit_generic.cpp:493
#11 0x0000555555a7b7b1 in Unit::Unit (this=this@entry=0x55555c2bef30, filename=filename@entry=0x55555b220900 "Llama.begin", SubU=SubU@entry=false, faction=25, unitModifications="player", flightgrp=0x55555baa5dc0, fg_subnumber=0)
    at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/cmd/unit_generic.cpp:323
#12 0x0000555555c24b59 in Cockpit::Update (this=0x55555b3e73e0) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/gfx/cockpit_generic.cpp:859
#13 0x00005555556136f2 in StarSystem::Update (this=this@entry=0x55555b3e01f0, priority=<optimized out>, executeDirector=executeDirector@entry=true)
    at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/star_system.cpp:1201
#14 0x000055555561cab8 in Universe::StartDraw (this=0x55555ba76210) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/universe.cpp:445
#15 0x00005555555f570b in main_loop () at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/main_loop.cpp:1048
#16 0x00005555559246d8 in winsys_process_events () at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/gldrv/winsys.cpp:553
#17 0x0000555555909f25 in GFXLoop (main_loop=main_loop@entry=0x5555559271ff <bootstrap_first_loop()>) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/gldrv/gl_init.cpp:790
#18 0x000055555561abb6 in Universe::Loop (this=<optimized out>, main_loop=main_loop@entry=0x5555559271ff <bootstrap_first_loop()>) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/universe.cpp:388
#19 0x000055555592e1a5 in main (argc=2, argv=<optimized out>) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/main.cpp:384
(gdb) f 9
#9  0x0000555555a3519b in Unit::LoadRow (this=this@entry=0x55555c2bef30, unit_identifier="Llama.begin", modification="player", saved_game=saved_game@entry=true) at /usr/include/c++/11/ext/new_allocator.h:89
89            ~new_allocator() _GLIBCXX_USE_NOEXCEPT { }
(gdb) up
#10 0x0000555555a7ad97 in Unit::Init (this=this@entry=0x55555c2bef30, filename=<optimized out>, filename@entry=0x55555b220900 "Llama.begin", SubU=SubU@entry=false, faction=faction@entry=25, unitModifications="player", 
    flightgrp=flightgrp@entry=0x55555baa5dc0, fg_subnumber=0) at /home/bmeyer/Devel/opensource/vegastrike/engine/Vega-Strike-Engine-Source/engine/src/cmd/unit_generic.cpp:493
493         LoadRow(unit_key, unitModifications, saved_game);
(gdb) Quit
BenjamenMeyer commented 1 year ago

Okay - I'm going to have to block this I think.

I reset my ~/.vegastrike directory and played a little. Game play was fine, and I saved a couples times. However, after exiting (to fix my mouse config) and loading again, I was unable to load my saved games with a similar crash to the above.

Can someone else please verify if they are seeing the same thing? Played with VS Game assets at master (hash 281722e2ce28215daf0e912c9a25fa14eaa52c59)

Attempts:

Both results in the same crash.

royfalk commented 1 year ago

I'm pretty sure you also reverted https://github.com/vegastrike/Vega-Strike-Engine-Source/commit/614e3d4f7d6238e71dddacaec9e0e47f73c12617 and that's why it's failing. Can you check?

BenjamenMeyer commented 1 year ago

@royfalk I checked the code from 614e3d4 and it seems to be there:

royfalk commented 1 year ago

I think we picked up on a bug that I missed because I play with vigilance. This should fix it.

stephengtuggy commented 1 year ago

macOS 10.15 builds are no longer going to work. See my comments in Gitter, as well as https://github.com/actions/runner-images/issues/5583

So we should probably disable all 4 macOS builds for the moment.

BenjamenMeyer commented 1 year ago

@royfalk thanks...I'll have to pull it and try it out @stephengtuggy agreed on Mac

BenjamenMeyer commented 1 year ago

@royfalk pulled your changes and it no longer crashes on loading a game; however, I seem to have lost lateral (left-right) movement while flying. The mouse cursor tracks just fine, but the vessel fails to respond. Interestingly this only occurs from the saved game. There's still something wrong.