Bug 225613 - devel/p4api: segfaults at runtime on FreeBSD 12
Summary: devel/p4api: segfaults at runtime on FreeBSD 12
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Alan Somers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-01 21:19 UTC by Alan Somers
Modified: 2018-02-02 19:12 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (gordon)
asomers: merge-quarterly-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2018-02-01 21:19:34 UTC
Any nontrivial program that uses the p4api will crash at runtime on FreeBSD 12.  The reason is because p4api's .a files reference several functions from libc that have API changes in FreeBSD 12.  However, the .a files contain no elf symbol versioning information.  So when you link to them on a FreeBSD 12 machine, the linker chooses the most recent version.  Since the p4api was built on a FreeBSD 10 machine, the linker chooses the wrong versions, and a crash ensues.

The offending functions are readdir, fstat, lstat, and stat.  They were all modified as part of the 64-bit inode project.

This bug also afflicts software that uses its own copy of the p4api, such as p4python.
Comment 1 Alan Somers freebsd_committer freebsd_triage 2018-02-02 00:45:24 UTC
Patch under review at https://reviews.freebsd.org/D14162
Comment 2 commit-hook freebsd_committer freebsd_triage 2018-02-02 19:08:21 UTC
A commit references this bug:

Author: asomers
Date: Fri Feb  2 19:07:22 UTC 2018
New revision: 460727
URL: https://svnweb.freebsd.org/changeset/ports/460727

Log:
  devel/p4 devel/p4api: build from source

  Build devel/p4 and devel/p4api from source rather than use the prebuilt
  binary downloads. This fixes p4api on FreeBSD 12.  The ports originally used
  the binaries because source wasn't available until a few years ago.  By
  happy accident, building from source also makes the ports available on
  non-Intel architectures.

  PR:		225613
  Reviewed by:	brd
  Approved by:	brd (ports)
  Sponsored by:	Spectra Logic Corp
  Differential Revision:	https://reviews.freebsd.org/D14162

Changes:
  head/devel/p4/Makefile
  head/devel/p4/Makefile.inc
  head/devel/p4/distinfo
  head/devel/p4/distinfo.freebsd100x86
  head/devel/p4/distinfo.freebsd100x86_64
  head/devel/p4/files/
  head/devel/p4/files/patch-Jamrules
  head/devel/p4api/Makefile
  head/devel/p4api/distinfo
  head/devel/p4api/distinfo.freebsd100x86
  head/devel/p4api/distinfo.freebsd100x86_64
  head/devel/p4api/files/
  head/devel/p4api/files/patch-Jamrules
Comment 3 Alan Somers freebsd_committer freebsd_triage 2018-02-02 19:12:57 UTC
MFH is not required because this bug only affects FreeBSD 12, and few if any people use the quarterly ports branches on head.