Re: Need help debugging SIGBUS crashes

From: Tomas Vondra <tomas(at)vondra(dot)me>
To: Peter 'PMc' Much <pmc(at)citylink(dot)dinoex(dot)sub(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Need help debugging SIGBUS crashes
Date: 2026-03-17 13:40:24
Message-ID: 33d99d2f-4020-4615-9314-2f1a19927fa6@vondra.me
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 3/17/26 13:17, Peter 'PMc' Much wrote:
> ...
>
> The backtrace is disgusting - all interesting things are optimized
> away. :(
> So I am now quite clueless on how to proceed further, and could
> really use some educated inspiration. I can not even say if this is
> a postgres issue or a FreeBSD issue (but it doesn't happen to any
> other program). I could probably rebuild the OS with -O0 - but is
> this the best way to proceed?
> (Filing a bug report against FreeBSD without specific reproduction
> info would most likely just mean that it stays on my desk anyway.)
>

I agree it's hard to deduce anything from the backtraces with the
interesting bits optimized out. Rebuilding the OS with -O0 might be an
overkill, I'd probably start by building just Postgres. That'd at least
give us some idea what happens there, you could inspect the memory
context etc.

I'm not a FreeBSD expert, but this seems a bit suspicious:

frame #23: 0x0000000822ae79b6
libthr.so.3`handle_signal(actp=0x0000000820c5c600, sig=30,
info=0x0000000820c5c9f0, ucp=0x0000000820c5c680) at thr_sig.c:318:3
frame #24: 0x0000000822ae6eba libthr.so.3`thr_sighandler(sig=30,
info=0x0000000820c5c9f0, _ucp=0x0000000820c5c680) at thr_sig.c:261:2

I mean, libthr seems to be a 1:1 with pthreads. Are you using threads in
some way? Perhaps an extension using threads? That could cause weird
failures, including weird SIGBUS ones.

regards

--
Tomas Vondra

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2026-03-17 13:44:34 Re: pg_plan_advice
Previous Message torikoshia 2026-03-17 13:16:52 Re: RFC: Allow EXPLAIN to Output Page Fault Information