Bug 211630 - audio/libmusicbrainz5 crash when used from libkcddb
Summary: audio/libmusicbrainz5 crash when used from libkcddb
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: Jason E. Hale
URL:
Keywords:
Depends on:
Blocks: 209696
  Show dependency treegraph
 
Reported: 2016-08-06 21:53 UTC by groot
Modified: 2016-09-19 23:20 UTC (History)
1 user (show)

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


Attachments
Patch adding visibility to C++ exceptions (2.32 KB, patch)
2016-08-06 21:53 UTC, groot
no flags Details | Diff
Patch against portstree (3.43 KB, patch)
2016-08-07 08:57 UTC, groot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description groot 2016-08-06 21:53:28 UTC
Created attachment 173365 [details]
Patch adding visibility to C++ exceptions

See also upstream report http://tickets.musicbrainz.org/browse/LMB-43

Applications using libkcddb crash when libmusicbrainz5 throws an error while looking up the CD info (e.g. connection error, or unknown CD).

The problem is that libmusicbrainz5 throws a (C++) exception. libkcddb catches those exceptions and returns an error code instead. But with -fvisibility=hidden (the default in compiling KDE code), the exception symbols are hidden, libkcddb can't catch the exceptions and they propagate to the calling application, which gets an unexpected exception and crashes.

The nicest place to patch this is in libmusicbrainz5, to ensure that the exception symbols are always visible (so that libkcddb and possibly other users of libmusicbrainz5 can catch the exceptions reliably).

The attached patch adds a visibility-attribute to the exception symbols, and prevents crashes that have been reported against KDE applications on FreeBSD (e.g. PR 209696).
Comment 1 groot 2016-08-07 08:57:30 UTC
Created attachment 173379 [details]
Patch against portstree

This patch applies directly to the ports tree:
 - adds the previous patch to audio/libmusicbrainz5/files/
 - bumps PORTREVISION, since new symbols are now strongly defined (in particular, to force libkcddb to rebuild)
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-09-19 23:19:58 UTC
A commit references this bug:

Author: jhale
Date: Mon Sep 19 23:19:00 UTC 2016
New revision: 422468
URL: https://svnweb.freebsd.org/changeset/ports/422468

Log:
  Add visibility to C++ exceptions to prevent crashes with applications
  using libkcddb.

  PR:	211630
  Submitted by:	Adriaan de Groot <groot@kde.org>

Changes:
  head/audio/libmusicbrainz5/Makefile
  head/audio/libmusicbrainz5/files/patch-musicbrainz5-httpfetch-h.patch
Comment 3 Jason E. Hale freebsd_committer freebsd_triage 2016-09-19 23:20:35 UTC
Committed, thanks!