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

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

Closed
jgabaut opened this issue Sep 7, 2023 · 5 comments
Closed

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

jgabaut opened this issue Sep 7, 2023 · 5 comments
Labels
bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right

Comments

@jgabaut
Copy link
Owner

jgabaut commented Sep 7, 2023

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.

  • OS: some Linux
  • Version:
    • >1.1.0 (since koliseo has the same crash since its 0.1.12 release, which made kls_log() variadic
    • >=1.1.4, (since log_tag() became variadic)
@jgabaut jgabaut added bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right labels Sep 7, 2023
@jgabaut jgabaut self-assigned this Sep 7, 2023
@jgabaut jgabaut removed the help wanted Extra attention is needed label Sep 7, 2023
@jgabaut
Copy link
Owner Author

jgabaut commented Sep 10, 2023

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

@jgabaut
Copy link
Owner Author

jgabaut commented Sep 13, 2023

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

@jgabaut jgabaut changed the title Crash when turning on debug logging Crash when turning on debug logging on some Linux Sep 16, 2023
@jgabaut jgabaut added help wanted Extra attention is needed good first issue Good for newcomers labels Sep 23, 2023
@jgabaut jgabaut removed their assignment Nov 13, 2023
@jgabaut jgabaut removed the good first issue Good for newcomers label Nov 13, 2023
@jgabaut
Copy link
Owner Author

jgabaut commented Nov 17, 2023

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 jgabaut changed the title Crash when turning on debug logging on some Linux [BUG] Crash when turning on debug logging on some Linux Nov 27, 2023
@jgabaut
Copy link
Owner Author

jgabaut commented Dec 26, 2023

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
Copy link
Owner Author

jgabaut commented Dec 29, 2023

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.

@jgabaut jgabaut closed this as completed Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant