jgabaut / helapordo

A roguelike terminal game, using ncurses.
https://jgabaut.github.io/helapordo-docs
GNU General Public License v3.0
14 stars 0 forks source link

[BUG] Crash when turning on debug logging on some Linux #20

Closed jgabaut closed 11 months ago

jgabaut commented 1 year ago

Describe the bug I checked the latest release 1.1.5 and it seems that the variadic format of log_tag() doesn't go well with some Linux versions. On any attempt to call the function, and subsequently vfprintf(), which is the actual culprit, a crash happens because of missing support. If the platform really is the cause, this would effectively lock some distros from debugging for versions >1.1.3, since before 1.1.4 log_tag() was not variadic. Edit: Last unaffected version is 1.1.0, as the submodule koliseo causes the same crash since 0.1.11, and 1.1.1 bumped the dependency to 0.1.12.

Update

I removed mentions of 32bit Linux since I don't believe that's the culprit for this one. I also corrected the last unaffected version to be 1.1.0.

Useful backtrace line was:

 with __strlen_avx2 () at ../sysdeps/x86_64/multiarch/strlen-avx2.S:74 74   
  ../sysdeps/x86_64/multiarch/strlen-avx2.S: No such file or directory.
#1  0x00007ffff7c76db1 in __vfprintf_internal (_..._)
    at ./stdio-common/vfprintf-internal.c:1517

The issue may be related to Koliseo printing sized stuff which will have a different size on some platforms. See relevant issue on Koliseo repo.

This stackoverflow link mentions something similar but doesn't ultimately pin the problem to a platform. This comment seems to suggest it's about printing stuff.

To Reproduce Steps to reproduce the behavior:

  1. Compile with debug access. ./configure --enable-debug-yes; make rebuild
  2. Run the game with -d or -l flag to turn on logging.
  3. Game crashes as soon at the first log_tag() call.

Expected behavior Log function prints to debug log file and returns peacefully.

jgabaut commented 1 year ago

I don't think the 32bit part makes any sense. Will need to look into this further.

jgabaut commented 1 year ago

I updated the issue to remove mentions of 32bit Linux, and correct last unaffected version to be 1.1.0.

jgabaut commented 1 year ago

After investigating #52 I suppose the two could be related, and maybe this issue lie in the broken Linux platform having a different environment (maybe some docker image?).

jgabaut commented 11 months ago

This may have been fixed in 1.2.4, since it bumped koliseo to 0.3.0, which doesn't present the issue anymore.

jgabaut commented 11 months ago

After some tests, it seems this was indeed fixed with 1.2.4. Thanks to u/skeeto and u/dfx_dj for their help!

Closing for now.