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

SIGSTKSZ is not an integral constant with libc6 2.34 #61

Closed
migmolper opened this issue May 31, 2022 · 4 comments · Fixed by #70
Closed

SIGSTKSZ is not an integral constant with libc6 2.34 #61

migmolper opened this issue May 31, 2022 · 4 comments · Fixed by #70
Assignees
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@migmolper
Copy link
Collaborator

migmolper commented May 31, 2022

Describe the bug
Updated versions of Ubuntu (21.10 and superiors) installed libc6 (glibc) 2.34. SIGSTKSZ is now no longer constant, and can’t be used directly to define array sizes. According to documentation:

"The constant SIGSTKSZ is defined to be large enough to cover the usual size requirements for an alternate signal stack".

See similar PR's in other people's codes:

And this is a proposed fix to the bug:

Affected file in the code:

Any thoughts @bodhinandach ?

To Reproduce
These are my machine specifications: "Ubuntu 22.04 LTS" and "gcc 11.2.0"

Screenshots
Screenshot

@bodhinandach bodhinandach added this to To do in MPM Development via automation May 31, 2022
@bodhinandach bodhinandach added help wanted Extra attention is needed question Further information is requested labels May 31, 2022
@bodhinandach
Copy link
Member

Is this related to the testing? Let me have a look at it this week. Let's discuss this on Friday.

@bodhinandach
Copy link
Member

@migmolper How are we dealing with this one?

@migmolper
Copy link
Collaborator Author

We are using this:

/*******************/

#include
#if defined(_SC_SIGSTKSZ_SOURCE) || defined(_GNU_SOURCE)
// on glibc > 2.33 this is no longer constant, see
// https://sourceware.org/git/?p=glibc.git;a=blob;f=NEWS;h=85e84fe53699fe9e392edffa993612ce08b2954a;hb=HEAD
static constexpr std::size_t sigStackSize = 32768;
#else
static constexpr std::size_t sigStackSize =
32768 >= SIGSTKSZ ? 32768 : SIGSTKSZ;
#endif

/*******************/

And then substitute SIGSTKSZ by sigStackSize

@bodhinandach
Copy link
Member

This runs the test ok in the newer version of Linux?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
Development

Successfully merging a pull request may close this issue.

2 participants