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

Linux specific: Give access to siginfo_t in signalHandler() #541

Closed
ablangy opened this issue Jan 13, 2025 · 1 comment
Closed

Linux specific: Give access to siginfo_t in signalHandler() #541

ablangy opened this issue Jan 13, 2025 · 1 comment

Comments

@ablangy
Copy link
Contributor

ablangy commented Jan 13, 2025

Is your feature request related to a problem? Please describe.
Currently, the informations located in the siginfo_t structure are not used by this handler.
The bad effect is that when g3log is compiled with some optimisation flags, those data are not available to be inspected with the debugger because they are drop away.
In some situation, it is good to know the si_code provided by the system or the faulty address.

Describe the solution you'd like
By printing some more information like info.si_code and info.si_errno in the backtrace's output, we can save time and be able to access the other siginfo_t informations with the debugger.

Describe alternatives you've considered
I consider the possibility to not use this signal handler and write a custom one.
The needed modifications to have signalHandler() provide these siginfo_t informations are really minors and IMHO those informations can be useful to someone else.

ablangy added a commit to ablangy/g3log that referenced this issue Jan 13, 2025
By using some informations located in siginfo_t for tracing,
it remain accessible to be inspected by debugger even if the
code compiled with optimisation flags (typically -O2).
KjellKod pushed a commit that referenced this issue Jan 17, 2025
By using some informations located in siginfo_t for tracing,
it remain accessible to be inspected by debugger even if the
code compiled with optimisation flags (typically -O2).
@KjellKod
Copy link
Owner

Resolved with PR #542

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants