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

[test] Trigger failures via USR1/USR2 #833

Merged
merged 2 commits into from
Jul 17, 2024

Conversation

Arpafaucon
Copy link
Contributor

Add signal handlers to trigger special conditions in tracy-test. This proves useful when working on the capture utility to check edge conditions.

USR1: abort the program

example of call & output

maim_2024-07-17T17-01-39+02-00

in the profiler:

maim_2024-07-17T16-38-32+02-00

USR2: send buggy TracyFree event, to trigger an instrumentation failure

❯ timeout --signal USR2 0.4 ./tracy-test
Triggering instrumentation failure
terminate called without an active exception
timeout: the monitored command dumped core

maim_2024-07-17T17-01-09+02-00

USR1: abort the program
USR2: send buggy free event, to trigger an instrumentation failure
test/test.cpp Outdated
#include <chrono>
#include <csignal>
Copy link
Owner

Choose a reason for hiding this comment

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

Use signal.h.

Copy link
Contributor Author

@Arpafaucon Arpafaucon Jul 17, 2024

Choose a reason for hiding this comment

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

done. Out of curiosity, what's the difference ? (always though it was the same header, but for C++)

Copy link
Owner

Choose a reason for hiding this comment

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

csignal guarantees that functions are available in the std namespace, and maybe in the global one.
signal.h guarantees that functions are available in the global namespace, and maybe in std.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the explanation !

@wolfpld wolfpld merged commit 5634c15 into wolfpld:master Jul 17, 2024
4 checks passed
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.

2 participants