Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jan 2025 23:50:23 +0900
From:      Tomoaki AOKI <junchoon@dec.sakura.ne.jp>
To:        Baptiste Daroussin <bapt@freebsd.org>
Cc:        dev-commits-ports-main@freebsd.org
Subject:   Re: git: 460f6d861e43 - main - ports-mgmt/pkg: update to 2.0.0
Message-ID:  <20250122235023.fbaad09fa596721af8fa5963@dec.sakura.ne.jp>
In-Reply-To: <bdy5254dndrldk2vfg43zfedlh7mu7tndh5ofhjbt2p6edj2vs@eaac34tndzkj>
References:  <20250122222710.ea16e2ff0b14538d09b767c8@dec.sakura.ne.jp> <bdy5254dndrldk2vfg43zfedlh7mu7tndh5ofhjbt2p6edj2vs@eaac34tndzkj>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.

--Multipart=_Wed__22_Jan_2025_23_50_23_+0900_KJh6HB+hbJH0llhq
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

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>

--Multipart=_Wed__22_Jan_2025_23_50_23_+0900_KJh6HB+hbJH0llhq
Content-Type: text/x-diff;
 name="patch-src_version.c"
Content-Disposition: attachment;
 filename="patch-src_version.c"
Content-Transfer-Encoding: 7bit

>From 8dd2edca3350cd6d8a4fe2e8a6a59bf0cbda3ea7 Mon Sep 17 00:00:00 2001
From: Baptiste Daroussin <bapt@FreeBSD.org>
Date: Wed, 22 Jan 2025 14:52:18 +0100
Subject: [PATCH] version: fix bad usage of pkg_printf

---
 src/version.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/version.c b/src/version.c
index 85e1749b2..cf0cbe909 100644
--- src/version.c.orig
+++ src/version.c
@@ -113,8 +113,10 @@ print_version(struct pkg *pkg, const char *source, const char *ver,
 	if ((opt & VERSION_NOSTATUS) && limchar == key)
 		return;
 
-	if (opt & VERSION_ORIGIN)
-		pkg_printf("%-34o %c", pkg, key);
+	if (opt & VERSION_ORIGIN) {
+		pkg_printf("%-34o", pkg);
+		printf("%c", key);
+	}
 	else {
 		cout = pkg_printf("%n-%v", pkg, pkg);
 		cout = 35 - cout;

--Multipart=_Wed__22_Jan_2025_23_50_23_+0900_KJh6HB+hbJH0llhq--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20250122235023.fbaad09fa596721af8fa5963>