| From: | Konstantin Knizhnik <knizhnik(at)garret(dot)ru> |
|---|---|
| To: | Andres Freund <andres(at)anarazel(dot)de> |
| Cc: | Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org |
| Subject: | Re: Non-reproducible AIO failure |
| Date: | 2025-06-10 18:09:18 |
| Message-ID: | f4a67fdf-1e71-4252-8094-586162375834@garret.ru |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On 10/06/2025 8:41 pm, Andres Freund wrote:
> I was able to reproduce it with gcc, too.
> I've reproduced it without that bitfield, unfortunately :(.
But also only at MacOS?
I wonder if it is possible to set hardware watchpoint fro program itself
(not using gdb)? I.e. using ptrace?
Looks like it is not possible to debug yourself:
https://stackoverflow.com/questions/64321402/adding-a-watchpoint-in-the-current-process-not-in-gdb-not-for-debugging
but it is possible to fork process.
In theory it certainly should be possible - gdb is normal process, so at
least we can implement our mini-gdb.
But not sure how complex it will be.
It will be nice to set watchpoint on for example "op" in
`pgaio_io_reclaim` and disable it in `pgaio_io_before_start`.
It may have less overhead (both memory and CPU) than using `mprotect` to
detect illegal access.
But I afraid that if mempory corruption happens in kernal mode then
memory protection or watchpoints will not help.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Sami Imseih | 2025-06-10 18:32:55 | Re: add function for creating/attaching hash table in DSM registry |
| Previous Message | Jeff Davis | 2025-06-10 17:48:26 | Re: Remaining dependency on setlocale() |