All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: "Török Edwin" <edwintorok@gmail.com>
Cc: "Zhang, Yanmin" <yanmin_zhang@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Arjan van de Ven <arjan@infradead.org>
Subject: Re: Improve hackbench
Date: Fri, 4 Jan 2008 13:54:20 +0100	[thread overview]
Message-ID: <20080104125420.GA20981@elte.hu> (raw)
In-Reply-To: <477E1DC3.5020803@gmail.com>


* Török Edwin <edwintorok@gmail.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

  reply	other threads:[~2008-01-04 13:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-04  6:06 Improve hackbench Zhang, Yanmin
2008-01-04  8:10 ` Ingo Molnar
2008-01-04 11:51   ` Török Edwin
2008-01-04 12:54     ` Ingo Molnar [this message]
2008-01-07  1:10     ` Zhang, Yanmin
2008-01-04 12:44   ` Lee Revell
2008-01-07  1:27     ` Zhang, Yanmin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080104125420.GA20981@elte.hu \
    --to=mingo@elte.hu \
    --cc=arjan@infradead.org \
    --cc=edwintorok@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yanmin_zhang@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.