Re: git: 460f6d861e43 - main - ports-mgmt/pkg: update to 2.0.0

From: Tomoaki AOKI <junchoon_at_dec.sakura.ne.jp>
Date: Wed, 22 Jan 2025 14:50:23 UTC
On Wed, 22 Jan 2025 14:56:07 +0100
Baptiste Daroussin <bapt@freebsd.org> wrote:

> On Wed 22 Jan 22:27, Tomoaki AOKI wrote:
> > Hi.
> > 
> > Unfortunately, upgraded pkg segfaults as below on stable/14, amd64 at
> > commit 0ec93987e5302495f9512f8534a2375d7da4ee2a.
> > Reverting back to 1.21.3 fixes the issue.
> > 
> > % pkg version -o -v
> > Child process pid=55201 terminated abnormally: Segmentation fault
> > % lldb
> > --core ~/pkg.core --file /usr/local/sbin/pkg (lldb) target create
> > "/usr/local/sbin/pkg" --core "~/pkg.core" Core file '~/pkg.core'
> > (x86_64) was loaded. (lldb) bt all
> > * thread #1, name = 'pkg', stop reason = signal SIGSEGV
> >   * frame #0: 0x0000000000527a4e pkg`format_comment + 30
> >     frame #1: 0x0000000000524dde pkg`pkg_xstring_vprintf + 206
> >     frame #2: 0x0000000000524cad pkg`pkg_vprintf + 77
> >     frame #3: 0x0000000000524c45 pkg`pkg_printf + 149
> >     frame #4: 0x00000000003107d4 pkg`print_version + 308
> >     frame #5: 0x000000000030f9fe pkg`do_source_index + 1086
> >     frame #6: 0x000000000030f2d3 pkg`exec_version + 1619
> >     frame #7: 0x0000000000304856 pkg`main + 2838
> >     frame #8: 0x00000008293b80c0 libc.so.7`__libc_start1 + 304
> >     frame #9: 0x00000000002fa240 pkg`_start + 48
> > (lldb) q
> > 
> > Thanks in advance!
> > 
> > > The branch main has been updated by bapt:
> > > 
> > > URL:
> > https://cgit.FreeBSD.org/ports/commit/?id=460f6d861e431f8952debe0ee74c40a6a6a583e7
> > > 
> > > commit 460f6d861e431f8952debe0ee74c40a6a6a583e7
> > > Author:     Baptiste Daroussin <bapt@FreeBSD.org>
> > > AuthorDate: 2025-01-22 10:36:51 +0000
> > > Commit:     Baptiste Daroussin <bapt@FreeBSD.org>
> > > CommitDate: 2025-01-22 10:37:45 +0000
> > > 
> > >     ports-mgmt/pkg: update to 2.0.0
> > >     
> > 
> >     (Snip all below)
> > 
> 
> This is an old bug that should have broke long ago, thanks for reporting:
> fixed:
> https://github.com/freebsd/pkg/commit/8dd2edca3350cd6d8a4fe2e8a6a59bf0cbda3ea7
> 
> I will wait a couple of days for other reports before issueing a 2.0.1, I don't
> consider this as a blocking issue for now.
> 
> Best regards,
> Bapt

Hi.

Downloaded the diff as a patch, rename/slightly edited (not 100% sure
"-p1" diff is OK or not) to fit in ports-mgmt/pkg/files/,
rebuild/reinstall fixed the issue.

And agree with that this isn't a blocking issue, because other pkgs
built with pkg 2.0.0 was sanely upgraded using 2.0.0. Just failed to
confirm by `pkg version -o -v`.

Thanks!


For anyone who cannot wait for the fix to be committed and want testing:
Drop the attached patch into ports-mgmt/pkg/file/ and rebuild/reinstall.

Don't forget to delete it when pulling updates including the fix from
official git repo to avoid any kind of conflicts!

-- 
Tomoaki AOKI    <junchoon@dec.sakura.ne.jp>