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

memory leaks in std.parallelism #9775

Open
dlangBugzillaToGithub opened this issue Jul 25, 2019 · 0 comments
Open

memory leaks in std.parallelism #9775

dlangBugzillaToGithub opened this issue Jul 25, 2019 · 0 comments
Labels
Arch:x86 Issues specific to x86 OS:Mac OS Issues Specific to Mac OS Severity:Major

Comments

@dlangBugzillaToGithub
Copy link

ali.akhtarzada reported this on 2019-07-25T19:12:39Z

Transfered from https://issues.dlang.org/show_bug.cgi?id=20085

Description

Almost every single example in the doc page (https://dlang.org/phobos/std_parallelism.html) leaks memory, usually something like:

=================================================================
==73260==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 288 byte(s) in 3 object(s) allocated from:
    #0 0x10df204b7 in wrap_calloc (libldc_rt.asan.dylib:x86_64+0x5f4b7)
    #1 0x10ce4bdbc in _D2rt8monitor_13ensureMonitorFNbC6ObjectZPOSQBqQBq7Monitor (temp:x86_64+0x1001a5dbc)

Direct leak of 48 byte(s) in 3 object(s) allocated from:
    #0 0x10df1ff73 in wrap_malloc (libldc_rt.asan.dylib:x86_64+0x5ef73)
    #1 0x10ce4cfca in _D2rt5tlsgc4initFNbNiZPv (temp:x86_64+0x1001a6fca)
    #2 0x7fff61c4f248 in _pthread_start (libsystem_pthread.dylib:x86_64+0x6248)
    #3 0x7fff61c4b40c in thread_start (libsystem_pthread.dylib:x86_64+0x240c)

SUMMARY: AddressSanitizer: 336 byte(s) leaked in 6 allocation(s).

Here's a simple program:

import std;

void main() {
  auto t = new TaskPool(3);
  t.finish(true);
}

Run it with:

ldc2 -fsanitize=address -g -disable-fp-elim -frame-pointer=all temp.d && ASAN_OPTIONS=detect_stack_use_after_return=1:detect_leaks=1 ./temp

Output:

=================================================================
==73394==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 48 byte(s) in 3 object(s) allocated from:
    #0 0x105aecf73 in wrap_malloc (libldc_rt.asan.dylib:x86_64+0x5ef73)
    #1 0x10566d47a in _D2rt5tlsgc4initFNbNiZPv (temp:x86_64+0x10019c47a)
    #2 0x7fff61c4f248 in _pthread_start (libsystem_pthread.dylib:x86_64+0x6248)
    #3 0x7fff61c4b40c in thread_start (libsystem_pthread.dylib:x86_64+0x240c)

SUMMARY: AddressSanitizer: 48 byte(s) leaked in 3 allocation(s).
@LightBender LightBender removed the P2 label Dec 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch:x86 Issues specific to x86 OS:Mac OS Issues Specific to Mac OS Severity:Major
Projects
None yet
Development

No branches or pull requests

2 participants