From owner-freebsd-current@freebsd.org Mon Oct 30 21:54:09 2017 Return-Path: Delivered-To: freebsd-current@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 1A21BE669F2 for ; Mon, 30 Oct 2017 21:54:09 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from smtp.fgznet.ch (smtp.fgznet.ch [IPv6:2001:4060:1:1001::14:52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D04F373AC8; Mon, 30 Oct 2017 21:54:08 +0000 (UTC) (envelope-from andreast-list@fgznet.ch) Received: from [192.168.225.14] (dhclient-91-190-10-49.flashcable.ch [91.190.10.49]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by fgznet.ch (Postfix) with ESMTPSA id 65F06C6839; Mon, 30 Oct 2017 22:54:05 +0100 (CET) Subject: Re: Segfault in _Unwind_* code called from pthread_exit To: Tijl Coosemans Cc: Konstantin Belousov , freebsd-current@FreeBSD.org, gerald@FreeBSD.org References: <20170823163707.096f93ab@kalimero.tijl.coosemans.org> <20170824154235.GD1700@kib.kiev.ua> <20170824180830.199885b0@kalimero.tijl.coosemans.org> <20170825173851.09116ddc@kalimero.tijl.coosemans.org> <20170825234442.GO1700@kib.kiev.ua> <20170826202813.1240a1ef@kalimero.tijl.coosemans.org> <20170826184034.GR1700@kib.kiev.ua> <20171029182351.502f53cf@kalimero.tijl.coosemans.org> <20171029191358.GU2566@kib.kiev.ua> <9a724da4-70f1-4330-9a77-619739008a14@fgznet.ch> <20171030153207.15a42a1e@kalimero.tijl.coosemans.org> From: Andreas Tobler Message-ID: <9468430e-fda4-10f4-b6a0-aa40d7d64f5b@fgznet.ch> Date: Mon, 30 Oct 2017 22:54:05 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20171030153207.15a42a1e@kalimero.tijl.coosemans.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: Obelix Submit on 127.0.1.1 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2017 21:54:09 -0000 On 30.10.17 15:32, Tijl Coosemans wrote: > On Sun, 29 Oct 2017 20:40:46 +0100 Andreas Tobler wrote: >> Attached what I have for libgcc. It can be applied to gcc5-8, should >> give no issues. The mentioned tc from this thread and mine, >> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82635 do pass. >> >> What do you think? > > Like I said before the return address can be anything. It could for > instance point to some instruction in a random function and then the > stack unwinder will think thread_start was called from that function. > There's no check you can add to libgcc to distinguish that from a > normal valid return address. > Maybe not, and most probably I do not understand what is happening. But with my modification I survive the test case. If no objections from your or Konstantin's side come up I will commit it to the gcc repo. It will not 'fix' the issue, but it will improve the gcc behavior. Andreas