From owner-freebsd-hackers@freebsd.org Fri Mar 17 06:30:54 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B11A2D1056A for ; Fri, 17 Mar 2017 06:30:54 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from mail-wm0-x229.google.com (mail-wm0-x229.google.com [IPv6:2a00:1450:400c:c09::229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4A0FB1D33 for ; Fri, 17 Mar 2017 06:30:54 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: by mail-wm0-x229.google.com with SMTP id u132so7881360wmg.0 for ; Thu, 16 Mar 2017 23:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to; bh=SayUz3kC5ZCZVz0f8q9zHfUCcxKBkc0BDCf3ktvnywA=; b=b23VEKzBuE43xySfO9lWtGgvN3Xjv5hUQjHe3Rj3NLpdPffT7Of/FWCrX0/PDf5dil b5Xu360TrBuIcbKKREWXlaQxib7CWt+vFXmjnqErtoER0J9bjBHTIT1A+gtAWpwImgUm 2qdaawmbIutf7fiGwLiKYtfQZeGz8q0fF28cnCQ04ooU1WH0LUjBBarE/1WHdFdZHH4v s7qDwUrCCbDey+Mkp6gU7QARVv5miy3grEI0nZt7q4QQoUOpuIZZHdn7/xHBD/Oin8J4 6j1lv2rghyy55SoQ+CMI0oLnn76zBYBtWkP0aBdeO9lfhHji3SRbWmQChXJjdia4K53g IuXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to; bh=SayUz3kC5ZCZVz0f8q9zHfUCcxKBkc0BDCf3ktvnywA=; b=nkRqaZDiT5VzkdNtkv+y+hJuGWVjdponkJSOispheio2qIbq2SJl5VuAec7u67bdf1 E+c4SvmSlTeayp8Ljv8IehDclkY0zOkZ55TP+9vke0VLg17R+f3/J5wXsd3hy5BiHgOE M8E4McIgpQswrXAG2OmRltCo6445uqZBqnjNDQ64UL87PiTMppLtZ0dRathSpc3weqrz jwq5s6d6Flc4csiTXSzLMjGw26m0/Tm7jA+6ynu1QXGUclJFJX60hRuYTQMvNFc5y9Z8 rQey3mS22Sz0uNhuVsNTAkkFWXwiDxeFQN16CYkR+fLkVqvnRxFDPQ8A98LTi98F2a3f m7NA== X-Gm-Message-State: AFeK/H0BE2Vav2QU5/uhDzr9vK4Ym/Auo8U94K24njAlcqxjoKlEef5PvzuC2UWnnzPZyFFB X-Received: by 10.28.8.147 with SMTP id 141mr1220818wmi.43.1489732252465; Thu, 16 Mar 2017 23:30:52 -0700 (PDT) Received: from [10.10.1.58] ([185.97.61.26]) by smtp.gmail.com with ESMTPSA id q12sm1501502wmd.8.2017.03.16.23.30.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Mar 2017 23:30:51 -0700 (PDT) Subject: Re: Help needed to identify golang fork / memory corruption issue on FreeBSD To: "K. Macy" References: <27e1a828-5cd9-0755-50ca-d7143e7df117@multiplay.co.uk> <20161206125919.GQ54029@kib.kiev.ua> <8b502580-4d2d-1e1f-9e05-61d46d5ac3b1@multiplay.co.uk> <20161206143532.GR54029@kib.kiev.ua> Cc: Konstantin Belousov , "freebsd-hackers@freebsd.org" From: Steven Hartland Message-ID: <18b40a69-4460-faf2-c0ce-7491eca92782@multiplay.co.uk> Date: Fri, 17 Mar 2017 06:30:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Mar 2017 06:30:54 -0000 Ok I think I've identified the cause. If an alternative signal stack is applied to a non-main thread and that thread calls execve then the signal stack is not cleared. This results in all sorts of badness. Full details, including a small C reproduction case can be found here: https://github.com/golang/go/issues/15658#issuecomment-287276856 So looks like its kernel bug. If anyone has an ideas about that before I look tomorrow that would be appreciated. Regards Steve