This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Fix segfault when processing .eh_frame.
ClosedPublic

Authored by grimar on Sep 19 2017, 6:02 AM.

Details

Summary

Its a PR34648 which was a segfault that happened because
we stored pointers to elements in DenseMap.
When DenseMap grows such pointers are invalidated.
Solution implemented is to keep elements by pointer
and not by value.

Diff Detail

Event Timeline

grimar created this revision.Sep 19 2017, 6:02 AM
ruiu accepted this revision.Sep 19 2017, 12:45 PM

LGTM

This is a pretty bad bug, I was a bit surprised that it doesn't crash except the situation described in https://bugs.llvm.org/show_bug.cgi?id=34648. It could have been silently creating corrupted outputs, I guess. It seems scary.

This revision is now accepted and ready to land.Sep 19 2017, 12:45 PM
In D38034#875487, @ruiu wrote:

LGTM

This is a pretty bad bug, I was a bit surprised that it doesn't crash except the situation described in https://bugs.llvm.org/show_bug.cgi?id=34648. It could have been silently creating corrupted outputs, I guess. It seems scary.

Should we backport it to LLD 5.0.x branch somehow ? 5.0.1 I guess.

This revision was automatically updated to reflect the committed changes.