From owner-freebsd-hackers@freebsd.org Tue Dec 6 12:31:20 2016 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 95933C6860E for ; Tue, 6 Dec 2016 12:31:20 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: from mail-wm0-x234.google.com (mail-wm0-x234.google.com [IPv6:2a00:1450:400c:c09::234]) (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 346D01CC6 for ; Tue, 6 Dec 2016 12:31:19 +0000 (UTC) (envelope-from killing@multiplay.co.uk) Received: by mail-wm0-x234.google.com with SMTP id t79so123737647wmt.0 for ; Tue, 06 Dec 2016 04:31:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version; bh=ZDn9acPamkluGcxMfiezGJ8mbYwT3+8y73ujnoDfoSo=; b=HTvhInjQgMdJlIxT1HuvMeEqtiK9SAysK8hgx5gw5QJxcApGDgmyAMkhaFDYbYaDF3 Rbz70TZv/0i6sX1GJylzS63hLxZTxhstxw9RONOXcQGuqAHImoH5hmEDdMdHCIg6B7n2 K2veRiuyCA2OHaU6+ElBzQeDsUgQVQF503YDhMfhH6y/EyyYT1zWkh2gDjFvq8IwdDyL GK3Ug6fU32zZfxt2DU1CpZqOc//sE2pq79EJS+bCbYkVGDACnxyJzBrlcXEfSg/4Zavl 2Fm+wkX8HOl+t8NYwXIlFmXmS0vuNg6Or8CgMBYGD+luu/nhMboarBdAIGa4ZiRldcjC NCnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=ZDn9acPamkluGcxMfiezGJ8mbYwT3+8y73ujnoDfoSo=; b=k+TJUReEZ8D4ac72548eOdzgBLKf9vOLKS2O9JOHZkVGFsIwKPUJ2wBIdTiIABh9EX w5mq95Ukw2AZr3JDjRE5jWjyaSRTUZmtLs8VMTdw4Qxd2zeTFZEIxfNkZ9epQxvTvagW sUUS49Zw155soUxgWpJV9KFgo6sfjn9jdRmT7j9RPT7xrgrTr/7WT2eISWXYob0QCZbp N5FAuCGVoCvFt5FRc6MOEbOapbm/RMx520fxQtpcTJOQYtxmbZs8YpEzGQ9e8S/npcRi ruM4bntffgFVF1OICe+zvWnel59KZPGNyRYXbmjGl3xplhGdDVemuKW9cq/Rrn9OlVIH 25YA== X-Gm-Message-State: AKaTC00RwPU3wzfiWW04Q97waytLbeYF2z/gMOPslKBZAU3X8bCrin/3BQM6qT9Kidli/9wK X-Received: by 10.28.73.136 with SMTP id w130mr2382269wma.82.1481027477714; Tue, 06 Dec 2016 04:31:17 -0800 (PST) Received: from [10.10.1.58] ([185.97.61.26]) by smtp.gmail.com with ESMTPSA id b3sm25534448wjy.40.2016.12.06.04.31.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 04:31:16 -0800 (PST) To: "freebsd-hackers@freebsd.org" From: Steven Hartland Subject: Help needed to identify golang fork / memory corruption issue on FreeBSD Message-ID: <27e1a828-5cd9-0755-50ca-d7143e7df117@multiplay.co.uk> Date: Tue, 6 Dec 2016 12:31:47 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 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: Tue, 06 Dec 2016 12:31:20 -0000 Hi guys I'm trying to help identify / fix an issue with golang where by fork results in memory corruption. Details of the issue can be found here: https://github.com/golang/go/issues/15658 In summary when a fork is done in golang is has a chance of causing memory corruption in the parent resulting in a process crash once detected. Its believed that this only effects FreeBSD. This has similarities to other reported issues such as this one which impacted perl during 10.x: https://rt.perl.org/Public/Bug/Display.html?id=122199 And more recently the issue with nginx on 11.x: https://lists.freebsd.org/pipermail/freebsd-stable/2016-September/085540.html Its possible, some believe likely, that this is a kernel bug around fork / vm that golang stresses, but I've not been able to confirm. I can reproduce the issue at will, takes between 5mins and 1hour using 16 threads, and it definitely seems like an interaction between fork and other memory operations. I've tried reproducing the issue in C but also no joy (captured in the bug). For reference I'm currently testing on 11.0-RELEASE-p3 + kibs PCID fix (#306350). Any advice / help would be most appreciated. Regards Steve