RE: PATCH: backtraces for error messages

From: "Tsunakawa, Takayuki" <tsunakawa(dot)takay(at)jp(dot)fujitsu(dot)com>
To: 'Alvaro Herrera' <alvherre(at)2ndquadrant(dot)com>, Craig Ringer <craig(at)2ndquadrant(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: PATCH: backtraces for error messages
Date: 2018-06-21 00:22:50
Message-ID: 0A3221C70F24FB45833433255569204D1FA21CCA@G01JPEXMBYT05
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

From: Alvaro Herrera [mailto:alvherre(at)2ndquadrant(dot)com]
> I have no idea how expensive backtrace() and libunwind are, but I doubt
> we want to pay the cost for every message before we know that error
> requires the backtrace to be collected. Something like PGC_USERSET
> server_min_backtraces=PANIC
> might be a possible interface.

+1

In addition, it would be nicer if we could have some filtering based on the error condition. Sometimes I wanted to know where the "out of memory" or "invalid memory alloc request size ..." was thrown.

How about adding a GUC like the -e option of strace? strace allows to specify which system calls and groups of them to capture. We can use the SQL state and class code/name to list the conditions to capture. In the out-of-memory case, I want to specify 53200, but don't want to get stack traces for other errors in class 53.

https://www.postgresql.org/docs/devel/static/errcodes-appendix.html

Regards
Takayuki Tsunakawa

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tsunakawa, Takayuki 2018-06-21 00:50:21 RE: [Proposal] Table-level Transparent Data Encryption (TDE) and Key Management Service (KMS)
Previous Message Andrew Dunstan 2018-06-21 00:19:02 Re: changing xpath() and xpath_exists()