Package: release.debian.org Severity: normal User: release.debian....@packages.debian.org Usertags: pu
Hello, to fix bug #711363 (rt-tests: hackbench does not work in stable on armhf) in rt-tests for wheezy I intend to (let my sponsor) upload version 0.83-1+deb7u1 with the attached changes. The bug is fixed by a patch cherry-picked from upstream that asserts that a union is properly initialized to zero. Best regards Uwe
diff -Nru rt-tests-0.83/debian/changelog rt-tests-0.83/debian/changelog --- rt-tests-0.83/debian/changelog 2011-12-02 10:40:15.000000000 +0100 +++ rt-tests-0.83/debian/changelog 2013-06-26 21:03:07.000000000 +0200 @@ -1,3 +1,11 @@ +rt-tests (0.83-1+deb7u1) wheezy; urgency=low + + * backport + dd6ae11 (hackbench: init child's struct before using it) + to make hackbench work on armhf. (Closes: #711363) + + -- Uwe Kleine-König <u.kleine-koe...@pengutronix.de> Wed, 26 Jun 2013 20:32:10 +0200 + rt-tests (0.83-1) unstable; urgency=low * new upstream release diff -Nru rt-tests-0.83/debian/patches/hackbench-init-child-s-struct-before-using-it.patch rt-tests-0.83/debian/patches/hackbench-init-child-s-struct-before-using-it.patch --- rt-tests-0.83/debian/patches/hackbench-init-child-s-struct-before-using-it.patch 1970-01-01 01:00:00.000000000 +0100 +++ rt-tests-0.83/debian/patches/hackbench-init-child-s-struct-before-using-it.patch 2013-06-26 21:00:13.000000000 +0200 @@ -0,0 +1,60 @@ +From dd6ae1155dc7fbee79426ae5952d48b4151c1cd7 Mon Sep 17 00:00:00 2001 +From: Sebastian Andrzej Siewior <bige...@linutronix.de> +Date: Thu, 11 Apr 2013 17:20:05 +0200 +Subject: [PATCH] hackbench: init child's struct before using it + +Commit ad27df7 ("Reimplement better child tracking and improve error +handling") changed the way of reporting pid/error after creating a +child. It will return an union which is a mix pid_t, pthread_t and a +signed long long for errors. +Now on 32bit x86 both pid_t and pthread_t are four byte in size and are +stored in the first 4 bytes. Now if the most significant bit of the long +long variable happens to be set by chance (because nobody really +initializes the variable here) then error variable will be negative. On +little endian machines the assignment of pid or threadid won't reset the +sign bit and you see this: + +| Running in process mode with 10 groups using 40 file descriptors each (== 400 tasks) +| Each sender will pass 100 messages of 100 bytes +| 0 children started. Expected 40 +| sending SIGTERM to all child processes +| signaling 0 worker threads to terminate +| Creating workers (error: Success) + +A machine with proper endian handlig (that is big endian) would reset +the sign bit during the assignment of pid and I would not have to make +this patch :) + +While here, I make create_worker() since it is not used outside of this +file. + +Cc: David Sommerseth <dav...@redhat.com> +Signed-off-by: Sebastian Andrzej Siewior <bige...@linutronix.de> +Signed-off-by: Clark Williams <clark.willi...@gmail.com> +--- + src/hackbench/hackbench.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/hackbench/hackbench.c b/src/hackbench/hackbench.c +index 8baeb23..c21b4db 100644 +--- a/src/hackbench/hackbench.c ++++ b/src/hackbench/hackbench.c +@@ -189,13 +189,14 @@ again: + return NULL; + } + +-childinfo_t create_worker(void *ctx, void *(*func)(void *)) ++static childinfo_t create_worker(void *ctx, void *(*func)(void *)) + { + pthread_attr_t attr; + int err; + childinfo_t child; + pid_t childpid; + ++ memset(&child, 0, sizeof(child)); + switch (process_mode) { + case PROCESS_MODE: /* process mode */ + /* Fork the sender/receiver child. */ +-- +1.8.2.1 + diff -Nru rt-tests-0.83/debian/patches/series rt-tests-0.83/debian/patches/series --- rt-tests-0.83/debian/patches/series 2011-11-22 15:03:27.000000000 +0100 +++ rt-tests-0.83/debian/patches/series 2013-06-26 21:03:24.000000000 +0200 @@ -4,3 +4,4 @@ debian_has_recent_glibc fix_comment_about_realtime_group.patch backfire-fix-build-failure-for-modern-kernels.patch +hackbench-init-child-s-struct-before-using-it.patch