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 backtraces to examples #5973

Merged
merged 7 commits into from
Jan 8, 2025

Conversation

aleino-nv
Copy link
Collaborator

  • Add backtrace-printing support for Windows, for both main and WinMain examples.
  • For WinMain example programs, redirect stdout to stdout-[example].txt and print that in CI if it's found.

This helps to address #5520.

@aleino-nv
Copy link
Collaborator Author

/format

@aleino-nv aleino-nv marked this pull request as ready for review December 31, 2024 13:51
@aleino-nv aleino-nv requested a review from a team as a code owner December 31, 2024 13:51
@slangbot
Copy link
Contributor

🌈 Formatted, please merge the changes from this PR

aleino-nv added a commit to aleino-nv/slang that referenced this pull request Dec 31, 2024
@aleino-nv aleino-nv added the pr: non-breaking PRs without breaking changes label Dec 31, 2024
@aleino-nv aleino-nv force-pushed the aleino/examples-backtrace branch 2 times, most recently from 61e8ed6 to 5d202bd Compare January 2, 2025 07:22
return true;
}

// NOTE: This function is not thread-safe, due to usage of StackWalk64 and static buffers.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should use a mutex here to make this function reentrant

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It's currently only called from the main thread.

I suppose it's possible some other thread will call these dbghelp API's, is that the concern?

If so I would prefer it if the function was "externally synchronized" i.e. the mutex is around the call site.

@aleino-nv
Copy link
Collaborator Author

/format

@slangbot
Copy link
Contributor

slangbot commented Jan 2, 2025

🌈 Formatted, please merge the changes from this PR

@aleino-nv aleino-nv force-pushed the aleino/examples-backtrace branch from 1bfebf9 to 664740c Compare January 3, 2025 07:48
@aleino-nv
Copy link
Collaborator Author

/format

@slangbot
Copy link
Contributor

slangbot commented Jan 3, 2025

🌈 Formatted, please merge the changes from this PR

aleino-nv added a commit to aleino-nv/slang that referenced this pull request Jan 3, 2025
For now, this is only implemented on Windows.
This helps to address shader-slang#5520.
@aleino-nv aleino-nv force-pushed the aleino/examples-backtrace branch from c8bfbb4 to 3abb2c6 Compare January 3, 2025 08:08
@aleino-nv
Copy link
Collaborator Author

/format

@slangbot
Copy link
Contributor

slangbot commented Jan 3, 2025

🌈 Formatted, please merge the changes from this PR

@aleino-nv aleino-nv requested a review from expipiplus1 January 5, 2025 08:25
@csyonghe csyonghe merged commit 5b99314 into shader-slang:master Jan 8, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: non-breaking PRs without breaking changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants