From owner-freebsd-current@freebsd.org Wed Aug 23 14:38:26 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 E4821DE87B2 for ; Wed, 23 Aug 2017 14:38:26 +0000 (UTC) (envelope-from tijl@freebsd.org) Received: from mailrelay116.isp.belgacom.be (mailrelay116.isp.belgacom.be [195.238.20.143]) (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 B097372B0C; Wed, 23 Aug 2017 14:38:25 +0000 (UTC) (envelope-from tijl@freebsd.org) X-Belgacom-Dynamic: yes IronPort-PHdr: =?us-ascii?q?9a23=3Ae6eYZRdUUTei5PC72SvXUTaklGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxcuyYR7h7PlgxGXEQZ/co6odzbGH4+a4ASQp2tWoiDg6aptCVhsI24?= =?us-ascii?q?09vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7?= =?us-ascii?q?Ovr6GpLIj8Swyuu+54Dfbx9GiTe5Yr5+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYe?= =?us-ascii?q?RWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZ?= =?us-ascii?q?TAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hy?= =?us-ascii?q?cdLzM3/mHZhNJtgqxYrx2uuxNxzpXIYIyXKPZyYr/Rcc8ESWdHQ81fVzZBAoS5?= =?us-ascii?q?b4YXEeQBPORYr43grFYQqhu+AhKsC/3qyjBSgH/2xrAx3uM9EQHH3gwgG8kDvn?= =?us-ascii?q?TOrNrrKqgfTP27wqfSwTXEdfNW1i7w5Y7VeR4iufGBRbF9fdfLxUUxGA7Ijk+c?= =?us-ascii?q?pZHnMj6RzOgBrmqW4/ZmWOmykWAosRtxrSKqxso0j4nJgZ8axU7c+CVixYY1Oc?= =?us-ascii?q?W4SElmYd64CJdQtz+VN49xQs46QGFnoiI6yrwDuZGlZigKz44rxwLea/yFd4iE?= =?us-ascii?q?+A7sVOGWITdjmn1lfaiwhxCp8US6ze38TMa03E5LripDjNbMqmgA2h/O5sSdVP?= =?us-ascii?q?dw8Ues1SyS2w3R7uxIO104mKjHJ5I5x74/jJsTsUDNHi/sn0X2ibebdlkl+uiq?= =?us-ascii?q?7+TqebvmpoWCOIBqkQ7+Kbkhlta4AeQiPQgCR3Kb9vik1L3/4U35R61HjvIona?= =?us-ascii?q?nDqp/aIdkUq7W3Aw9PzIks9Q2wDyy739gCmnkHNl1Fcgqdj4f1I1HOPOz4DfCn?= =?us-ascii?q?jlSiijdk2e7JMab6AprQN3TMjKrhfaxn60FCzgoz0ctS55xOCr4fPv38QVTxu8?= =?us-ascii?q?HCAh8+KQy0zLWvNNIo2JkTVGiUDuqSLbnIvFmUzsw1LuSmX6NTvyzyeNY/4Pu7?= =?us-ascii?q?sX47nRc2eq6y0J4ebmvwSuhnIUGxT2Dhj/06PSENpAVoH7+is0GLTTMGPyX6ZK?= =?us-ascii?q?k7/DxuUI8=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A2B7CwDFkZ1Z/6qz9VFcHQEFAQsBGAEFA?= =?us-ascii?q?QsBgy9UgRKPG48mAQGCHgGCPpM2ghKFR4RGQRcBAQEBAQEBAQEBAWoogjMigwQ?= =?us-ascii?q?cIzw0KopssTuLbAEBAQcCJoMqhTGIZoUoBYl+llqBaJJPf5FySJVmIAE2P0tTM?= =?us-ascii?q?QiFYByBaT6LNwEBAQ?= X-IPAS-Result: =?us-ascii?q?A2B7CwDFkZ1Z/6qz9VFcHQEFAQsBGAEFAQsBgy9UgRKPG48?= =?us-ascii?q?mAQGCHgGCPpM2ghKFR4RGQRcBAQEBAQEBAQEBAWoogjMigwQcIzw0KopssTuLb?= =?us-ascii?q?AEBAQcCJoMqhTGIZoUoBYl+llqBaJJPf5FySJVmIAE2P0tTMQiFYByBaT6LNwE?= =?us-ascii?q?BAQ?= Received: from 170.179-245-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.245.179.170]) by relay.skynet.be with ESMTP; 23 Aug 2017 16:37:08 +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 v7NEb8Oe088856; Wed, 23 Aug 2017 16:37:08 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Wed, 23 Aug 2017 16:37:07 +0200 From: Tijl Coosemans To: freebsd-current@FreeBSD.org Cc: gerald@FreeBSD.org Subject: Segfault in _Unwind_* code called from pthread_exit Message-ID: <20170823163707.096f93ab@kalimero.tijl.coosemans.org> 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: Wed, 23 Aug 2017 14:38:27 -0000 Hi, The following program segfaults for me on amd64 when linked like this: cc -o test test.c -lpthread -L/usr/local/lib/gcc5 -lgcc_s -rpath /usr/local/lib/gcc5 -------------------------------- #include #include void * thr( void *arg ) { return( NULL ); } int main( void ) { pthread_t thread; for( int i = 1; i < 20; i++ ) { fprintf( stderr, "%d\n", i ); pthread_create( &thread, NULL, thr, NULL ); pthread_join( thread, NULL ); } return( 0 ); } -------------------------------- The backtrace looks like this: Thread 7 received signal SIGSEGV, Segmentation fault. [Switching to LWP 100511 of process 1886] uw_frame_state_for (context=context@entry=0x7fffdfffddc0, fs=fs@entry=0x7fffdfffdb10) at /usr/ports/lang/gcc5/work/gcc-5.4.0/libgcc/unwind-dw2.c:1249 1249 /usr/ports/lang/gcc5/work/gcc-5.4.0/libgcc/unwind-dw2.c: No such file or directory. (gdb) bt #0 uw_frame_state_for (context=context@entry=0x7fffdfffddc0, fs=fs@entry=0x7fffdfffdb10) at /usr/ports/lang/gcc5/work/gcc-5.4.0/libgcc/unwind-dw2.c:1249 #1 0x0000000800a66ecb in _Unwind_ForcedUnwind_Phase2 ( exc=exc@entry=0x800658730, context=context@entry=0x7fffdfffddc0) at /usr/ports/lang/gcc5/work/gcc-5.4.0/libgcc/unwind.inc:155 #2 0x0000000800a67200 in _Unwind_ForcedUnwind (exc=0x800658730, stop=0x8008428b0 , stop_argument=0x0) at /usr/ports/lang/gcc5/work/gcc-5.4.0/libgcc/unwind.inc:207 #3 0x0000000800842224 in _Unwind_ForcedUnwind (ex=0x800658730, stop_func=0x8008428b0 , stop_arg=0x0) at /usr/src/lib/libthr/thread/thr_exit.c:106 #4 0x000000080084269f in thread_unwind () at /usr/src/lib/libthr/thread/thr_exit.c:172 #5 0x00000008008424d6 in _pthread_exit_mask (status=0x0, mask=0x0) at /usr/src/lib/libthr/thread/thr_exit.c:254 #6 0x0000000800842359 in _pthread_exit (status=0x0) at /usr/src/lib/libthr/thread/thr_exit.c:206 #7 0x000000080082ccb1 in thread_start (curthread=0x800658500) at /usr/src/lib/libthr/thread/thr_create.c:289 #8 0x00007fffdfdfe000 in ?? () Backtrace stopped: Cannot access memory at address 0x7fffdfffe000 It happens with gcc6 as well, but not with base libgcc_s. Can anyone reproduce this? Have there been any changes to stack unwinding recently (last few months)?