diff --git a/.travis.yml b/.travis.yml index 2c63eff..98d4318 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ dist: jammy language: c env: -- PG_MAJOR=18 SNAPSHOT=1 +- PG_MAJOR=18 BETA=1 - PG_MAJOR=17 - PG_MAJOR=16 - PG_MAJOR=15 diff --git a/pg_wait_sampling.c b/pg_wait_sampling.c index a0cc582..e165a6a 100644 --- a/pg_wait_sampling.c +++ b/pg_wait_sampling.c @@ -369,7 +369,7 @@ _PG_init(void) 1, INT_MAX, PGC_SIGHUP, - GUC_UNIT_MS, + 0, NULL, NULL, NULL); @@ -382,7 +382,7 @@ _PG_init(void) 1, INT_MAX, PGC_SIGHUP, - GUC_UNIT_MS, + 0, NULL, NULL, NULL); @@ -649,6 +649,10 @@ receive_array(SHMRequest request, Size item_size, Size *count) pgws_collector_hdr->request = request; LockRelease(&collectorTag, ExclusiveLock, false); + /* + * Check that the collector was started to avoid NULL + * pointer dereference. + */ if (!pgws_collector_hdr->latch) ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), errmsg("pg_wait_sampling collector wasn't started"))); @@ -819,6 +823,14 @@ pg_wait_sampling_reset_profile(PG_FUNCTION_ARGS) pgws_collector_hdr->request = PROFILE_RESET; LockRelease(&collectorTag, ExclusiveLock, false); + /* + * Check that the collector was started to avoid NULL + * pointer dereference. + */ + if (!pgws_collector_hdr->latch) + ereport(ERROR, (errcode(ERRCODE_INTERNAL_ERROR), + errmsg("pg_wait_sampling collector wasn't started"))); + SetLatch(pgws_collector_hdr->latch); LockRelease(&queueTag, ExclusiveLock, false); diff --git a/run-tests.sh b/run-tests.sh index f3f1bba..f42e999 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -6,6 +6,7 @@ export PGDATA=/var/lib/postgresql/$PG_MAJOR/test export COPT=-Werror export USE_PGXS=1 +sudo mkdir -p /var/lib/postgresql/$PG_MAJOR sudo chmod 1777 /var/lib/postgresql/$PG_MAJOR sudo chmod 1777 /var/run/postgresql pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy