NetBSD Problem Report #57227

From  Mon Feb 13 11:34:31 2023
Return-Path: <>
Received: from ( [])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 9A7FC1A9239
	for <>; Mon, 13 Feb 2023 11:34:31 +0000 (UTC)
Message-Id: <>
Date: Mon, 13 Feb 2023 11:34:30 +0000 (UTC)
Subject: 2023 audit of mistakenly obsoleted shared libraries
X-Send-Pr-Version: www-1.0

>Number:         57227
>Category:       lib
>Synopsis:       2023 audit of mistakenly obsoleted shared libraries
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Feb 13 11:35:00 +0000 2023
>Last-Modified:  Mon Feb 13 14:15:02 +0000 2023
>Originator:     Taylor R Campbell
>Release:        8, 9, 10, current
The NetBSD Foundobsoletion
raising the sea level
From src/distrib/sets/lists/base/shl.mi:

# Note: Don't delete entries from here - mark them as "obsolete" instead,
#       unless otherwise stated below.
# Note: Do not mark "old" major and major.minor shared libraries as
#       "obsolete"; just remove the entry, as third-party applications
#       may be linked against the old major shared library, and
#       that is a symlink to the old major.minor shared library.
#       e.g., "lib<name>.so.<N>" and "lib<name>.so.<N>.<M>"
#       Exceptions to this rule may include shared libraries that
#       are dlopen()ed at run-time, such as extra locales, etc.

There are a number of shared libraries marked obsolete in the set lists, which leads them to be deleted by postinstall.

Some of these libraries are correctly marked obsolete because they are strictly internal, e.g. libbfd, used by other NetBSD base binaries and libraries but not exposed to ld(1) for linking new programs.

Some of these libraries, however, have been exposed to ld(1) and must not be deleted because they may still be referenced by, e.g., pkgsrc-installed binaries and libraries.  For example, I suspect may fall in this category (renamed, as well as .  These entries should be deleted from the set lists, not marked obsolete -- that way postinstall will leave them alone.

And some libraries that _should_ be internal are mistakenly exposed.  For example, I think libgomp is supposed to be gcc-internal, but we install a /usr/lib/ symlink so ld(1) will pick it up.

We need to go through all of the set list entries for linkable shared libraries (excluding loadable modules for dlopen like, and perhaps rump modules for use with rump_server and rump_allserver) and:

1. Delete the dangerous obsolete lib*.so.* entries.
2. Consider obsoleting the lib*.so symlinks for libraries that should be internal.  It should be safe for postinstall to effect the obsoletion by deleting these because they are used by ld(1) when linking binaries and libraries, not by when loading them.

Finally, we should add a note about this distinction (internal libraries vs libraries with exposed lib*.so symlinks) to the shl.* set lists, and perhaps comment entries out instead of deleting them to make the history clearer.
Run postinstall on a system with pkgsrc packages that were linked against libraries which have been obsoleted, like
Yes please!

From: Joerg Sonnenberger <>
Subject: Re: lib/57227: 2023 audit of mistakenly obsoleted shared libraries
Date: Mon, 13 Feb 2023 15:10:34 +0100

 Am Mon, Feb 13, 2023 at 11:35:01AM +0000 schrieb
 > For example, I think libgomp is supposed to be gcc-internal, but we install a /usr/lib/ symlink so ld(1) will pick it up.

 libgomp is the OpenMP runtime, similar to libstdc++ being the C++ STL.


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.