Re: elog/ereport VS misleading backtrace_function function address

2024-05-14 Thread Robert Haas
On Tue, May 14, 2024 at 6:13 AM Jakub Wartak wrote: > OK I'll try to explain using assembly, but I'm not an expert on this. > Let's go to the 1st post, assume we run with backtrace_function set: I feel like this explanation doesn't really explain very much. I mean, the question is not "how is it

Re: elog/ereport VS misleading backtrace_function function address

2024-05-14 Thread Tom Lane
Alvaro Herrera writes: > On 2024-May-14, Jakub Wartak wrote: >> Reality is apparently mixed,at least from what I have checked : >> - all RHEL 7.x/8.x (PGDG and our forks) do NOT come with >> --enable-debug according to pg_config. > Ooh, yeah, that's true according to >

Re: elog/ereport VS misleading backtrace_function function address

2024-05-14 Thread Alvaro Herrera
On 2024-May-14, Jakub Wartak wrote: > On Sun, May 12, 2024 at 10:33 PM Peter Eisentraut > wrote: > > Don't production builds use debug > > symbols nowadays as well? > > Reality is apparently mixed,at least from what I have checked : > - all RHEL 7.x/8.x (PGDG and our forks) do NOT come with >

Re: elog/ereport VS misleading backtrace_function function address

2024-05-14 Thread Jakub Wartak
Hi Peter! On Sun, May 12, 2024 at 10:33 PM Peter Eisentraut wrote: > > On 07.05.24 09:43, Jakub Wartak wrote: > > NOTE: in case one will be testing this: one cannot ./configure with > > --enable-debug as it prevents the compiler optimizations that actually > > end up with the ".cold" branch

Re: elog/ereport VS misleading backtrace_function function address

2024-05-12 Thread Peter Eisentraut
On 07.05.24 09:43, Jakub Wartak wrote: NOTE: in case one will be testing this: one cannot ./configure with --enable-debug as it prevents the compiler optimizations that actually end up with the ".cold" branch optimizations that cause backtrace() to return the wrong address. Is that

Re: elog/ereport VS misleading backtrace_function function address

2024-05-07 Thread Jakub Wartak
Hi Tom and -hackers! On Thu, Mar 28, 2024 at 7:36 PM Tom Lane wrote: > > Jakub Wartak writes: > > While chasing some other bug I've learned that backtrace_functions > > might be misleading with top elog/ereport() address. > > That was understood from the beginning: this type of backtrace is >

Re: elog/ereport VS misleading backtrace_function function address

2024-03-28 Thread Tom Lane
Jakub Wartak writes: > While chasing some other bug I've learned that backtrace_functions > might be misleading with top elog/ereport() address. That was understood from the beginning: this type of backtrace is inherently pretty imprecise, and I doubt there is much that can be done to make it

elog/ereport VS misleading backtrace_function function address

2024-03-28 Thread Jakub Wartak
Hi -hackers, While chasing some other bug I've learned that backtrace_functions might be misleading with top elog/ereport() address. Reproducer: # using Tom's reproducer on master: wget https://www.postgresql.org/message-id/attachment/112394/ri-collation-bug-example.sql echo '' >>