From owner-freebsd-hackers@freebsd.org Fri Jul 7 05:37:56 2017 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 6627AD9ABFE for ; Fri, 7 Jul 2017 05:37:56 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 E5768683FD; Fri, 7 Jul 2017 05:37:55 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id v675bjtZ055210 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 7 Jul 2017 08:37:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua v675bjtZ055210 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id v675bjrC055209; Fri, 7 Jul 2017 08:37:45 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 7 Jul 2017 08:37:45 +0300 From: Konstantin Belousov To: Conrad Meyer , Marc Branchaud , "freebsd-hackers@freebsd.org" Subject: Re: libexecinfo backtrace() in a signal handler Message-ID: <20170707053744.GM1935@kib.kiev.ua> References: <4d662753-98bc-1275-9394-0cda95eedc65@xiplink.com> <20170706231622.GA26699@britannica.bec.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170706231622.GA26699@britannica.bec.de> User-Agent: Mutt/1.8.3 (2017-05-23) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home 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: Fri, 07 Jul 2017 05:37:56 -0000 On Fri, Jul 07, 2017 at 01:16:22AM +0200, Joerg Sonnenberger wrote: > On Thu, Jul 06, 2017 at 03:58:04PM -0700, Conrad Meyer wrote: > > Signal handlers use a special stack frame that libexecinfo is too > > simple to understand. To get a stack from a signal handler, you might > > want to use libunwind instead. > > Actually, that's not the problem. The problem is that nothing registers > the necessary unwind data. Actually, that's not the problem. Libunwind port on FreeBSD knows how to detect signal trampolines, either with the direct help from kernel, or using some heuristic by parsing instructions, on (much) older kernels.