Re: perf: use after free in perf_remove_from_context

From: Sasha Levin
Date: Wed May 14 2014 - 13:10:27 EST


On 05/14/2014 12:52 PM, Peter Zijlstra wrote:
> On Wed, May 14, 2014 at 12:38:10PM -0400, Sasha Levin wrote:
>> ./trinity -xinit_module -xreboot -xshutdown -xunshare -xnfsservctl -xclock_nanosleep -xuselib -xumount -xmount -m --quiet --dangerous -C 400 -l off
>>
>> Note that I run it as root in a disposable VM. Running that as root on your
>> machine will likely kill it.
>
> Right, so i'll start with !root running. That said, I seem to get an
> endless stream of double free or corrupt msgs:
>
> trinity$ ./trinity -xinit_module -xreboot -xshutdown -xunshare -xnfsservctl -xclock_nanosleep -xuselib -xumount -xmount -m --quiet -C 400 -l off
>
> ...
>
> *** Error in `./trinity': double free or corruption (top): 0x000000000135af60 ***
> [main] Random reseed: 3671679404
> [main] Random reseed: 67838733
> *** Error in `./trinity': double free or corruption (top): 0x000000000135ef60 ***
> [main] Random reseed: 943044433
> *** Error in `./trinity': double free or corruption (top): 0x00000000012bb210 ***
> [main] Random reseed: 3627649145
> *** Error in `./trinity': double free or corruption (top): 0x000000000139dbe0 ***
> [main] Random reseed: 935036390
> [main] Random reseed: 3922349807
> [main] Random reseed: 835563887
> *** Error in `./trinity': double free or corruption (top): 0x0000000001323890 ***
> [main] Random reseed: 974945617
> *** Error in `./trinity': double free or corruption (top): 0x0000000001308190 ***
> [main] Random reseed: 2912296953
> [main] Random reseed: 681900861
>
>
> Is this 'expected' behaviour?

I've talked about it with Dave a while ago, he said it happens because the threads that
do all the testing sometimes corrupt themselves which result in that error. It shouldn't
be harmful as the thread will just get killed and a fresh one will be started in it's
place.

Since then I set MALLOC_CHECK_=0 to avoid seeing that in my logs.

So yes, it's probably a good thing you're seeing that.


Thanks,
Sasha

Attachment: signature.asc
Description: OpenPGP digital signature