Skip to content

Comments

[stable] druntime: Fix malloc-leaks in ModuleGroup.sortCtors()#15559

Merged
RazvanN7 merged 1 commit intodlang:stablefrom
kinke:sortctors_leak
Aug 31, 2023
Merged

[stable] druntime: Fix malloc-leaks in ModuleGroup.sortCtors()#15559
RazvanN7 merged 1 commit intodlang:stablefrom
kinke:sortctors_leak

Conversation

@kinke
Copy link
Contributor

@kinke kinke commented Aug 26, 2023

I guess the recent removal of module constructors in druntime has brought these to light, for a little LDC ASan smoke test, which newly complains with D v2.105, e.g.:

Direct leak of 78624 byte(s) in 126 object(s) allocated from:
#0 0x55606978c40d in malloc /local/mnt/workspace/tmp/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
#1 0x5560698050b1 in _D2rt5minfo11ModuleGroup9sortCtorsMFNbAyaZv

I guess the recent removal of module constructors in druntime has
brought these to light, for a little LDC ASan smoke test, which
newly complains with D v2.105, e.g.:

> Direct leak of 78624 byte(s) in 126 object(s) allocated from:
>     #0 0x55606978c40d in malloc /local/mnt/workspace/tmp/final/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:145:3
>     dlang#1 0x5560698050b1 in _D2rt5minfo11ModuleGroup9sortCtorsMFNbAyaZv
@dlang-bot
Copy link
Contributor

Thanks for your pull request and interest in making D better, @kinke! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please verify that your PR follows this checklist:

  • My PR is fully covered with tests (you can see the coverage diff by visiting the details link of the codecov check)
  • My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
  • I have provided a detailed rationale explaining my changes
  • New or modified functions have Ddoc comments (with Params: and Returns:)

Please see CONTRIBUTING.md for more information.


If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "stable + dmd#15559"

Copy link
Member

@ljmf00 ljmf00 left a comment

Choose a reason for hiding this comment

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

Hey, I actually got this at my ASAN checks at work, I disables leakage due to this. I didnt get into it but thanks for going through this! 😊

Copy link
Contributor

@RazvanN7 RazvanN7 left a comment

Choose a reason for hiding this comment

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

Thanks!

@RazvanN7 RazvanN7 merged commit d4f976d into dlang:stable Aug 31, 2023
@kinke kinke deleted the sortctors_leak branch September 1, 2023 08:28
This was referenced Sep 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants