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

Add in the sigtrap si_codes #4225

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

xd009642
Copy link
Contributor

Description

Adds the sigtrap si code constants for interpretting the results when getting siginfo after a sigtrap.

Sources

I didn't include the perf trap as it's not on my system.

https://github.com/torvalds/linux/blob/master/include/uapi/asm-generic/siginfo.h#L255-L264

Checklist

  • Relevant tests in libc-test/semver have been updated
  • No placeholder or unstable values like *LAST or *MAX are
    included (see #3131)
  • Tested locally (cd libc-test && cargo test --target mytarget);
    especially relevant for platforms that may not be checked in CI

@rustbot
Copy link
Collaborator

rustbot commented Dec 31, 2024

r? @tgross35

rustbot has assigned @tgross35.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Copy link
Contributor

@tgross35 tgross35 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes here lgtm, but you may as well also add SI_DETHREAD, SI_ASYNCNL, and TRAP_PERF so so the lists are complete. If this causes CI to fail on platforms with older headers, you should just be able to just skip them on
https://github.com/rust-lang/libc/blob/55d8d8359ecdfacc1ce1d5a74c29ffd5586b454e/libc-test/build.rs.

Also - linux_like/mod.rs makes these available on both Android and emscripten (cc @maurer and @hoodmane). Android seems to have these https://cs.android.com/android/platform/superproject/main/+/main:bionic/libc/kernel/uapi/asm-generic/siginfo.h;l=118-127;drc=0f795217061c52c557fce451bf1c26ac578d1cbd but I don't think emscripten does, so these should probably be moved to linux_like/linux.rs and copied to linux_like/linux/mod.rs and copied to linux_like/android/mod.rs. (I want to organize this crate at some point so less of this is needed).

@tgross35 tgross35 added the stable-nominated This PR should be considered for cherry-pick to libc's stable release branch label Jan 10, 2025
@hoodmane
Copy link
Contributor

These are all present in Emscripten. For instance:

#include <signal.h>

_Static_assert(SI_ASYNCIO == -4);

compiles fine. So I think it is fine to include them in Emscripten. Whether they are useful for anything is a separate question.

@tgross35
Copy link
Contributor

I stand corrected, thanks for checking so quickly!

In that case @xd009642 if you could add the remaining few constants then this should be good to merge.

@xd009642
Copy link
Contributor Author

Sure it'll have to wait till Monday at the earliest as I'm on holiday but will do 🫡

@rustbot
Copy link
Collaborator

rustbot commented Jan 13, 2025

Some changes occurred in the Android module

cc @maurer

@xd009642
Copy link
Contributor Author

xd009642 commented Jan 13, 2025

@tgross35 okay I'm hoping it's all good, looks like that last android test should pass as well. Hopefully I figured out the build script filtering correctly and wasn't too blunt-force makes CI pass.

Hmm looks like android timed out. Is this a flaky test thing? Some upgrade needed or something my end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-android O-linux O-linux-like O-unix S-waiting-on-author stable-nominated This PR should be considered for cherry-pick to libc's stable release branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants