[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080104125420.GA20981@elte.hu>
Date: Fri, 4 Jan 2008 13:54:20 +0100
From: Ingo Molnar <mingo@...e.hu>
To: Török Edwin <edwintorok@...il.com>
Cc: "Zhang, Yanmin" <yanmin_zhang@...ux.intel.com>,
LKML <linux-kernel@...r.kernel.org>,
Arjan van de Ven <arjan@...radead.org>
Subject: Re: Improve hackbench
* Török Edwin <edwintorok@...il.com> wrote:
> On x86-64 there's a bug [*], that causes hackbench to segfault when
> compiled with optimizations:
> in reap_worker():
> int status;
> ...
> pthread_join(id, (void **)(void *)&status);
>
> That is not correct, sizeof(void*) > sizeof(int) on x86-64.
> Something gets overwritten on the stack, I tried with gcc
> -fstack-protector, but it doesn't detect it !?
> After applying the patch, it no longer segfaults.
>
> This patch fixes it:
> --- hackbench.c 2008-01-04 10:08:26.000000000 +0200
> +++ ../hackbench.c 2008-01-04 13:45:22.000000000 +0200
> @@ -241,8 +241,10 @@
> wait(&status);
> if (!WIFEXITED(status))
> exit(1);
> - } else
> - pthread_join(id, (void **)(void *)&status);
> + } else {
> + void* status;
> + pthread_join(id, (void **)&status);
> + }
> }
thanks, applied & updated the file.
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists