Discussion:
[PATCH] PR lto/59441 Add initialization and release of bitmap obstack
Ilya Palachev
2014-10-07 12:55:19 UTC
Permalink
Hi all,

Attached patch fixes PR lto/59441.
The reason of failure was that the default bitmap obstack was released
just before the execution of early local passes.
The error was found using valgrind. It reported that there were 153
invalid reads and 173 invalid writes into the field of the default
bitmap obstack structure,
and all of them were trying to access data that was free'd previously
(at the same point of the program).

The solution is to add initialization and release of the bitmap obstack
before and after the execution of early local passes.
After applying this patch valgrind does not report any errors for the
same testcase.

The patch was bootstrapped and regtested on x86_64-unknown-linux-gnu.

Ok for trunk?

Best regards,
Ilya Palachev
Richard Biener
2014-10-07 14:41:54 UTC
Permalink
Post by Ilya Palachev
Hi all,
Attached patch fixes PR lto/59441.
The reason of failure was that the default bitmap obstack was released just
before the execution of early local passes.
The error was found using valgrind. It reported that there were 153 invalid
reads and 173 invalid writes into the field of the default bitmap obstack
structure,
and all of them were trying to access data that was free'd previously (at
the same point of the program).
The solution is to add initialization and release of the bitmap obstack
before and after the execution of early local passes.
After applying this patch valgrind does not report any errors for the same
testcase.
The patch was bootstrapped and regtested on x86_64-unknown-linux-gnu.
Ok for trunk?
Ok.

Thanks,
Richard.
Post by Ilya Palachev
Best regards,
Ilya Palachev
Loading...