From owner-freebsd-current@freebsd.org Tue Oct 31 09:45:01 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 8FE8AE5397F for ; Tue, 31 Oct 2017 09:45:01 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay119.isp.belgacom.be (mailrelay119.isp.belgacom.be [195.238.20.146]) (using TLSv1.2 with cipher RC4-SHA (128/128 bits)) (Client CN "relay.skynet.be", Issuer "GlobalSign Organization Validation CA - SHA256 - G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C1C926B8CE; Tue, 31 Oct 2017 09:45:00 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3AGJHa8x/z4Y25z/9uRHKM819IXTAuvvDOBiVQ1KB4?= =?us-ascii?q?1egcTK2v8tzYMVDF4r011RmSDNWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?us-ascii?q?8rmRc9CtWOE0zxIa2iRSU7GMNfSA0tpCnjYgBaF8nkelLdvGC54yIMFRXjLwp1?= =?us-ascii?q?Ifn+FpLPg8it2e2//57ebx9UiDahfLh/MAi4oQLNu8cMnIBsMLwxyhzHontJf+?= =?us-ascii?q?RZ22ZlLk+Nkhj/+8m94odt/zxftPw9+cFAV776f7kjQrxDEDsmKWE169b1uhTF?= =?us-ascii?q?UACC+2ETUmQSkhpPHgjF8BT3VYr/vyfmquZw3jSRMMvrRr42RDui9b9mRhHohi?= =?us-ascii?q?kZKjA382PYisJ/g61HrxysvAB/zozIbI2JKPZyYr3RcNUHTmRBRMZRUClBD5ui?= =?us-ascii?q?YYsODeoBOftTopf6p1sJthuxGwysC/npyj9Tm3T72rE60+UjEQHCxwEuH8gOv2?= =?us-ascii?q?rKo9joKakcX/q5zK7SzTXMdv5b3yr25obPchAku/6MXLRwfNLeyUkpCgPJlFKQ?= =?us-ascii?q?qZbqPz6Ty+8DsHCb4vJjWO6zkWIrtR19riS1ysotjoTFnJ8Zxk7K+Ch/3Y07P8?= =?us-ascii?q?e3SFRhbt6hCJZQsiaaOJZoTc46WGFovTo6yqUBuZ6mYCgG0JQnyADba/yAa4WI?= =?us-ascii?q?4QjsVOKQITd9mn1lYrW/iwyu8UihyO38UtO430pNripCidnDqHUN2AbV6sicUP?= =?us-ascii?q?d9+V2h2TmX2wDS7OFLP1w0mLLYJpI92LI8iIYfvVjZEiL3nEj6lrKaelsq9+Sw?= =?us-ascii?q?7uToeLTmppuSN49ujQH+N7wjmtC+AeQ6NggDRGab+f6i27L95kL5W6hFgucxkq?= =?us-ascii?q?nDv5DWPd4bqbKhAw9JzoYj7A6yDzSh0NQDgXkHLVFFdwmZgIjtIFzOL/X4Au2+?= =?us-ascii?q?g1Soijtk2/fGPriySqnKe1HFnK3sdK0110lWzAcphYRW4Z5OB7gaPLf3W1TtnN?= =?us-ascii?q?LXHBk0L0q/w7C0Js9609YiWGCLSoSeN7jftFaO/ap7P+iOYKc7ojvwAcMJofn0?= =?us-ascii?q?gilqyhcmYaC10M5POziDFfN8LhDBbA=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AQCgBPRfhZ/3tFyFBdGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBFQEBAQECAQEBAQgBAQEBgzRUEG4njw+OIAEBgXsyAZggLYElg3MChGR?= =?us-ascii?q?EFAEBAQEBAQEBAQEBaiiCOCKCRAEFOhwjEAsYCSUPKh4GE4onDKpbiwgBAQEBA?= =?us-ascii?q?QEBAQIBAQEBAQEdBYMuiG2DPodJBaIEh2aNCYEAkjtIjBeKbDYhgWhVMghJgmS?= =?us-ascii?q?CXByBaEA2AYwrAQEB?= X-IPAS-Result: =?us-ascii?q?A2AQCgBPRfhZ/3tFyFBdGgEBAQECAQEBAQgBAQEBFQEBAQE?= =?us-ascii?q?CAQEBAQgBAQEBgzRUEG4njw+OIAEBgXsyAZggLYElg3MChGREFAEBAQEBAQEBA?= =?us-ascii?q?QEBaiiCOCKCRAEFOhwjEAsYCSUPKh4GE4onDKpbiwgBAQEBAQEBAQIBAQEBAQE?= =?us-ascii?q?dBYMuiG2DPodJBaIEh2aNCYEAkjtIjBeKbDYhgWhVMghJgmSCXByBaEA2AYwrA?= =?us-ascii?q?QEB?= Received: from 123.69-200-80.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([80.200.69.123]) by relay.skynet.be with ESMTP; 31 Oct 2017 10:44:56 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.15.2/8.15.2) with ESMTP id v9V9itf6021842; Tue, 31 Oct 2017 10:44:55 +0100 (CET) (envelope-from tijl@FreeBSD.org) Date: Tue, 31 Oct 2017 10:44:55 +0100 From: Tijl Coosemans To: Andreas Tobler Cc: Konstantin Belousov , freebsd-current@FreeBSD.org, gerald@FreeBSD.org Subject: Re: Segfault in _Unwind_* code called from pthread_exit Message-ID: <20171031104455.48dd7c3c@kalimero.tijl.coosemans.org> In-Reply-To: <9468430e-fda4-10f4-b6a0-aa40d7d64f5b@fgznet.ch> 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> <9468430e-fda4-10f4-b6a0-aa40d7d64f5b@fgznet.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Tue, 31 Oct 2017 09:45:01 -0000 On Mon, 30 Oct 2017 22:54:05 +0100 Andreas Tobler wrote: > 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. The patch looks good to me. KERN_PROC_SIGTRAMP was added in 9.3 it seems. If gcc wants to support older versions you may have to use an #ifdef like Konstantin did in his first reply in this thread.