From owner-freebsd-current@freebsd.org Sat Aug 26 21:33:58 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 09651DDB8DC for ; Sat, 26 Aug 2017 21:33:58 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay111.isp.belgacom.be (mailrelay111.isp.belgacom.be [195.238.20.138]) (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 CB2B47E1D8; Sat, 26 Aug 2017 21:33:56 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3ANN7oXB9blel5af9uRHKM819IXTAuvvDOBiVQ1KB4?= =?us-ascii?q?0O8cTK2v8tzYMVDF4r011RmSDNWds6oMotGVmpioYXYH75eFvSJKW713fDhBt/?= =?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/q5zK7SzTXMdv5b3yr25ovQch05ovyAQKh8fdTexEQvDQ/Jk1ad?= =?us-ascii?q?pIj/Mz+I2OkAsm6W5Pd6W+21kW4osQRxryCqxscrl4bGmJoYykvB9SVl2IY1Is?= =?us-ascii?q?C4SFJjbd6kDpRQsyaaOpN1Qsw4R2FouSM6xaMcuZ68ZiQK1JUnxxzba/Cdb4eI?= =?us-ascii?q?5RXjVP2PLjd9nn1lfqm/iwy18Ui6xe3wTsi00FBUoSpZitTBtW0B2wbN5sWISv?= =?us-ascii?q?Zx5Fqt1DWL2gzJ9+1JL0E5mbLeK5E7w74wkpQTsV7EHi/zgEj2kK6Wdkcg+uWz?= =?us-ascii?q?5eTneKvpqYGHOI9vlw7yKKMumtawAeggKAgBQ3Cb+fig1L3k5UD5Q7JKjuYqkq?= =?us-ascii?q?nYs5DVPtoUpqqiDg9a14Ys8Re/DzO83NsEmnkHKQENRBXSrI/vIE3HJuz5C7+V?= =?us-ascii?q?jlCrjSxs2biSPbr6HpTOJHXHuLjkdLd5rUVbzVxg48pY4sdoC7MFaNn0XVT8sd?= =?us-ascii?q?XeFVdtLw22x87JEthw/LgyH2WVDfnKY+vprVaU67d3cKG3b4gPtWOlJg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2AcAgC96KFZ/4i99VFcGwEBAQMBAQEJA?= =?us-ascii?q?QEBFwEBBAEBCgEBgy9UgSWOFHSPIgEBgXAvAYgJjW2CEoVHAoNiQBgBAQEBAQE?= =?us-ascii?q?BAQEBAWoogjMigkQBBTocIxALDgoJJQ8SGB4GE4oZAxmyfocvDYQbAQEBAQEBA?= =?us-ascii?q?QMBAQEBJIMqiFuCV4gSBYoBlic8j1CEaX+RdkiMAYl0HziBDVMxCIVhHIFpPja?= =?us-ascii?q?LIAEBAQ?= X-IPAS-Result: =?us-ascii?q?A2AcAgC96KFZ/4i99VFcGwEBAQMBAQEJAQEBFwEBBAEBCgE?= =?us-ascii?q?Bgy9UgSWOFHSPIgEBgXAvAYgJjW2CEoVHAoNiQBgBAQEBAQEBAQEBAWoogjMig?= =?us-ascii?q?kQBBTocIxALDgoJJQ8SGB4GE4oZAxmyfocvDYQbAQEBAQEBAQMBAQEBJIMqiFu?= =?us-ascii?q?CV4gSBYoBlic8j1CEaX+RdkiMAYl0HziBDVMxCIVhHIFpPjaLIAEBAQ?= Received: from 136.189-245-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.245.189.136]) by relay.skynet.be with ESMTP; 26 Aug 2017 23:33:46 +0200 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 v7QLXjAi005754; Sat, 26 Aug 2017 23:33:45 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Sat, 26 Aug 2017 23:33:45 +0200 From: Tijl Coosemans To: Konstantin Belousov Cc: freebsd-current@FreeBSD.org, gerald@FreeBSD.org Subject: Re: Segfault in _Unwind_* code called from pthread_exit Message-ID: <20170826233345.348f73a3@kalimero.tijl.coosemans.org> In-Reply-To: <20170826184034.GR1700@kib.kiev.ua> 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> 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: Sat, 26 Aug 2017 21:33:58 -0000 On Sat, 26 Aug 2017 21:40:34 +0300 Konstantin Belousov wrote: > On Sat, Aug 26, 2017 at 08:28:13PM +0200, Tijl Coosemans wrote: >> On Sat, 26 Aug 2017 02:44:42 +0300 Konstantin Belousov wrote: >>> How does llvm unwinder detects that the return address is a garbage ? >> >> It just stops unwinding when it can't find frame information (stored in >> .eh_frame sections). GCC unwinder doesn't give up yet and checks if the >> return address points to the signal trampoline (which means the current >> frame is that of a signal handler). It has built-in knowledge of how to >> unwind to the signal trampoline frame. > So llvm just gives up on signal frames ? Looks like it. This program doesn't print anything when using base libgcc_s. With gcc libgcc_s it prints: 0x400904 at /usr/home/tijl/testsig 0x7ffffffff173 <_fini+0x7fffffbfe7bb> at ??? cc -o test test.c -lexecinfo -lgcc_s -rpath /usr/local/lib/gcc5 ---------------------------- #include #include void *buf[ 20 ]; size_t s; void handler( int sig ) { s = backtrace( buf, 20 ); } int main( void ) { signal( SIGINT, handler ); raise( SIGINT ); backtrace_symbols_fd( buf, s, 1 ); return( 0 ); } ----------------------------