Home / Alt manpages / perlopenbsd(1)

  • perlopenbsd(1)
  • User command
  • linux

Perl on OpenBSD: Check the ithreads Compatibility Trap

You will determine whether an OpenBSD Perl installation is old enough to be affected by a documented resolver crash, and record the evidence before changing anything. The issue concerns threaded Perl, known as ithreads, and OpenBSD 3.7 or later. Allow about ten minutes for the checks. You need shell access to the OpenBSD host and permission to read its Perl executable; no elevated privileges are needed for the diagnostic steps.

1. Confirm that this is the right document

perlopenbsd is a manual page, not a command you run. It describes OpenBSD-specific Perl build and runtime behaviour. On an installed system with the perl-doc package, open it directly:

$ man perlopenbsd
PERLOPENBSD(1)         Perl Programmers Reference Guide         PERLOPENBSD(1)

The useful heading is named OpenBSD core dumps from getprotobyname_r and getservbyname_r with ithreads. If man perlopenbsd reports that no manual entry exists, stop here and check that the documentation package for your Perl installation is present. Do not treat a missing page as evidence that the runtime is unaffected.

2. Record the Perl version and thread build

Run these commands on the OpenBSD host, as the account that runs the application. The first prints the interpreter version; the second shows the compile-time configuration and is the useful check for useithreads:

$ perl -v
$ perl -V | egrep '^(Summary|Compile-time options|  useithreads)'

The exact formatting of perl -V varies between Perl releases. Look for a summary containing the Perl version and a compile-time option list containing useithreads. You can also ask Perl without filtering the output:

$ perl -V
Summary of my perl5 (revision 5 version 38 subversion 2) configuration:
  ...
  useithreads=define
  ...

Do not copy the version in that example into a report. It is illustrative. Record the version printed by your host, because the compatibility boundary in the manual is version-specific.

3. Compare the result with the documented boundary

The manual identifies the failure combination precisely: OpenBSD 3.7 or later, a threaded Perl, and the re-entrant resolver calls getprotobyname_r or getservbyname_r. It says older threaded Perl 5.8.6 or earlier can encounter a segmentation fault, or SEGV, because the OpenBSD return structures need to be cleared with bzero first.

Use this decision point:

  • If the Perl version is 5.8.6 or earlier and the build uses ithreads, plan an upgrade before relying on this interpreter for the affected workload.
  • If the Perl version is at least 5.8.7, the manual says current Perl versions handle the OpenBSD incompatibility correctly.
  • If useithreads is absent, this particular threaded-Perl failure path does not match the documented conditions.

This is a compatibility check, not a proof that an application is free of every crash. The manual only covers this interaction, and it does not turn a non-threaded build into a supported substitute for a tested application configuration.

4. Check the application before changing Perl

Find out whether the application actually enables threads. Search its source, startup files and dependency configuration for use threads, use threads::shared, or a build and runtime setting that selects a threaded Perl. This is an ordinary read-only operation:

$ rg -n 'use[[:space:]]+threads|use[[:space:]]+threads::shared' /path/to/application

If rg is not installed, inspect the relevant files with the tools already approved for your host. A threaded Perl can exist even when the application does not create a thread, so distinguish the interpreter's build from the application's use of it. Likewise, do not assume that a network feature calls these resolver functions merely because it opens a socket.

Keep the original version and configuration output with the incident or upgrade ticket. That record prevents a later operator from confusing an OpenBSD release, a Perl release and an application setting.

5. Upgrade with a rollback plan

Do not replace a system Perl blindly. Perl is part of the operating system on some OpenBSD installations, and other software may depend on its library tree. An upgrade is a service-impacting change: schedule it, read the release notes for the OpenBSD and Perl versions involved, and test the application in a staging environment first.

Before the change, save the outputs from steps 2 and 3 and identify the current executable:

$ command -v perl
/usr/bin/perl
$ perl -v

Use the host's normal OpenBSD package and release-upgrade process rather than downloading an unverified interpreter into /usr/bin. That normally requires an administrator. Afterward, rerun the version and useithreads checks, then exercise the application's own resolver and threaded paths during the maintenance window. If the application fails compatibility tests, restore the previously approved package or interpreter using your documented package rollback procedure and restart only the affected service.

6. Verify the final state

Reopen the manual after the change and confirm that the host now meets the relevant boundary:

$ man perlopenbsd | grep -A12 -F 'OpenBSD core dumps'
$ perl -V | grep -F useithreads

The first command should show the resolver function names and the Perl 5.8.7 minimum stated by the page. The second should either show useithreads for a threaded build or produce no matching line for a non-threaded build. A missing match is not automatically a success: compare it with the application's requirements and the version output.

Done means

  • You confirmed that perlopenbsd is documentation, not an executable.
  • You recorded the OpenBSD host's Perl version and whether it was built with useithreads.
  • You compared those facts with the documented OpenBSD 3.7 and Perl 5.8.6 boundary.
  • You checked whether the application actually enables Perl threads.
  • Any upgrade has a tested package source, maintenance window and rollback path.
  • You reran the checks after the change and kept the evidence.