Re: buildworld: /usr/bin/ar segfault

From: Tim Kientzle <tim_at_kientzle.com>
Date: Fri, 3 Jun 2016 21:41:10 -0700
> On Jun 3, 2016, at 10:23 AM, Eric van Gyzen <vangyzen_at_freebsd.org> wrote:
> 
> My buildworld just failed very early with a segfault from /usr/bin/ar:
> 
>    --------------------------------------------------------------
>>>> stage 1.1: legacy release compatibility shims
>    --------------------------------------------------------------
>    ...
>    --- libegacy.a ---
>    building static egacy library
>    ar -crD libegacy.a `NM='nm' NMFLAGS='' lorder dummy.o  | tsort -q`
>    Segmentation fault (core dumped)
>    *** [libegacy.a] Error code 139
> 
> 
> In __archive_write_allocate_filter(), a->filter_last was pointing to
> archive_write_ar_header().  a->format_write_header should have pointed
> to this function.  The offset between these two fields in struct archive
> is 48 bytes.  Sure enough, that structure recently grew by 48 bytes.
> 
> This would seem to indicate that ar (or libarchive.a) was built with
> mismatched objects.  Unfortunately, I don't have good records of what
> build options and flags I used.  I /think/ I used either
> -DWITH_SYSTEM_COMPILER or no options at all.

The build of 'ar' shouldn't matter since it's a client of libarchive
and libarchive clients do not ever see or manipulate the internals of
struct archive_write.

The problem would be with the build of the libarchive library.
It sounds like you somehow had a stale archive_write_set_format_ar.o
that did not get rebuilt when archive_write_private.h got updated recently.

If you still have the /usr/obj tree around, could you check the dates on these
files:
   archive_write_set_format_ar.o (in /usr/obj)
   archive_write_private.h (in /usr/src)

If those dates are in the wrong order (the .o should be newer), then
the make definitely went awry somewhere.

Tim
Received on Sat Jun 04 2016 - 02:41:19 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:41:05 UTC