From patchwork Tue Jun 22 05:58:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ryan Sundberg X-Patchwork-Id: 30616 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 49BEC27BC78; Tue, 22 Jun 2021 06:59:08 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 84B9F27BC81 for ; Tue, 22 Jun 2021 06:59:07 +0100 (BST) Received: from localhost ([::1]:58812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvZRC-0004WV-KH for patchwork@mira.cbaines.net; Tue, 22 Jun 2021 01:59:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44504) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvZR7-0004WN-RS for guix-patches@gnu.org; Tue, 22 Jun 2021 01:59:01 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lvZR7-0002KD-KT for guix-patches@gnu.org; Tue, 22 Jun 2021 01:59:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lvZR7-0000ug-Kq for guix-patches@gnu.org; Tue, 22 Jun 2021 01:59:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49167] [PATCH core-updates] gnu: jemalloc: --disable-initial-exec-tls Resent-From: Ryan Sundberg Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 22 Jun 2021 05:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49167 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49167@debbugs.gnu.org Received: via spool by 49167-submit@debbugs.gnu.org id=B49167.16243415133473 (code B ref 49167); Tue, 22 Jun 2021 05:59:01 +0000 Received: (at 49167) by debbugs.gnu.org; 22 Jun 2021 05:58:33 +0000 Received: from localhost ([127.0.0.1]:37583 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvZQe-0000tx-Gx for submit@debbugs.gnu.org; Tue, 22 Jun 2021 01:58:33 -0400 Received: from mail.arctype.co ([138.68.9.245]:58661) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lvZQc-0000te-6N for 49167@debbugs.gnu.org; Tue, 22 Jun 2021 01:58:30 -0400 Received: from authenticated-user (mail.arctype.co [138.68.9.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.arctype.co (Postfix) with ESMTPSA id 5A0EC11F07F for <49167@debbugs.gnu.org>; Mon, 21 Jun 2021 22:58:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arctype.co; s=mail; t=1624341504; bh=DhikskEDcqnqeC6ZyroKhYTdhc3b14KcDJoNp2Dxww8=; h=Subject:References:To:From:Date:In-Reply-To:From; b=tTyt4Sql9HwGrlI+2ouF4jejXI3IDPtJx4XggLw20F/r9bD7uuIILv9EHppeJnoVS zxTDAUfvqDLiLPPgH/GIByO8cIGc3inyxHTNxMGjFyOyzYJBQJNUPvaF25jFc9M/PB ku/KzhHmRRxdIOAfI01e1L3ELNFi1ach6C1RMXnEDbAZLqFaaT+7bBEmRxz3bJ8pvB HB1CEnf2cyqf+dH3hSyh4I0CsKE62jRsk04hbMmGWnp3iWXIA0x987tsLSiCeL2FMZ O96wyWpsEljEnd9JsUD9vMHwlpGceKl++w0kRkHFfdgt2UD8JFCIV7TcCt6mZhKq8f j6hI8PLtsUjpw== References: <20210622054423.31851-1-ryan@arctype.co> Message-ID: Date: Mon, 21 Jun 2021 22:58:24 -0700 MIME-Version: 1.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Ryan Sundberg X-ACL-Warn: , Ryan Sundberg via Guix-patches X-Patchwork-Original-From: Ryan Sundberg via Guix-patches via From: Ryan Sundberg X-getmail-retrieved-from-mailbox: Patches Please excuse my clumsiness, THIS is the fixed patch file. (I accidentally re-sent the original patch.) --- Sincerely, Ryan Sundberg On 6/21/21 10:52 PM, Ryan Sundberg via Guix-patches via wrote: > Sorry, I missed a spot rebasing this last patch. Please use the attached > patch which builds. > > > -- > Sincerely, > Ryan Sundberg > > On 6/21/21 10:44 PM, Ryan Sundberg wrote: >> Disable the thread local storage model in jemalloc 5 to prevent >> shared libraries linked to libjemalloc from crashing on dlopen(). >> https://github.com/jemalloc/jemalloc/issues/937 >> >> This bug affects both Java JNI and python libraries which link to >> jemalloc 5, such as RocksDB, which will crash the program when loaded. >> >> * gnu/packages/jemalloc.scm (jemalloc)[arguments]: Add --disable-initial-exec-tls >> configure flag. >> --- >> gnu/packages/jemalloc.scm | 26 +++++++++++++++++--------- >> 1 file changed, 17 insertions(+), 9 deletions(-) >> >> diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm >> index c4b87b540d..67a1ca8e14 100644 >> --- a/gnu/packages/jemalloc.scm >> +++ b/gnu/packages/jemalloc.scm >> @@ -2,6 +2,7 @@ >> ;;; Copyright © 2015 Sou Bunnbu >> ;;; Copyright © 2017 Efraim Flashner >> ;;; Copyright © 2017 Eric Bavier >> +;;; Copyright © 2021 Ryan Sundberg >> ;;; >> ;;; This file is part of GNU Guix. >> ;;; >> @@ -29,10 +30,10 @@ >> #:use-module (gnu packages perl) >> #:use-module (guix build-system gnu)) >> >> -(define-public jemalloc >> +(define jemalloc-4.5.0 >> (package >> (name "jemalloc") >> - (version "5.2.1") >> + (version "4.5.0") >> (source (origin >> (method url-fetch) >> (uri (string-append >> @@ -40,7 +41,7 @@ >> version "/jemalloc-" version ".tar.bz2")) >> (sha256 >> (base32 >> - "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl")))) >> + "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl")))) >> (build-system gnu-build-system) >> (arguments >> `(#:phases >> @@ -58,7 +59,7 @@ >> ;; Transparent huge pages are only enabled by default on Intel processors >> '() >> '(#:configure-flags (list "--disable-thp"))))) >> - (inputs `(("perl" ,perl))) >> + (inputs '()) >> ;; Install the scripts to a separate output to avoid referencing Perl and >> ;; Bash in the default output, saving ~75 MiB on the closure. >> (outputs '("out" "bin")) >> @@ -69,10 +70,10 @@ >> fragmentation avoidance and scalable concurrency support.") >> (license bsd-2))) >> >> -(define-public jemalloc-4.5.0 >> +(define-public jemalloc >> (package >> - (inherit jemalloc) >> - (version "4.5.0") >> + (inherit jemalloc-4.5.0) >> + (version "5.2.1") >> (source (origin >> (method url-fetch) >> (uri (string-append >> @@ -80,5 +81,12 @@ fragmentation avoidance and scalable concurrency support.") >> version "/jemalloc-" version ".tar.bz2")) >> (sha256 >> (base32 >> - "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl")))) >> - (inputs '()))) >> + "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl")))) >> + (arguments >> + (substitute-keyword-arguments (package-arguments jemalloc-base) >> + ;; Disable the thread local storage model in jemalloc 5 to prevent >> + ;; shared libraries linked to libjemalloc from crashing on dlopen() >> + ;; https://github.com/jemalloc/jemalloc/issues/937 >> + ((#:configure-flags base-configure-flags '()) >> + `(cons "--disable-initial-exec-tls" ,base-configure-flags)))) >> + (inputs `(("perl" ,perl))))) >> From 8b97b60ab78ba1e616efaf477e629cfa2457b1a9 Mon Sep 17 00:00:00 2001 From: Ryan Sundberg Date: Fri, 29 Jan 2021 21:18:56 -0800 Subject: [PATCH] gnu: jemalloc: --disable-initial-exec-tls Disable the thread local storage model in jemalloc 5 to prevent shared libraries linked to libjemalloc from crashing on dlopen(). https://github.com/jemalloc/jemalloc/issues/937 This bug affects both Java JNI and python libraries which link to jemalloc 5, such as RocksDB, which will crash the program when loaded. * gnu/packages/jemalloc.scm (jemalloc)[arguments]: Add --disable-initial-exec-tls configure flag. --- gnu/packages/jemalloc.scm | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/gnu/packages/jemalloc.scm b/gnu/packages/jemalloc.scm index c4b87b540d..d93cf41081 100644 --- a/gnu/packages/jemalloc.scm +++ b/gnu/packages/jemalloc.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2015 Sou Bunnbu ;;; Copyright © 2017 Efraim Flashner ;;; Copyright © 2017 Eric Bavier +;;; Copyright © 2021 Ryan Sundberg ;;; ;;; This file is part of GNU Guix. ;;; @@ -29,10 +30,10 @@ #:use-module (gnu packages perl) #:use-module (guix build-system gnu)) -(define-public jemalloc +(define jemalloc-4.5.0 (package (name "jemalloc") - (version "5.2.1") + (version "4.5.0") (source (origin (method url-fetch) (uri (string-append @@ -40,7 +41,7 @@ version "/jemalloc-" version ".tar.bz2")) (sha256 (base32 - "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl")))) + "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl")))) (build-system gnu-build-system) (arguments `(#:phases @@ -58,7 +59,7 @@ ;; Transparent huge pages are only enabled by default on Intel processors '() '(#:configure-flags (list "--disable-thp"))))) - (inputs `(("perl" ,perl))) + (inputs '()) ;; Install the scripts to a separate output to avoid referencing Perl and ;; Bash in the default output, saving ~75 MiB on the closure. (outputs '("out" "bin")) @@ -69,10 +70,10 @@ fragmentation avoidance and scalable concurrency support.") (license bsd-2))) -(define-public jemalloc-4.5.0 +(define-public jemalloc (package - (inherit jemalloc) - (version "4.5.0") + (inherit jemalloc-4.5.0) + (version "5.2.1") (source (origin (method url-fetch) (uri (string-append @@ -80,5 +81,12 @@ fragmentation avoidance and scalable concurrency support.") version "/jemalloc-" version ".tar.bz2")) (sha256 (base32 - "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl")))) - (inputs '()))) + "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl")))) + (arguments + (substitute-keyword-arguments (package-arguments jemalloc-4.5.0) + ;; Disable the thread local storage model in jemalloc 5 to prevent + ;; shared libraries linked to libjemalloc from crashing on dlopen() + ;; https://github.com/jemalloc/jemalloc/issues/937 + ((#:configure-flags base-configure-flags '()) + `(cons "--disable-initial-exec-tls" ,base-configure-flags)))) + (inputs `(("perl" ,perl))))) -- 2.31.1