Regression in object archive writer

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 4 12:36:37 PDT 2016


Hi Dylan,

Where exactly are you seeing the segfault? Are you passing a non-null Data
field? Archive::Child values can be sentinels (all null fields) or concrete
children (both data and a parent), but you can't create an Archive::Child
with a data pointer but no parent.

- Lang.


On Tue, Oct 4, 2016 at 11:01 AM, Kevin Enderby via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Hi Dylan,
>
> I worked with Lang Hames on this back in July when this change was made.
> I don’t recall the exact details off the top of my head, but one key points
> of the thinking was you could not use this without handling the Error.
> I’ll seem to recall the only case one of the default constructors was
> allowed was for a sentinel value.
>
> I’ll try to grab Lang today and try to look at this and get back to you.
> Sorry the details are not fresh on my mind as we did make these changes
> over 2 months ago.
>
> Kev
>
> On Oct 3, 2016, at 6:48 PM, Dylan McKay <dylanmckay34 at gmail.com> wrote:
>
> r276686 introduced a regression into the object archive writer.
>
> r276686 <http://276686/> on Phabricator
>
> It causes the constructor Archive::Child(Parent, Data, StartOfFile) to
> segfault if it is given a parent equalling NULL.
>
> LLVM does this in a few places. The most prominent example is the
> Archive::child_iterator default constructor. This will never execute
> without causing a segfault.
>
> I’m in the process of updating Rust to LLVM 4.0. We are currently using
> Archive::child_iterator, and it causes us to segfault when writing object
> files.
>>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161004/58922800/attachment.html>


More information about the llvm-commits mailing list