Bug 273955 - devel/valgrind: patch for ifuncs
Summary: devel/valgrind: patch for ifuncs
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: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-20 04:48 UTC by Paul Floyd
Modified: 2023-09-20 11:42 UTC (History)
1 user (show)

See Also:


Attachments
Add a patch for ifunc_handler (2.94 KB, patch)
2023-09-20 04:48 UTC, Paul Floyd
pjfloyd: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Floyd 2023-09-20 04:48:41 UTC
Created attachment 245034 [details]
Add a patch for ifunc_handler

The work for simd support uses @gnu_indirect_function. When Valgrind sees binaries using such function it expects to have its own ifunc_handler. Until now there wasn't one for FreeBSD so Valgrind terminates with an abort.

This patch merges the fix I made upstream:

commit c934430d56c2add25002ea8e321bd8bdab80fc99
Author: Paul Floyd <pjfloyd@wanadoo.fr>
Date:   Thu Aug 31 15:32:21 2023 +0200

    Bug 473870 - FreeBSD 14 applications fail early at startup
    
    FreeBSD recently started adding some functions using @gnu_indirect_function,
    specifically strpcmp which was causing this crash.
    
    When running and encountering this ifunc Valgrind looked for the
    ifunc_handler. But there wasn't one for FreeBSD so Valgrind asserted.
Comment 1 Fernando Apesteguía freebsd_committer freebsd_triage 2023-09-20 07:54:18 UTC
^Triage: Please set the maintainer-approval attachment flag (to +) on patches for ports you maintain to signify approval.
--
Attachment -> Details -> maintainer-approval [+]


Thanks!
Comment 2 Paul Floyd 2023-09-20 07:58:03 UTC
Comment on attachment 245034 [details]
Add a patch for ifunc_handler

Patch based on the upstream fix.
Comment 3 Fernando Apesteguía freebsd_committer freebsd_triage 2023-09-20 11:42:44 UTC
Committed,

Thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2023-09-20 11:42:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3d864ab9721054806c92c3c0588b8a45f80d8aa2

commit 3d864ab9721054806c92c3c0588b8a45f80d8aa2
Author:     Paul Floyd <pjfloyd@wanadoo.fr>
AuthorDate: 2023-09-20 07:54:04 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-09-20 11:42:11 +0000

    devel/valgrind: patch for ifuncs

    The work for simd support uses @gnu_indirect_function. When Valgrind sees
    binaries using such function it expects to have its own ifunc_handler. Until now
    there wasn't one for FreeBSD so Valgrind terminates with an abort.

    This patch merges the fix maintainer and creator made upstream.

    PR:             273955
    Reported by:    pjfloyd@wanadoo.fr (maintainer)

 devel/valgrind/Makefile                            | 28 ++++++++++---------
 .../files/patch-coregrind-vg_preloaded.c (new)     | 31 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 12 deletions(-)