Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Nov 2023 16:13:02 -0800
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   Re: git: fd9ae9ac04ed - main - pkg: Allocate a suitably-sized string for the local ABI
Message-ID:  <681da086-e250-4e7b-9baa-6b366742312e@FreeBSD.org>
In-Reply-To: <202311160054.3AG0somJ049001@gitrepo.freebsd.org>
References:  <202311160054.3AG0somJ049001@gitrepo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 11/15/23 4:54 PM, John Baldwin wrote:
> The branch main has been updated by jhb:
> 
> URL: https://cgit.FreeBSD.org/src/commit/?id=fd9ae9ac04edf9acef4a2ffbf663698a2b8e7ced
> 
> commit fd9ae9ac04edf9acef4a2ffbf663698a2b8e7ced
> Author:     John Baldwin <jhb@FreeBSD.org>
> AuthorDate: 2023-11-16 00:53:53 +0000
> Commit:     John Baldwin <jhb@FreeBSD.org>
> CommitDate: 2023-11-16 00:53:53 +0000
> 
>      pkg: Allocate a suitably-sized string for the local ABI
>      
>      Previously the local ABI string was written to an on-stack buffer and
>      the pointer to that buffer was saved in a global before the function
>      returned.  This had two issues: c[ABI].val pointed to a
>      no-longer-valid on-stack buffer after config_init returned, and the
>      string could potentially be truncated.  Fix both of those by changing
>      pkg_get_myabi to return a pointer to a string allocated by asprintf.
>      
>      Note that the allocated string is left in the global config array
>      until it is implicitly freed on process exit.
>      
>      Reported by:    GCC 13 -Wdangling-pointer
>      Reviewed by:    emaste
>      Differential Revision:  https://reviews.freebsd.org/D42623

With this (and earlier fixes), I'm able to build amd64 world + GENERIC with
GCC 13.2.  The review for the port for that is still in review, but once the
port lands I have a change against freebsd-ci to add GCC 13 jobs to Jenkins
for main.

-- 
John Baldwin




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?681da086-e250-4e7b-9baa-6b366742312e>