Hi, On 2021-05-06 14:38:51 -0400, Robert Haas wrote: > On Wed, Feb 3, 2021 at 2:30 AM Tom Lane <t...@sss.pgh.pa.us> wrote: > > This point is entirely separate from the question of whether > > triggering stack traces at inopportune moments could cause system > > malfunctions, but that question is also not to be ignored. > > That worries me too, although I have a hard time saying exactly why. > If we call an OS-provided function called backtrace() and it does > something other than generate a backtrace - e.g. makes the process seg > fault, or mucks about with the values of global variables - isn't that > just a bug in the OS? Do we have particular reasons to believe that > such bugs are common? My own skepticism here is mostly based on how > inconsistent debuggers are about being able to tell you anything > useful, which makes me think that in a binary compiled with any > optimization, the ability of backtrace() to do something consistently > useful is also questionable. But that's a separate question from > whether it's likely to cause any active harm.
I think that ship kind of has sailed with commit 71a8a4f6e36547bb060dbcc961ea9b57420f7190 Author: Alvaro Herrera <alvhe...@alvh.no-ip.org> Date: 2019-11-08 15:44:20 -0300 Add backtrace support for error reporting we allow generating backtraces in all kind of places, including e.g. some inside critical sections via backtrace_functions. I don't think also doing so during interrupt processing is a meaningful increase in exposed surface area? Greetings, Andres Freund