Bug 273614 - archivers/rpm4: Backport upstream patch to fix segfaults in 4.18.1
Summary: archivers/rpm4: Backport upstream patch to fix segfaults in 4.18.1
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Rodrigo Osorio
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-07 13:21 UTC by Mark Johnston
Modified: 2023-10-12 15:23 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (rodrigo)


Attachments
proposed patch (1.73 KB, patch)
2023-09-07 13:21 UTC, Mark Johnston
no flags Details | Diff
proposed patch (1.56 KB, patch)
2023-09-07 13:24 UTC, Mark Johnston
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Johnston freebsd_committer freebsd_triage 2023-09-07 13:21:32 UTC
Created attachment 244693 [details]
proposed patch

The patch is a backport of this upstream commit: https://github.com/rpm-software-management/rpm/commit/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e

We've observed that this fixes occasional crashes in dnf, which uses librpmio.so:

#0  0x000000080083c884 in strlen () at /lib/libc.so.7
#1  0x00000008007ddb9e in __vfprintf () at /lib/libc.so.7
#2  0x00000008007507d9 in vsnprintf () at /lib/libc.so.7
#3  0x0000000801f8f248 in rpmlog () at /usr/local/lib/librpmio.so.9
#4  0x0000000801ffd824 in sqlite3_log () at /usr/local/lib/libsqlite3.so.0
#5  0x00000008020235a7 in  () at /usr/local/lib/libsqlite3.so.0
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2023-09-07 13:24:48 UTC
Created attachment 244694 [details]
proposed patch

Submit a patch against the ports tree.
Comment 2 Mark Johnston freebsd_committer freebsd_triage 2023-09-27 17:35:26 UTC
Hi Rodrigo, it looks like rpm 4.19.0 was released recently, and it contains the patch.  Do you plan to update the port in the near future?  If not, is there any problem with committing this patch?
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-10-12 15:23:23 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=294f4c23aad46176cd0ebb8b816508b437f22b1f

commit 294f4c23aad46176cd0ebb8b816508b437f22b1f
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-09-06 20:58:55 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-10-12 15:21:48 +0000

    archivers/rpm4: Backport an upstream bugfix

    The following upstream commit addresses a problem where librpmio.so's
    sqlite error handler can interfere with other sqlite consumers and cause
    a crash:
    https://github.com/rpm-software-management/rpm/commit/ea3187cfcf9cac87e5bc5e7db79b0338da9e355e

    Backport the patch now since it's affecting at least one rpm4 user on
    FreeBSD.  This can be dropped once rpm 4.19 is imported.

    PR:             273614
    Approved by:    maintainer timeout (4 weeks)
    Sponsored by:   Klara, Inc.

 .../rpm4/files/patch-lib_backend_sqlite.c (new)    | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)