[PATCH core-updates] gnu: jemalloc: --disable-initial-exec-tls

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Ryan Sundberg
Owner
unassigned
Submitted by
Ryan Sundberg
Severity
normal
R
R
Ryan Sundberg wrote on 22 Jun 2021 07:44
(address . guix-patches@gnu.org)(name . Ryan Sundberg)(address . ryan@arctype.co)
20210622054423.31851-1-ryan@arctype.co
Disable the thread local storage model in jemalloc 5 to prevent
shared libraries linked to libjemalloc from crashing on dlopen().

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(-)

Toggle diff (74 lines)
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 <iyzsong@gmail.com>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
;;;
;;; 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)))))
--
2.31.1
R
R
Ryan Sundberg wrote on 22 Jun 2021 07:52
(address . 49167@debbugs.gnu.org)
b44eecd3-a5b9-140e-ee94-30cdfd743697@arctype.co
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:
Toggle quote (86 lines)
> 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 <iyzsong@gmail.com>
> ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
> ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
> +;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
> ;;;
> ;;; 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 a0f9f8206613efa659922f5164414832119a4d33 Mon Sep 17 00:00:00 2001
From: Ryan Sundberg <ryan@arctype.co>
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().

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(-)

Toggle diff (74 lines)
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 <iyzsong@gmail.com>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
;;;
;;; 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)))))
--
2.31.1
Attachment: OpenPGP_signature
R
R
Ryan Sundberg wrote on 22 Jun 2021 07:58
(address . 49167@debbugs.gnu.org)
bfa98853-d450-8d6b-1ace-2f88335af50d@arctype.co
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:
Toggle quote (95 lines)
> 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 <iyzsong@gmail.com>
>> ;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
>> ;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
>> +;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
>> ;;;
>> ;;; 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 <ryan@arctype.co>
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().

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(-)

Toggle diff (74 lines)
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 <iyzsong@gmail.com>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
+;;; Copyright © 2021 Ryan Sundberg <ryan@arctype.co>
;;;
;;; 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
Attachment: OpenPGP_signature
L
L
Ludovic Courtès wrote on 3 Sep 2021 12:06
Re: bug#49167: [PATCH core-updates] gnu: jemalloc: --disable-initial-exec-tls
(name . Ryan Sundberg)(address . ryan@arctype.co)(address . 49167-done@debbugs.gnu.org)
87k0jy2cta.fsf_-_@gnu.org
Hi Ryan,

Ryan Sundberg <ryan@arctype.co> skribis:

Toggle quote (15 lines)
> From 8b97b60ab78ba1e616efaf477e629cfa2457b1a9 Mon Sep 17 00:00:00 2001
> From: Ryan Sundberg <ryan@arctype.co>
> 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.

It took a long while, but it’s now in ‘core-updates-frozen’ as
68dd6d809398297dc2ebef522186c9b9f2566739 (with minor tweaks so it would
apply and so that ‘jemalloc-4.5.0’ remains public.)

Thanks!

Ludo’.
Closed
R
R
Ryan Sundberg wrote on 5 Sep 2021 01:40
Re: bug#49167: closed (Re: bug#49167: [PATCH core-updates] gnu: jemalloc: --disable-initial-exec-tls)
(address . 49167@debbugs.gnu.org)
a887b1b3-93b6-fa70-9d70-234d7dc2c2c6@arctype.co
Awesome. Thanks Ludo. This will unblock the rocksdb-java package I've
been sitting on.

--
Sincerely,
Ryan Sundberg

On 9/3/21 3:07 AM, GNU bug Tracking System wrote:
Toggle quote (9 lines)
> Your bug report
>
> #49167: [PATCH core-updates] gnu: jemalloc: --disable-initial-exec-tls
>
> which was filed against the guix-patches package, has been closed.
>
> The explanation is attached below, along with your original report.
> If you require more details, please reply to 49167@debbugs.gnu.org.
>
Attachment: OpenPGP_signature
?