Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkWVk-0007Ep-SV for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jul 2019 16:29:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hkWVj-0007gt-96 for pgsql-hackers@arkaria.postgresql.org; Mon, 08 Jul 2019 16:29:03 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkWVi-0007fj-OV for pgsql-hackers@lists.postgresql.org; Mon, 08 Jul 2019 16:29:03 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hkWVb-0002Ct-04 for pgsql-hackers@postgresql.org; Mon, 08 Jul 2019 16:29:01 +0000 Received: by mail-qt1-x844.google.com with SMTP id d17so17222388qtj.8 for ; Mon, 08 Jul 2019 09:28:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=F9SAqe6GxSEOgefJHeDWottWtdkwrA8xkLY2mlTJqaA=; b=HdNJN0oyQ8PGPyR5zJnUu0Scukez/sZ9gSCQewaXRGarxbhiIJkK+aKEfn4UjOMltN t4sd5GzzIxRKrmb/Vadqow7mQSisalKcFfbre0fhTQ0cgIeo3R5vAWevndLNyZcMkS0v OOU+TrC0uLpsk1cCp7eg0Fue1wkJs44W1UHTqrB/UFPzcl02qBMfjCAl85ZL1iPWjQ34 IWQSF81Cx7mNEVeLrAUZnxaJw0TacbBa4Oh/9Ct6kXD4O4YCx4JezsZx6gjcYzThBlJO an/RoHkqjLH/NcSNHUUtM2VBoSd8W2BtqPE790MWHNGBk0n1u3bcXq1myRhNzq/V61Ti 8r4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=F9SAqe6GxSEOgefJHeDWottWtdkwrA8xkLY2mlTJqaA=; b=E2IzLfaRneJUchb5NstFONE0+BHNi3LHqhjrHWnQ7jUl9IPORy7Nw0w8Gc+RG/+llM JZkRkNibJyAhX3ZL+j5mo8rIspibX2eP+QqZtJKMv8wpuA8fNtPvU97cN8EBVb+B2snk 5f3AD4+S2Nw9gXE6BMDnh+cfv5yMtDu23LJYFXFEedJeHfIX3Mp80fgf4bCWYK+7Baxw BSStpXCSD//NwywE84C1IMW+VlVnpU5xaCKiWC6rGEdEjC9rw7c6L47drejxXB5mEhKt UjLHzRQhCQrqIZ0EH1BowXUZp6oXzd+g3dhvF7ing3J/N+jnosU6ZpkOiVYzP6Stpj88 NUpQ== X-Gm-Message-State: APjAAAV+AgJGsju4CT+i7d/3AcSKh1dd+qc53YEJcVm5o3+xodAFxxQX ve0ryyfnduKuUNaxKjLYxoikTA== X-Google-Smtp-Source: APXvYqyj+/1Dvh6U4umCj4fN/r5qyp2qNqMJ2wZxnI9J6GK/sag2J5ZA0o59vFmcjYAwmsVFoI6Nhw== X-Received: by 2002:ac8:4a0d:: with SMTP id x13mr10306663qtq.356.1562603334119; Mon, 08 Jul 2019 09:28:54 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([190.121.29.3]) by smtp.gmail.com with ESMTPSA id l6sm7982516qkf.83.2019.07.08.09.28.53 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 08 Jul 2019 09:28:53 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id CC500124A5B; Mon, 8 Jul 2019 12:28:51 -0400 (-04) Date: Mon, 8 Jul 2019 12:28:51 -0400 From: Alvaro Herrera To: Dmitry Dolgov <9erthalion6@gmail.com> Cc: Thomas Munro , Peter Eisentraut , pgsql-hackers Subject: Re: errbacktrace Message-ID: <20190708162851.GA11054@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Jul-08, Dmitry Dolgov wrote: > > On Sat, Jun 29, 2019 at 7:41 AM Jaime Casanova wrote: > > > > This is certainly a very useful thing. Sadly, it doesn't seem to compile when > > trying to use libunwind. > > Yeah, the same for me. To make it works I've restricted libunwind to local > unwinding only: > > #ifdef USE_LIBUNWIND > #define UNW_LOCAL_ONLY > #include > #endif Ah, yes. unwind's manpage says: Normally, libunwind supports both local and remote unwinding (the latter will be explained in the next section). However, if you tell libunwind that your program only needs local unwinding, then a special implementation can be selected which may run much faster than the generic implementation which supports both kinds of unwinding. To select this optimized version, simply define the macro UNW_LOCAL_ONLY before including the headerfile . so I agree with unconditionally defining that symbol. Nitpicking dept: I think in these tests: + if (!edata->backtrace && + edata->funcname && + backtrace_function[0] && + strcmp(backtrace_function, edata->funcname) == 0) + set_backtrace(edata, 2); we should test for backtrace_function[0] before edata->funcname, since it seems more likely to be unset. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services