Author Topic: [FIXED] How to report a segfault? Which release to build?  (Read 1636 times)

Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
[FIXED] How to report a segfault? Which release to build?
« on: March 25, 2023, 11:38:03 pm »
I have attempted to build a release based on commit 1f93586a07c19d4629aba9bad95ffa12e7110fbe.  I used the following command to generate makefiles:

cmake -DCMAKE_BUILD_TYPE:STRING=Release -DBUILD_PACKAGE=OFF .

I got a segfault when attempting to play a battlescape from the main menu, for the purposes of testing.

[25-03-2023_14-22-52]   [FATAL] A fatal error has occurred: Segmentation fault.
[25-03-2023_14-22-52]   [FATAL] openxcom(OpenXcom::CrossPlatform::stackTrace(void*)+0x26) [0x55e22ddf4776]
[25-03-2023_14-22-52]   [FATAL] openxcom(OpenXcom::CrossPlatform::crashDump(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)+0x3f8) [0x55e22ddf5138]
[25-03-2023_14-22-52]   [FATAL] openxcom(signalLogger(int)+0x31) [0x55e22dbd1a51]
[25-03-2023_14-22-52]   [FATAL] /lib/x86_64-linux-gnu/libc.so.6(+0x3bf90) [0x7f974429af90]
[25-03-2023_14-22-52]   [FATAL] openxcom(OpenXcom::Map::drawTerrain(OpenXcom::Surface*)+0xf63) [0x55e22dd949f3]
[25-03-2023_14-22-52]   [FATAL] openxcom(OpenXcom::BattlescapeState::init()+0xc8) [0x55e22dd44128]
[25-03-2023_14-22-52]   [FATAL] openxcom(OpenXcom::Game::run()+0xc0) [0x55e22de1bef0]
[25-03-2023_14-22-52]   [FATAL] openxcom(main+0x140) [0x55e22dba0990]
[25-03-2023_14-22-52]   [FATAL] /lib/x86_64-linux-gnu/libc.so.6(+0x2718a) [0x7f974428618a]
[25-03-2023_14-22-52]   [FATAL] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x85) [0x7f9744286245]
[25-03-2023_14-22-52]   [FATAL] openxcom(_start+0x21) [0x55e22dba6ff1]
[25-03-2023_14-22-56]   [FATAL] OpenXcom has crashed: Segmentation fault.


As for the data, I copied over the "standard" and "common" directories into my ".local/share/openxcom" from the release under bin/ (logs indicate this directory is used, so ok).  I copied over TFTD and UFO data from a previously working openxcom release, under the same .local/share subdirs.  So, no issues are expected with data.

As you could see, the segfault message is not entirely helpful.  I do not feel like tracing a C++ code with gdb at this moment.  I could contribute some code in a safe language (rust, any functional stuff, etc.), but that is a much larger undertaking anyway, and this needs to be done collaboratively anyway.

A question is, what release should I in general be building?  Which ones should I expect to work?  The tag "v1.0" dates from 2014, which is a tad too old.

Should I use a master branch, perhaps?  Why?  Could you please suggest which recent branch or commit I could use and expect a reasonable outcome?

UPDATE The master branch at release 6b96200e1abfdea1d0215cd5cefeae7b51f2b99f seems to work.  I'll test further, and see if the full XCF runs fine with it or not.
« Last Edit: March 25, 2023, 11:41:03 pm by zee_ra »

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #1 on: March 26, 2023, 01:35:32 am »
It should work fine, `oxce-plus` should have always working version, what exactly did you do? have any save befroecrash?

Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #2 on: March 26, 2023, 01:42:59 am »
It should work fine, `oxce-plus` should have always working version, what exactly did you do? have any save befroecrash?

In my specific case, this specific branch, the oxce-plus, (the commit ID was listed in my original message) was the one that resulted in a build which segfaults.

The segfault had not been associated with any particular save.  I merely used a first battlescape mission from the main menu, without any additional settings whatsoever.  The one, where a skyranger troopers hunt a single sectoid.

« Last Edit: March 26, 2023, 03:01:09 am by zee_ra »

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #3 on: March 26, 2023, 03:37:23 am »
ok, I can reproduce it, this is random bug, some times it work some times it crash.

Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #4 on: March 26, 2023, 04:10:10 am »
ok, I can reproduce it, this is random bug, some times it work some times it crash.

I know this happens sometimes with bleeding-edge code.  In principle, there are ways to prevent it with any code that goes into public branches, but that may require a lot of changes in the project itself (the largest being the language itself or language + tooling combination).

I wonder, if a policy could be established on the intermediate release points?  They would be visible as tags between versions, that are reasonably recent, and allow one to build a reasonably recent release with confidence.




Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #5 on: March 26, 2023, 05:14:05 am »
ok, I can reproduce it, this is random bug, some times it work some times it crash.

In my case, the crash is consistent.  The system is Debian Bookworm, with X11.
« Last Edit: March 26, 2023, 05:27:12 am by zee_ra »

Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #6 on: March 26, 2023, 05:26:23 am »
I went down to version 7.8.12, corresponding to a031e400b874d1619535bfcb0305dbb4b3704577, and the issue had so far disappeared.  The battlescape option now works with all three of UFO, TFTD, and XCF.

Offline Yankes

  • Commander
  • *****
  • Posts: 3194
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #7 on: March 26, 2023, 02:01:40 pm »
OXCE 7.8.14 should fix this bug, small oversight on my side as only vanilla UFO crash as it do not use vapor particles like TFTD or some big mods.

https://github.com/MeridianOXC/OpenXcom/commit/2a87e2311fa462a521ccf082ef1a6f56fa4a765c
« Last Edit: December 02, 2023, 06:47:28 pm by Meridian »

Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
Release engineering issues.
« Reply #8 on: March 26, 2023, 08:48:47 pm »
OXCE 7.8.14 should fix this bug, small oversight on my side as only vanilla UFO crash as it do not use vapor particles like TFTD or some big mods.

Thank you.  I'll test this later.

I would like to request the addition of minor version tags to the source tree.  Currently, only the heading in the corresponding patch suggests a release.  However, this is not optimal for several reasons.  On the one hand, without tagging or branching, the git ends in a "detached head state".  On the other hand, the tags in the source clearly indicate the intention.  Also, please note that the versioning scheme clearly indicates the nature of the version itself (i.e. whether it a development version or a different milestone).  A tag also indicates that the particular point is expected to be a usable on.

Also, please consider the discussion at the https://openxcom.org/forum/index.php/topic,7721.msg154169.html#msg154169 in connection with this issue.

Offline zee_ra

  • Colonel
  • ****
  • Posts: 200
    • View Profile
Re: How to report a segfault? Which release to build?
« Reply #9 on: March 26, 2023, 09:12:49 pm »
OXCE 7.8.14 should fix this bug, small oversight on my side as only vanilla UFO crash as it do not use vapor particles like TFTD or some big mods.

Confirmed to work with main menu battlescape missions from UFO, TFTD, and XCF.