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

Allocator cache is flushed in a wrong place. #233

Closed
ramosian-glider opened this issue Aug 31, 2015 · 3 comments
Closed

Allocator cache is flushed in a wrong place. #233

ramosian-glider opened this issue Aug 31, 2015 · 3 comments

Comments

@ramosian-glider
Copy link
Member

Originally reported on Google Code with ID 233

Currently malloc cache is flushed long before the thread actually finishes:

thread_return_t AsanThread::ThreadStart(uptr os_id) {
...
  thread_return_t res = start_routine_(arg_);
  malloc_storage().CommitBack();
  if (flags()->use_sigaltstack) UnsetAlternateSignalStack();
...
}

void AsanThread::Destroy() {
...
  asanThreadRegistry().FinishThread(tid());
  FlushToDeadThreadStats(&stats_);
...
}

malloc_storage().CommitBack() (and UnsetAlternateSignalStack) must be called right
before asanThreadRegistry().FinishThread(tid()).
Otherwise all memory freed in between is leaked.

Reported by dvyukov@google.com on 2013-10-18 14:21:30

@ramosian-glider
Copy link
Member Author

That was quite a major leak actually. 
Fixed in http://llvm.org/viewvc/llvm-project?view=revision&revision=194572

Reported by konstantin.s.serebryany on 2013-11-13 13:32:49

  • Status changed: Fixed

@ramosian-glider
Copy link
Member Author

Sorry, this got stuck in my queue. :(

Reported by earthdok@chromium.org on 2013-11-13 13:34:02

@ramosian-glider
Copy link
Member Author

Adding Project:AddressSanitizer as part of GitHub migration.

Reported by ramosian.glider on 2015-07-30 09:13:42

  • Labels added: ProjectAddressSanitizer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant