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

[Patch] Fix profiler_unittest.cc fork() #591

Closed
alk opened this issue Aug 23, 2015 · 1 comment
Closed

[Patch] Fix profiler_unittest.cc fork() #591

alk opened this issue Aug 23, 2015 · 1 comment

Comments

@alk
Copy link
Contributor

alk commented Aug 23, 2015

Originally reported on Google Code with ID 588

What steps will reproduce the problem?
Call heap-profiler_unittest with the arguments 1 -2 (one iteration, 2 fork()ed children).

What is the expected output? What do you see instead?
Instead of running the test, the program crashes with a std::bad_alloc exception.
This is caused by unconditionally passing the number-of-threads-argument (0 or positive
for threads, negative for fork()s) in RunManyThreads(), thus allocating an array of
pthread_t of size -2.
Depending on the sign of the thread number argument either RunManyThreads or fork()
should be called.

What version of the product are you using? On what operating system?
Git HEAD, Ubuntu 13.04, 3.8.0-19-generic

Please provide any additional information below.
Patch attached.

Best regards,
Hannes Weisbach

Reported by hannes.weisbach on 2013-11-12 11:43:40


- _Attachment: [gperftools-profiler-fork.patch](https://storage.googleapis.com/google-code-attachments/gperftools/issue-588/comment-0/gperftools-profiler-fork.patch)_
@alk
Copy link
Contributor Author

alk commented Aug 23, 2015

Merged. Thanks

Reported by alkondratenko on 2013-11-16 20:17:28

  • Status changed: Fixed

@alk alk closed this as completed Aug 23, 2015
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