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

llvm::errs() doesn't do anything in release builds on Linux, in libdxcompiler.so #6774

Closed
dneto0 opened this issue Jul 11, 2024 · 5 comments
Closed
Assignees
Labels
bug Bug, regression, crash needs-triage Awaiting triage

Comments

@dneto0
Copy link
Collaborator

dneto0 commented Jul 11, 2024

Description

I generally use Linux to develop DXC.
When I debug issues in the compiler, I often use llvm::errs().
Unfortunately, llvm::errs() doesn't do anything on release builds in Linux, when I use libdxcompiler.so

I've tried tracing through but haven't found the reason.

Steps to Reproduce

Build libdxcompiler.so on Linux.
(I'll fill in details below)

Actual Behavior

doesn't print.

Environment

DXC git d915232

@dneto0 dneto0 added bug Bug, regression, crash needs-triage Awaiting triage labels Jul 11, 2024
@dneto0 dneto0 changed the title llvm::errs() doesm llvm::errs() doesn't do anything in release builds on Linux, in libdxcompiler.so Jul 11, 2024
@dneto0
Copy link
Collaborator Author

dneto0 commented Jul 11, 2024

Seeing as this only affects libdxcompiler.so this might be on our end?

@dneto0
Copy link
Collaborator Author

dneto0 commented Jul 11, 2024

Update. It affects Linux release builds when:

@llvm-beanz
Copy link
Collaborator

I suspect what you’re seeing here is that dxcompiler reroutes llvm::errs to an output stream that is surfaced through the API as DXC_OUT_ERRORS:

DXC_OUT_ERRORS = 2, ///< IDxcBlobUtf8 or IDxcBlobWide.

That allows the caller to control where the output gets printed to, and observes the general best practice of not having shared libraries write to stdout or stderr.

@damyanp
Copy link
Member

damyanp commented Jul 16, 2024

@llvm-beanz / @dneto0 - is there work remaining for this issue?

@damyanp
Copy link
Member

damyanp commented Jul 18, 2024

@dneto0 - if we, or you, need to do something here then please feel free to reopen.

@damyanp damyanp closed this as not planned Won't fix, can't repro, duplicate, stale Jul 18, 2024
@github-project-automation github-project-automation bot moved this to Triaged in HLSL Triage Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage
Projects
Archived in project
Development

No branches or pull requests

3 participants