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

Storm Spell Crash #421

Closed
AlexJakeGreen opened this issue Mar 7, 2023 · 3 comments
Closed

Storm Spell Crash #421

AlexJakeGreen opened this issue Mar 7, 2023 · 3 comments

Comments

@AlexJakeGreen
Copy link

Casting the Storm spell causes the game crash

Storm

Output in console:

OpenGothic v1.0 dev
no *.ini file in path - using default settings
GPU = NVIDIA GeForce 940MX
Depth format = Depth32F Shadow format = Depth16
swapchain is outdated - reset renderer
[phoenix] world: parsing object [MeshAndBsp % 0 0]
[phoenix] bsp_tree: parsing chunk c000
[phoenix] bsp_tree: parsing chunk c010
[phoenix] bsp_tree: parsing chunk c040
[phoenix] bsp_tree: parsing chunk c045
[phoenix] bsp_tree: parsing chunk c050
[phoenix] bsp_tree: parsing chunk c0ff
[phoenix] mesh: 1 bytes remaining in section b020
[phoenix] world: parsing object [VobTree % 0 0]
[phoenix] world: parsing object [WayNet % 0 0]
[phoenix] world: parsing object [EndMarker % 0 0]
no texture?!

---crashlog(std::logic_error(stoi))---
GPU: NVIDIA GeForce 940MX
#1:  - /usr/lib/gcc/x86_64-pc-linux-gnu/12/libstdc++.so.6(+0xaa581) [0x7f87008ff581]
#2:  - /usr/lib/gcc/x86_64-pc-linux-gnu/12/libstdc++.so.6(+0xaa7c2) [0x7f87008ff7c2]
#3: std::__throw_invalid_argument(char const*) - /usr/lib/gcc/x86_64-pc-linux-gnu/12/libstdc++.so.6(_ZSt24__throw_invalid_argumentPKc+0x3c) [0x7f87008f646c]
#4: GlobalEffects::addScreenBlend(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, unsigned long) - Gothic2Notr(_ZN13GlobalEffects14addScreenBlendEPKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEm+0x797) [0x563c75d21f37]
#5: GlobalEffects::create(std::basic_string_view<char, std::char_traits<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, unsigned long) - Gothic2Notr(_ZN13GlobalEffects6createESt17basic_string_viewIcSt11char_traitsIcEEPKNSt7__cxx1112basic_stringIcS2_SaIcEEEm+0x82) [0x563c75d21ff2]
#6: GlobalEffects::startEffect(std::basic_string_view<char, std::char_traits<char> >, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, unsigned long) - Gothic2Notr(_ZN13GlobalEffects11startEffectESt17basic_string_viewIcSt11char_traitsIcEEmPKNSt7__cxx1112basic_stringIcS2_SaIcEEEm+0x30) [0x563c75d220c0]
#7: World::addGlobalEffect(std::basic_string_view<char, std::char_traits<char> >, unsigned long, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const*, unsigned long) - Gothic2Notr(_ZN5World15addGlobalEffectESt17basic_string_viewIcSt11char_traitsIcEEmPKNSt7__cxx1112basic_stringIcS2_SaIcEEEm+0x28) [0x563c75e3f8c8]
#8: Effect::setupPfx(World&) - Gothic2Notr(_ZN6Effect8setupPfxER5World+0x20d) [0x563c75d51ded]
#9: Effect::setKey(World&, SpellFxKey, int) - Gothic2Notr(_ZN6Effect6setKeyER5World10SpellFxKeyi+0x30f) [0x563c75d5371f]
#10: Effect::Effect(VisualFx const&, World&, Tempest::BasicPoint<float, 3ul> const&, SpellFxKey) - Gothic2Notr(_ZN6EffectC2ERK8VisualFxR5WorldRKN7Tempest10BasicPointIfLm3EEE10SpellFxKey+0x1df) [0x563c75d533df]
#11: Effect::setKey(World&, SpellFxKey, int) - Gothic2Notr(_ZN6Effect6setKeyER5World10SpellFxKeyi+0xcc) [0x563c75d534dc]
#12: Effect::Effect(VisualFx const&, World&, Tempest::BasicPoint<float, 3ul> const&, SpellFxKey) - Gothic2Notr(_ZN6EffectC2ERK8VisualFxR5WorldRKN7Tempest10BasicPointIfLm3EEE10SpellFxKey+0x1df) [0x563c75d533df]
#13: Effect::setKey(World&, SpellFxKey, int) - Gothic2Notr(_ZN6Effect6setKeyER5World10SpellFxKeyi+0xcc) [0x563c75d534dc]
#14: Effect::Effect(VisualFx const&, World&, Tempest::BasicPoint<float, 3ul> const&, SpellFxKey) - Gothic2Notr(_ZN6EffectC2ERK8VisualFxR5WorldRKN7Tempest10BasicPointIfLm3EEE10SpellFxKey+0x1df) [0x563c75d533df]
#15: Effect::setKey(World&, SpellFxKey, int) - Gothic2Notr(_ZN6Effect6setKeyER5World10SpellFxKeyi+0xcc) [0x563c75d534dc]
#16: Effect::Effect(VisualFx const&, World&, Tempest::BasicPoint<float, 3ul> const&, SpellFxKey) - Gothic2Notr(_ZN6EffectC2ERK8VisualFxR5WorldRKN7Tempest10BasicPointIfLm3EEE10SpellFxKey+0x1df) [0x563c75d533df]
#17: Npc::commitSpell() - Gothic2Notr(_ZN3Npc11commitSpellEv+0x427) [0x563c75e28be7]
#18: Npc::tickCast() - Gothic2Notr(_ZN3Npc8tickCastEv+0x4f) [0x563c75e28d6f]
#19: Npc::tick(unsigned long) - Gothic2Notr(_ZN3Npc4tickEm+0xba) [0x563c75e2913a]
#20: WorldObjects::tick(unsigned long, unsigned long) - Gothic2Notr(_ZN12WorldObjects4tickEmm+0x21e) [0x563c75e4e8ce]
#21: World::tick(unsigned long) - Gothic2Notr(_ZN5World4tickEm+0x1b) [0x563c75e3feeb]
#22: GameSession::tick(unsigned long) - Gothic2Notr(_ZN11GameSession4tickEm+0x74) [0x563c75d19a14]
#23: MainWindow::tick() - Gothic2Notr(_ZN10MainWindow4tickEv+0x10c) [0x563c75db982c]
#24: MainWindow::render() - Gothic2Notr(_ZN10MainWindow6renderEv+0x8f) [0x563c75dbd30f]
#25: Tempest::X11Api::implProcessEvents(Tempest::SystemApi::AppCallBack&) - /usr/lib64/libTempest.so(_ZN7Tempest6X11Api17implProcessEventsERNS_9SystemApi11AppCallBackE+0x5e) [0x7f8700b90fae]
#26: Tempest::X11Api::implExec(Tempest::SystemApi::AppCallBack&) - /usr/lib64/libTempest.so(_ZN7Tempest6X11Api8implExecERNS_9SystemApi11AppCallBackE+0x1b) [0x7f8700b9179b]
#27: main - Gothic2Notr(main+0x1c4) [0x563c75c77304]

Steps to reproduce:
1 Load this save save_slot_7.sav.gz
2 Cast the Storm spell
Observed: Game crashed

Try added a commit that referenced this issue Mar 7, 2023
@Try
Copy link
Owner

Try commented Mar 7, 2023

Hi, @AlexJakeGreen and thank for report!

Issue was due to invalid effect parameter, that been passed to std::stoi, causing exception. Should be fully fixed in 1347153

CC @lmichaelis : while fixing this case, I've noticed that in phoenix, there are a few std::stoi/std::stof calls with no exception handling. You may want to catch and re-throw them as parser_error

@lmichaelis
Copy link
Contributor

Will do, thanks :>

@AlexJakeGreen
Copy link
Author

Thank you. Much appreciated.

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

No branches or pull requests

3 participants