aliens

Author Topic: [FIXED] crash when transferring currently opened craft  (Read 1098 times)

Offline psavola

  • Commander
  • *****
  • Posts: 820
    • View Profile
[FIXED] crash when transferring currently opened craft
« on: February 09, 2024, 10:42:43 pm »
I got the following crash with 7.11.4 with XCF 3.3-snap. I was equipping my soldiers in India base OSPREY (I suppose I removed some armors and then the base storage was overflown). Then while still in basescape I tried to transfer the OSPREY to another base (Cuba). Then I got the following crash. I suppose this was somehow related to the base storage overflow.

[09-02-2024_22-08-11]   [FATAL] A fatal error has occurred: vector::_M_range_check: __n (which is 1) >= this->size() (which is 1)
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(OpenXcom::CrossPlatform::stackTrace(void*)+0x36) [0x55ce1b2810f6]
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x477) [0x55ce1b281c9
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(exceptionLogger()+0x75) [0x55ce1b063155]
[09-02-2024_22-08-11]   [FATAL] /lib64/libstdc++.so.6(+0x9654c) [0x7fa62ac9f54c]
[09-02-2024_22-08-11]   [FATAL] /lib64/libstdc++.so.6(+0x965a7) [0x7fa62ac9f5a7]
[09-02-2024_22-08-11]   [FATAL] /lib64/libstdc++.so.6(+0x96808) [0x7fa62ac9f808]
[09-02-2024_22-08-11]   [FATAL] /lib64/libstdc++.so.6(+0x9206b) [0x7fa62ac9b06b]
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(OpenXcom::CraftSoldiersState::initList(unsigned long)+0xad5) [0x55ce1b0a2ef5]
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(OpenXcom::CraftSoldiersState::init()+0x38) [0x55ce1b0a5f18]
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(OpenXcom::Game::run()+0x464) [0x55ce1b2a0a04]
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(main+0x175) [0x55ce1b040035]
[09-02-2024_22-08-11]   [FATAL] /lib64/libc.so.6(__libc_start_main+0xe5) [0x7fa62a2d37e5]
[09-02-2024_22-08-11]   [FATAL] ./OpenXcomEx(_start+0x2a) [0x55ce1b0478da]

As I suspected, there was probably something wrong with CraftSoldiersState.

I tried to replicate what I did but I suppose I couldn't get it exactly right because I couldn't trigger the crash again.

I hesitate to open a BUG thread on this because I couldn't reproduce it myself. But good luck if this is sufficient to find the problem via code analysis. I'll attach a save just in case.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9061
    • View Profile
Re: [Bug] crash when transferring currently opened craft
« Reply #1 on: February 10, 2024, 10:02:47 am »
0. have full stores
1. open craft
2. open craft soldier list
3. open soldier info (R-click)
4. remove armor to have overfull stores
5. warning pops up
6. sell state is forced
7. sell or transfer currently opened craft
8. close
9. crash

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9061
    • View Profile

Offline psavola

  • Commander
  • *****
  • Posts: 820
    • View Profile
Re: [FIXED] crash when transferring currently opened craft
« Reply #3 on: February 10, 2024, 10:10:25 am »
Wow, thanks  :o