Skip to content

Lifetime of dynamic-library related resources, tied to static object instance. #7383

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

Open
BitBunch opened this issue Apr 27, 2025 · 0 comments
Labels
bug Bug, regression, crash needs-triage Awaiting triage

Comments

@BitBunch
Copy link

Description
Specifically on Linux platform.
Dynamic memory allocations by dxil are released when the dynamic library is released.
A quick look in the DXC source appears to show this happens in the destructor of a static object instance in DXC.

This causes issues when doing custom memory management (memory leaks reported).
Also, by the time those allocations are freed (app exit), the custom memory-manager no longer exists. Causing a segmentation fault.

On Windows platform this is not an issue because the lifetime of the static is bound to the DXC DLL whereas on Linux the dxil dynamic-library appears to be loaded in global space.

Steps to Reproduce
On Linux:

  • Overload global new operator and count allocations
  • Initialize DXC
  • Use DXC API
  • Close and release DXC
  • Check allocation count (Count > 0)
  • Exit app

Actual Behavior
Not all allocations are freed after closing and releasing DXC.

Environment

  • DXC version 2025.02.20
  • Host Operating System Ubuntu, ArchLinux
@BitBunch BitBunch added bug Bug, regression, crash needs-triage Awaiting triage labels Apr 27, 2025
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
Status: No status
Development

No branches or pull requests

1 participant