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

Fix build on recent glibc #4

Closed
wants to merge 1 commit into from

Conversation

nyanpasu64
Copy link

This PR removes the usage of the sys_siglist, which was removed in glibc 2.32, causing this project to fail to build on recent Linux distros.

I based my approach off an existing project's bugfix (replace sys_siglist[sig] with strsignal(sig)). The documentation for the removal of sys_siglist is in the glibc 2.32 release notes (2020-08).

The usage of sys_siglist in this program is very minimal, so in-depth analysis is probably overkill. But I looked deeper anyway...

Looking at the glibc 2.32 release notes, it appears there are multiple functions returning different types of names, but strsignal is good enough for this case.

Looking at the strsignal manpage... sigh it's not thread-safe, and the return value may be null for unrecognized signals on OSes other than Linux. It doesn't matter in this case though, since we're on Linux and hopefully all signals are recognized.

I found a source saying that there are no known OSes with sys_siglist but not strsignal, so this change should not reduce compatibility with any versions of Linux.

(I was unable to make debugme actually work on Arch Linux though. gdb never triggered when an app segfaulted. Perhaps drkonqi is interfering?)

Fixes #3.

Issue explanation at greenbone/gvmd#1279,
based off fix at greenbone/gvmd#1280.
@nyanpasu64 nyanpasu64 marked this pull request as ready for review May 21, 2021 01:48
@codecov-commenter
Copy link

Codecov Report

Merging #4 (9e2a615) into master (2171981) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master       #4   +/-   ##
=======================================
  Coverage   58.15%   58.15%           
=======================================
  Files           4        4           
  Lines         141      141           
=======================================
  Hits           82       82           
  Misses         59       59           
Impacted Files Coverage Δ
src/debugme.c 69.76% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2171981...9e2a615. Read the comment docs.

@nyanpasu64 nyanpasu64 marked this pull request as draft May 24, 2021 20:01
@nyanpasu64 nyanpasu64 closed this May 26, 2021
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

Successfully merging this pull request may close these issues.

Doesn't compile on recent glibc (Arch Linux)
2 participants