Update to 9.2.0

This commit is contained in:
Josh Stone 2016-06-30 12:09:18 -07:00
parent 2dcffbf04a
commit 2203ddef7e
5 changed files with 17 additions and 77 deletions

2
.gitignore vendored
View File

@ -11,3 +11,5 @@
/Testsuite-9.0.3.tgz /Testsuite-9.0.3.tgz
/DyninstAPI-9.1.0.tgz /DyninstAPI-9.1.0.tgz
/Testsuite-9.1.0.tgz /Testsuite-9.1.0.tgz
/dyninst-9.2.0.tar.gz
/Testsuite-9.2.0.zip

View File

@ -1,11 +0,0 @@
diff -up DyninstAPI-9.1.0/dyninstAPI_RT/h/dyninstRTExport.h.export DyninstAPI-9.1.0/dyninstAPI_RT/h/dyninstRTExport.h
--- DyninstAPI-9.1.0/dyninstAPI_RT/h/dyninstRTExport.h.export 2016-03-09 12:53:59.440594409 -0500
+++ DyninstAPI-9.1.0/dyninstAPI_RT/h/dyninstRTExport.h 2016-03-09 12:54:58.334974970 -0500
@@ -116,6 +116,7 @@ DLLEXPORT extern dyntid_t (*DYNINST_pthr
DLLEXPORT extern unsigned int DYNINSTobsCostLow;
DLLEXPORT extern int libdyninstAPI_RT_init_localCause;
DLLEXPORT extern int libdyninstAPI_RT_init_localPid;
+DLLEXPORT extern int libdyninstAPI_RT_init_maxthreads;
DLLEXPORT extern int libdyninstAPI_RT_init_debug_flag;
DLLEXPORT extern struct DYNINST_bootstrapStruct DYNINST_bootstrap_info;

View File

@ -1,51 +0,0 @@
From c4dca1b9bca83b180138dfa4d7e5a65736cccb31 Mon Sep 17 00:00:00 2001
From: Josh Stone <jistone@redhat.com>
Date: Tue, 21 Jun 2016 16:06:09 -0700
Subject: [PATCH] RTlib: use static TLS for the tramp guard (#99)
With dynamic TLS, the call to __tls_get_addr() could reach additional
instrumented code, infinitely recursing back to check the tramp guard.
Static TLS is a limited resource, but this case in RTlib is special
enough to warrant it for safety alone, nevermind performance.
(cherry picked from commit 73cd0019856eca0636e652e402f9eaed6ba9dc61)
Make the tramp guard bigger to avoid a glibc bug.
Having just one byte of TLS induces glibc bug 14898 with the definition
of FORCED_DYNAMIC_TLS_OFFSET. Bumping to two bytes avoids this.
Fixes #101
(cherry picked from commit d1b4334e13e7cc4a3ee52a34c9d3f63ebff129b2)
---
dyninstAPI_RT/src/RTcommon.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/dyninstAPI_RT/src/RTcommon.c b/dyninstAPI_RT/src/RTcommon.c
index ab125ff63f0e..f91ff12c943c 100644
--- a/dyninstAPI_RT/src/RTcommon.c
+++ b/dyninstAPI_RT/src/RTcommon.c
@@ -117,10 +117,17 @@ int fakeTickCount;
#if defined(_MSC_VER)
#define TLS_VAR __declspec(thread)
#else
-#define TLS_VAR __thread
+// Note, the initial-exec model gives us static TLS which can be accessed
+// directly, unlike dynamic TLS that calls __tls_get_addr(). Such calls risk
+// recursing back to us if they're also instrumented, ad infinitum. Static TLS
+// must be used very sparingly though, because it is a limited resource.
+// *** This case is very special -- do not use IE in general libraries! ***
+#define TLS_VAR __thread __attribute__ ((tls_model("initial-exec")))
#endif
-TLS_VAR int DYNINST_tls_tramp_guard = 1;
+// It's tempting to make this a char, but glibc < 2.17 hits a bug:
+// https://sourceware.org/bugzilla/show_bug.cgi?id=14898
+static TLS_VAR short DYNINST_tls_tramp_guard = 1;
DLLEXPORT int DYNINST_lock_tramp_guard()
{
--
2.7.4

View File

@ -2,21 +2,20 @@ Summary: An API for Run-time Code Generation
License: LGPLv2+ License: LGPLv2+
Name: dyninst Name: dyninst
Group: Development/Libraries Group: Development/Libraries
Release: 5%{?dist} Release: 1%{?dist}
URL: http://www.dyninst.org URL: http://www.dyninst.org
Version: 9.1.0 Version: 9.2.0
Exclusiveos: linux Exclusiveos: linux
#dyninst only knows the following architectures #dyninst only knows the following architectures
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ExclusiveArch: %{ix86} x86_64 ppc ppc64
Source0: http://www.paradyn.org/release%{version}/DyninstAPI-%{version}.tgz Source0: https://github.com/dyninst/dyninst/archive/v9.2.0.tar.gz#/%{name}-%{version}.tar.gz
Source1: http://www.paradyn.org/release%{version}/Testsuite-%{version}.tgz Source1: https://github.com/dyninst/dyninst/releases/download/v9.2.0/Testsuite-9.2.0.zip
Patch1: dyninst-export.patch
Patch2: dyninst-static-tls.patch
%global dyninst_base DyninstAPI-%{version} %global dyninst_base dyninst-%{version}
%global testsuite_base Testsuite-%{version} %global testsuite_base testsuite-master
BuildRequires: gcc-c++
BuildRequires: libdwarf-devel >= 20111030 BuildRequires: libdwarf-devel >= 20111030
BuildRequires: elfutils-libelf-devel BuildRequires: elfutils-libelf-devel
BuildRequires: boost-devel BuildRequires: boost-devel
@ -83,9 +82,6 @@ making sure that dyninst works properly.
%setup -q -n %{name}-%{version} -c %setup -q -n %{name}-%{version} -c
%setup -q -T -D -a 1 %setup -q -T -D -a 1
%patch1 -p0 -b .export
%patch2 -d %{dyninst_base} -p1 -b .static-tls
%build %build
cd %{dyninst_base} cd %{dyninst_base}
@ -147,6 +143,7 @@ find %{buildroot}%{_libdir}/dyninst/testsuite/ \
%config(noreplace) /etc/ld.so.conf.d/* %config(noreplace) /etc/ld.so.conf.d/*
%files doc %files doc
%doc %{dyninst_base}/dataflowAPI/doc/dataflowAPI.pdf
%doc %{dyninst_base}/dynC_API/doc/dynC_API.pdf %doc %{dyninst_base}/dynC_API/doc/dynC_API.pdf
%doc %{dyninst_base}/dyninstAPI/doc/dyninstAPI.pdf %doc %{dyninst_base}/dyninstAPI/doc/dyninstAPI.pdf
%doc %{dyninst_base}/instructionAPI/doc/instructionAPI.pdf %doc %{dyninst_base}/instructionAPI/doc/instructionAPI.pdf
@ -166,13 +163,16 @@ find %{buildroot}%{_libdir}/dyninst/testsuite/ \
%{_libdir}/dyninst/*.a %{_libdir}/dyninst/*.a
%files testsuite %files testsuite
#{_bindir}/parseThat %{_bindir}/parseThat
%dir %{_libdir}/dyninst/testsuite/ %dir %{_libdir}/dyninst/testsuite/
# Restore the permissions that were hacked out above, during install. # Restore the permissions that were hacked out above, during install.
%attr(755,root,root) %{_libdir}/dyninst/testsuite/* %attr(755,root,root) %{_libdir}/dyninst/testsuite/*[!a]
%attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a %attr(644,root,root) %{_libdir}/dyninst/testsuite/*.a
%changelog %changelog
* Thu Jun 30 2016 Josh Stone <jistone@redhat.com> - 9.2.0-1
- Update to 9.2.0
* Tue Jun 21 2016 Josh Stone <jistone@redhat.com> - 9.1.0-5 * Tue Jun 21 2016 Josh Stone <jistone@redhat.com> - 9.1.0-5
- Use static TLS for libdyninstAPI_RT.so - Use static TLS for libdyninstAPI_RT.so

View File

@ -1,2 +1,2 @@
5c64b77521457199db44bec82e4988ac DyninstAPI-9.1.0.tgz ad023f85e8e57837ed9de073b59d6bab dyninst-9.2.0.tar.gz
0b62cd97facd4bf20a42095731091093 Testsuite-9.1.0.tgz df8173412a7123f8a47b47e50eabc35b Testsuite-9.2.0.zip