From 182b1b496f7535bee46bba54544fa3e567be2beb Mon Sep 17 00:00:00 2001 From: Amy Liffey Date: Mon, 27 Nov 2017 13:44:50 +0100 Subject: dev-scheme/guile: fix ia64 segmentation fault Closes: https://bugs.gentoo.org/613986 Package-Manager: Portage-2.3.13, Repoman-2.3.3 --- dev-scheme/guile/Manifest | 2 +- ...0.14-ia64-fix-crash-thread-context-switch.patch | 63 ++++++++++++++++ dev-scheme/guile/guile-2.0.14-r2.ebuild | 85 --------------------- dev-scheme/guile/guile-2.0.14-r3.ebuild | 86 ++++++++++++++++++++++ 4 files changed, 150 insertions(+), 86 deletions(-) create mode 100644 dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch delete mode 100644 dev-scheme/guile/guile-2.0.14-r2.ebuild create mode 100644 dev-scheme/guile/guile-2.0.14-r3.ebuild (limited to 'dev-scheme/guile') diff --git a/dev-scheme/guile/Manifest b/dev-scheme/guile/Manifest index de6ab3b87ea6..91a787d19b7f 100644 --- a/dev-scheme/guile/Manifest +++ b/dev-scheme/guile/Manifest @@ -1,3 +1,3 @@ DIST guile-1.8.8.tar.gz 3956654 SHA256 c3471fed2e72e5b04ad133bbaaf16369e8360283679bcf19800bc1b381024050 SHA512 ede6feb90cd419d8763feb8c5169275490a653919573c4dfced025b74cf591072b3a10ffb9a3f6ee3fe7b0a0956ffcf434e0859b421455c8349cea56bf427db0 WHIRLPOOL 104810030b5dae16805595a5b398e5a7e600771b64b08d5ff686036e2f273dcec3829a16e4cdb1dbb9db5813f2e225476f83e0535a789bc570fc2fc15a76dbe2 DIST guile-2.0.13.tar.gz 7808173 SHA256 ee8073c4582bb4f06412452fdf5dd185aae607441f1313c824f44bdd668b0bde SHA512 79fd5fda5064331eb687934ec3eaf07943f5b23bd05fbce23ab5ee3698864250b33746e33b8f074692b56f7b428dac42ed5d3f5b9dc17d171aa6dfadc1625b00 WHIRLPOOL 5f8b8e0f0e5fd2cde8fd4b1ca89ebe0231dd5f746945d71412a9d1ce57094013882972d9791511ef47e9bf1f2e9eff77a515dab8b4a6c0316122cb9ef49b5a7d -DIST guile-2.0.14.tar.gz 7823099 SHA256 8aeb2f353881282fe01694cce76bb72f7ffdd296a12c7a1a39255c27b0dfe5f1 SHA512 d69c9bdf589fedcc227f3203012f6ed11c327cef3a0147d8e016fe276abecdb4272625efe1d0c7aa68219fe8f29bbced44089a4b479e4eafe01976c6b2b83633 WHIRLPOOL 3b355f40b47c940bf9330a3521447efd2da7c7c9c3615c208513e36fec937c06a9f307fb2c59d652c09e6e0e13e858d7ef7949efbe32d530431a7aace3d9a165 +DIST guile-2.0.14.tar.gz 7823099 BLAKE2B e7fa5a4ca19dc4adfcc151350b0ed4e211b8470b0d12f65451697a818c3139a4a5992a019bd213114748230cb15ec755d1af70d42b901230854915c0ee7b05de SHA512 d69c9bdf589fedcc227f3203012f6ed11c327cef3a0147d8e016fe276abecdb4272625efe1d0c7aa68219fe8f29bbced44089a4b479e4eafe01976c6b2b83633 diff --git a/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch new file mode 100644 index 000000000000..c2f136ddd104 --- /dev/null +++ b/dev-scheme/guile/files/guile-2.0.14-ia64-fix-crash-thread-context-switch.patch @@ -0,0 +1,63 @@ +From f92888853439a8ded221f3423865c78de2a96a14 Mon Sep 17 00:00:00 2001 +From: Sergei Trofimovich +Date: Sun, 5 Nov 2017 09:30:45 +0000 +Subject: ia64: Fix crash in thread context switch. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes and . + +Backtrace looks like that: + + Program terminated with signal SIGSEGV, Segmentation fault. + #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372 + 372 t->pending_rbs_continuation->backing_store, + [Current thread is 1 (Thread 0x2000000000049340 (LWP 8190))] + (gdb) bt + #0 0x200000000014a5c0 in scm_ia64_longjmp (JB=0x6000000000817020, VAL=1) at continuations.c:372 + #1 0x2000000000148e00 in scm_c_abort (vm=0x60000000000edea0, tag=0x6000000000795ba0, n=0, argv=0x60000fffff7f0ce0, cookie=-1) at control.c:239 + #2 0x2000000000149070 in scm_at_abort (tag=0x6000000000795ba0, args=0x304) at control.c:258 + (gdb) print t + $2 = (scm_i_thread *) 0x6000000000068000 + (gdb) print t->pending_rbs_continuation + $3 = (scm_t_contregs *) 0xffeb + +The problem here is the value of 't->pending_rbs_continuation' pointer. +It's supposed to poin to a register stack pointer or be NULL if not yet +backed up. + +The problem is it is never initialized to NULL at creation time and +contained garbage on stack. Sometimes people are lucky and have zeros +on stack and guile works. But sometimes there is something and guile +crashes. + +The fix is trivial: initialize 'pending_rbs_continuation = NULL' +at thread registration time (the same way other threads are registered). + +Reported-by: Matt Turner + +* libguile/threads.c (guilify_self_1): Initialize pending_rbs_continuation +to avoid crash on ia64. + +Signed-off-by: Sergei Trofimovich +Signed-off-by: Ludovic Courtès +--- + libguile/threads.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libguile/threads.c b/libguile/threads.c +index 9ceb5b8..770f62c 100644 +--- a/libguile/threads.c ++++ b/libguile/threads.c +@@ -395,6 +395,7 @@ guilify_self_1 (struct GC_stack_base *base, int needs_unregister) + t.base = base->mem_base; + #ifdef __ia64__ + t.register_backing_store_base = base->reg_base; ++ t.pending_rbs_continuation = 0; + #endif + t.continuation_root = SCM_EOL; + t.continuation_base = t.base; +-- +cgit v1.0-41-gc330 + diff --git a/dev-scheme/guile/guile-2.0.14-r2.ebuild b/dev-scheme/guile/guile-2.0.14-r2.ebuild deleted file mode 100644 index 37a3cd3ede72..000000000000 --- a/dev-scheme/guile/guile-2.0.14-r2.ebuild +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright 1999-2017 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -EAPI=6 -inherit flag-o-matic autotools ltprune - -DESCRIPTION="GNU Ubiquitous Intelligent Language for Extensions" -HOMEPAGE="https://www.gnu.org/software/guile/" -SRC_URI="mirror://gnu/guile/${P}.tar.gz" -KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" -LICENSE="LGPL-3+" -IUSE="debug debug-malloc +deprecated +networking +nls +regex +threads" # upstream recommended +networking +nls -# emacs useflag removal not working - -# workaround for bug 596322 -REQUIRED_USE="regex" - -RDEPEND=" - >=dev-libs/boehm-gc-7.0[threads?] - dev-libs/gmp:= - virtual/libffi - dev-libs/libltdl:= - dev-libs/libunistring:0= - sys-devel/libtool - sys-libs/ncurses:0= - sys-libs/readline:0=" -DEPEND="${RDEPEND} - virtual/pkgconfig - sys-apps/texinfo - sys-devel/gettext" - -SLOT="12/22" # subslot is soname version -MAJOR="2.0" - -DOCS=( GUILE-VERSION HACKING README ) - -PATCHES=( - "${FILESDIR}/${PN}-2-snarf.patch" - "${FILESDIR}/${P}-darwin.patch" -) - -src_prepare() { - default - eautoreconf -} - -src_configure() { - # see bug #178499 - filter-flags -ftree-vectorize - - econf \ - --disable-error-on-warning \ - --disable-rpath \ - --disable-static \ - --enable-posix \ - --without-libgmp-prefix \ - --without-libiconv-prefix \ - --without-libintl-prefix \ - --without-libltdl-prefix \ - --without-libreadline-prefix \ - --without-libunistring-prefix \ - $(use_enable debug guile-debug) \ - $(use_enable debug-malloc) \ - $(use_enable deprecated) \ - $(use_enable networking) \ - $(use_enable nls) \ - $(use_enable regex) \ - $(use_with threads) -} - -src_install() { - default - prune_libtool_files - - # From Novell - # https://bugzilla.novell.com/show_bug.cgi?id=874028#c0 - dodir /usr/share/gdb/auto-load/$(get_libdir) - mv "${ED}"/usr/$(get_libdir)/libguile-*-gdb.scm "${ED}"/usr/share/gdb/auto-load/$(get_libdir) || die - - # necessary for registering slib, see bug 206896 - keepdir /usr/share/guile/site - - # Dark magic necessary for some deps - dosym libguile-2.0.so /usr/$(get_libdir)/libguile.so -} diff --git a/dev-scheme/guile/guile-2.0.14-r3.ebuild b/dev-scheme/guile/guile-2.0.14-r3.ebuild new file mode 100644 index 000000000000..56165f81bcb4 --- /dev/null +++ b/dev-scheme/guile/guile-2.0.14-r3.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 +inherit flag-o-matic autotools ltprune + +DESCRIPTION="GNU Ubiquitous Intelligent Language for Extensions" +HOMEPAGE="https://www.gnu.org/software/guile/" +SRC_URI="mirror://gnu/guile/${P}.tar.gz" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +LICENSE="LGPL-3+" +IUSE="debug debug-malloc +deprecated +networking +nls +regex +threads" # upstream recommended +networking +nls +# emacs useflag removal not working + +# workaround for bug 596322 +REQUIRED_USE="regex" + +RDEPEND=" + >=dev-libs/boehm-gc-7.0[threads?] + dev-libs/gmp:= + virtual/libffi + dev-libs/libltdl:= + dev-libs/libunistring:0= + sys-devel/libtool + sys-libs/ncurses:0= + sys-libs/readline:0=" +DEPEND="${RDEPEND} + virtual/pkgconfig + sys-apps/texinfo + sys-devel/gettext" + +SLOT="12/22" # subslot is soname version +MAJOR="2.0" + +DOCS=( GUILE-VERSION HACKING README ) + +PATCHES=( + "${FILESDIR}/${PN}-2-snarf.patch" + "${FILESDIR}/${P}-darwin.patch" + "${FILESDIR}/${P}-ia64-fix-crash-thread-context-switch.patch" +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + # see bug #178499 + filter-flags -ftree-vectorize + + econf \ + --disable-error-on-warning \ + --disable-rpath \ + --disable-static \ + --enable-posix \ + --without-libgmp-prefix \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --without-libltdl-prefix \ + --without-libreadline-prefix \ + --without-libunistring-prefix \ + $(use_enable debug guile-debug) \ + $(use_enable debug-malloc) \ + $(use_enable deprecated) \ + $(use_enable networking) \ + $(use_enable nls) \ + $(use_enable regex) \ + $(use_with threads) +} + +src_install() { + default + prune_libtool_files + + # From Novell + # https://bugzilla.novell.com/show_bug.cgi?id=874028#c0 + dodir /usr/share/gdb/auto-load/$(get_libdir) + mv "${ED}"/usr/$(get_libdir)/libguile-*-gdb.scm "${ED}"/usr/share/gdb/auto-load/$(get_libdir) || die + + # necessary for registering slib, see bug 206896 + keepdir /usr/share/guile/site + + # Dark magic necessary for some deps + dosym libguile-2.0.so /usr/$(get_libdir)/libguile.so +} -- cgit v1.2.3-65-gdbad