pg.ddx.io  pgaudit/pgaudit GitHub issues and pull requests  
help / color / mirror / Atom feed
From: dwsteele (@dwsteele) <noreply+dwsteele@github.com>
To: pgaudit/pgaudit <noreply+pgaudit-pgaudit@github.com>
Subject: Re: [pgaudit/pgaudit] issue #259: Coredump in log_select_dml()
Date: Thu, 25 Jun 2026 08:28:19 +0000
Message-ID: <gh-pgaudit-pgaudit-259-c4797299098@github.com> (raw)
In-Reply-To: <gh-pgaudit-pgaudit-259@github.com>
References: <gh-pgaudit-pgaudit-259@github.com>

@x4m @reshke A possible fix here would be something like:
```
+                contextOld = MemoryContextSwitchTo(auditEventStack->contextAudit);
+
                 auditEventStack->auditEvent.auditOid = auditOid;
-                auditEventStack->auditEvent.rangeTabls = rangeTabls;
-                auditEventStack->auditEvent.permInfos = permInfos;
+                auditEventStack->auditEvent.rangeTabls = copyObject(rangeTabls);
+                auditEventStack->auditEvent.permInfos = copyObject(permInfos);
+
+                MemoryContextSwitchTo(contextOld);
```
But seems like it would be pretty bad for performance. Considering this issue looks like it was caused by misuse of the hook chain I'm not sure it is worth it.

Some issues of this type should be handled by #250.

Thoughts?

view thread (8+ messages)  latest in thread

Message-ID: <gh-pgaudit-pgaudit-259-c4797299098@github.com>
Permalink:  ../gh-pgaudit-pgaudit-259-c4797299098@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox