From owner-freebsd-hackers@FreeBSD.ORG Thu Apr 24 06:13:21 2014 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 80ABAF4A; Thu, 24 Apr 2014 06:13:21 +0000 (UTC) Received: from mail-la0-x22c.google.com (mail-la0-x22c.google.com [IPv6:2a00:1450:4010:c03::22c]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D0D1D1AD8; Thu, 24 Apr 2014 06:13:20 +0000 (UTC) Received: by mail-la0-f44.google.com with SMTP id b8so1637567lan.17 for ; Wed, 23 Apr 2014 23:13:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=1ZjVSvQ3R4LTvr8uTdRgpVv/Anu89LPsw5774C8lorI=; b=EZv1s6U6CBF+j9AihqkTx3c6HuhTOZNNozh9EovXZbM655yKE5Y03/s+SM8VpOrerN x0OO1moxej98anlOUxGgsxyQJoWz271Kw68455l/JXVbk4ZVBdIox3BmLVU09IonpIoC RgPI2gBWDFmDrqNcvcOlKWU1DqzdJqcVVBLMQ64bx74J0F7SQ0DT9ijQhfHJ+wndd2TU 3Jk/bMvWdRcE38UrSIvA9KcugllzuRmywScFB8KpuGWs3wL0CF+23l4trt3zuh+byDW6 g6tWuCAyxb9APoK/ks9J3jCDAeFuuYpvFAbtzxAxFCdecgVeYF5JjQXuua2UmHwYKFg8 P9qg== X-Received: by 10.153.7.69 with SMTP id da5mr598737lad.38.1398319998748; Wed, 23 Apr 2014 23:13:18 -0700 (PDT) Received: from localhost ([188.230.122.226]) by mx.google.com with ESMTPSA id cr6sm3427660lbb.19.2014.04.23.23.13.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 Apr 2014 23:13:18 -0700 (PDT) Date: Thu, 24 Apr 2014 09:13:15 +0300 From: Mikolaj Golub To: Benjamin Kaduk Subject: Re: valgrind on amd64 crashes when delivering signal for threaded application Message-ID: <20140424061314.GA10637@gmail.com> References: <20140423200135.GA6009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Cc: Stanislav Sedov , freebsd-hackers@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 06:13:21 -0000 On Wed, Apr 23, 2014 at 11:28:25PM -0400, Benjamin Kaduk wrote: > I would expect that the fact that this patch fixes the observed crash > means that valgrind has a bug when setting up the stack for the signal > handler. I had to work around an apparently similar bug in the built-in > lightweight thread implementation in net/openafs by forcing > -mstack-realign to be used for its compilation (because analyzing the > lightweight threads implementation when upstream is trying to switch to > pthreads is not worth the effort). I guess here the thing to try would be > compiling libthr with -mstack-realign, not that that is a reasonable thing > to do in head. Yes, compilng thr_sig.c with -mstackrealign helps too. I see force_align_arg_pointer attribute mentioned in gcc manuals, which should do the same per function, but get "unknown attribute 'force_align_arg_pointer' ignored" error when trying to declare thr_sighandler() with it. > Perhaps the valgrind upstream should be asked about the > details of the stack creation? I am not sure who I should ask. It looks the ustream does not support freebsd. -- Mikolaj Golub