Accepting request 225537 from Base:System

- dd_rescue-fix_insn_probe.diff: Brings dd_rescue to 1.42.1,
  fixing the process' signal mask after SIGILL delivery (probing),
  an issue related to the longjmp() signal handler return fix
  to bnc#860779.
- Update to dd_rescue-1.42:
  * Addition of plugin interface
  * MD5 plugin
  * Use posix_fadvise() if available
  * Short usage message rather than full help on error
- Update to dd_rescue-1.41:
  * Support for building against Andoid NDK
  * Consistent use of (improved) int no formatting functions
  * Fix off-by-one block dev size issue (cosmetic)
  * Enable AVX2 optimized sparse block detection
  * Refactored CPU feature detection and selection
  * New option -u/--rmvtrim to delete output file and issue fstrim
- Remove suboptimal fix for bnc#860779, it's fixed properly
  upstream by returning with longjmp() from the signal handler. (forwarded request 225521 from garloff)

OBS-URL: https://build.opensuse.org/request/show/225537
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/dd_rescue?expand=0&rev=23
This commit is contained in:
Stephan Kulow 2014-03-16 07:04:53 +00:00 committed by Git OBS Bridge
commit 4c22cff7b8
5 changed files with 83 additions and 9 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:54545ebbe2be00597d8c9ba3d51abcfdd7ba89f17d51974629e612c2619730ff
size 47107

3
dd_rescue-1.42.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:740fc84b167bea4cecae3b22e0e87f11ef0e563710c7cd8c5bb79b1eebfcbd2f
size 69695

View File

@ -0,0 +1,51 @@
From: Kurt Garloff <kurt@garloff.de>
Subject: Need to restore sigprocmask when not returning from signal handler
I stumbled over the fine details of signal handling:
A second SIGILL would not have been delivered to the handler as it was
blocked when invoking the handler for the first time. As we can't return
from the handler, we need to restore the process' signal mask ourselves
and reenable delivery.
Signed-off-by: Kurt Garloff <kurt@garloff.de>
Index: find_nonzero.c
===================================================================
RCS file: /home/cvsroot/dd_rescue/find_nonzero.c,v
retrieving revision 1.44
retrieving revision 1.46
diff -u -p -r1.44 -r1.46
--- find_nonzero.c 21 Feb 2014 12:51:43 -0000 1.44
+++ find_nonzero.c 6 Mar 2014 12:14:18 -0000 1.46
@@ -24,6 +24,14 @@ static jmp_buf sigill_jmp;
static void ill_handler(int sig)
{
have_feature = 0;
+ /* As we can't return from handler (as it would result in
+ * reexecuting the illegal instruction again - we jump back
+ * using longjmp) -- we have to restore signal delivery, so the
+ * program context is back to normal. Otherwise a second
+ * probe_procedure would not handle SIGILL. */
+ sigset_t sigmask;
+ sigemptyset(&sigmask); sigaddset(&sigmask, sig);
+ sigprocmask(SIG_UNBLOCK, &sigmask, NULL);
longjmp(sigill_jmp, 1);
}
Index: archdep.h
===================================================================
RCS file: /home/cvsroot/dd_rescue/archdep.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -p -r1.6 -r1.7
--- archdep.h 25 Feb 2014 16:06:35 -0000 1.6
+++ archdep.h 6 Mar 2014 12:20:46 -0000 1.7
@@ -28,7 +28,7 @@ void probe_sse2();
#define have_avx2 0
#define have_sse42 0
#define ARCH_DETECT do {} while (0)
-#define ARCH_DECLS
+#define ARCH_DECLS ARCH_DECL_386
#elif defined(NO_AVX2) /* compiler does not support -mavx2 */
#define have_avx2 0
extern char have_sse42;

View File

@ -1,3 +1,25 @@
-------------------------------------------------------------------
Sat Mar 8 18:58:56 CET 2014 - kurt@garloff.de
- dd_rescue-fix_insn_probe.diff: Brings dd_rescue to 1.42.1,
fixing the process' signal mask after SIGILL delivery (probing),
an issue related to the longjmp() signal handler return fix
to bnc#860779.
- Update to dd_rescue-1.42:
* Addition of plugin interface
* MD5 plugin
* Use posix_fadvise() if available
* Short usage message rather than full help on error
- Update to dd_rescue-1.41:
* Support for building against Andoid NDK
* Consistent use of (improved) int no formatting functions
* Fix off-by-one block dev size issue (cosmetic)
* Enable AVX2 optimized sparse block detection
* Refactored CPU feature detection and selection
* New option -u/--rmvtrim to delete output file and issue fstrim
- Remove suboptimal fix for bnc#860779, it's fixed properly
upstream by returning with longjmp() from the signal handler.
-------------------------------------------------------------------
Tue Feb 11 14:00:38 UTC 2014 - bwiedemann@suse.com

View File

@ -17,16 +17,19 @@
Name: dd_rescue
Version: 1.40
Version: 1.42
Release: 0
Summary: Data Copying in the Presence of I/O Errors
License: GPL-2.0 or GPL-3.0
Group: System/Base
Url: http://www.garloff.de/kurt/linux/ddrescue/
Source0: http://garloff.de/kurt/linux/ddrescue/%{name}-%{version}.tar.gz
Patch0: dd_rescue-fix_insn_probe.diff
BuildRequires: autoconf
BuildRequires: libattr-devel
%if 0%{?suse_version} >= 1200
BuildRequires: libfallocate-devel
%endif
Requires: bc
Recommends: dd_rhelp libfallocate0
# ddrescue was last used in openSUSE 11.4 (version 1.14_0.0.6)
@ -46,6 +49,7 @@ with fallocate(); random number writing etc.
%prep
%setup -q -n dd_rescue
%patch0 -p0
# Remove build time references so build-compare can do its work
FAKE_BUILDTIME=$(LC_ALL=C date -u -r %{_sourcedir}/%{name}.changes '+%%H:%%M')
@ -55,14 +59,10 @@ sed -i "s/__DATE__/\"$FAKE_BUILDDATE\"/g" dd_rescue.c
%build
flags="%{optflags}"
%ifarch i386 i486 i586 i686
sed -i 's/SSE = "-msse2"/SSE = "-DNO_SSE2"/' Makefile
flags="%{optflags} -DNO_SSE2"
%endif
make RPM_OPT_FLAGS="$flags" LIBDIR=%{_libdir} %{?_smp_mflags}
%install
make install DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}/%{_bindir} \
make install DESTDIR=%{buildroot} INSTALLDIR=%{buildroot}/%{_bindir} LIBDIR=%{_libdir} \
INSTASROOT= INSTALLFLAGS=
#UsrMerge
@ -80,6 +80,7 @@ make check
#UsrMerge
/bin/dd_rescue
#EndUsrMerge
%{_libdir}/libddr_MD5.so
%doc %{_mandir}/man1/dd_rescue.1%{ext_man}
%changelog