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
Original issue reported on code.google.com by hannes.w...@googlemail.com on 12 Nov 2013 at 11:43
Original issue reported on code.google.com by
hannes.w...@googlemail.com
on 12 Nov 2013 at 11:43Attachments: