diff options
| author | Robert Haas | 2017-04-01 00:35:51 +0000 |
|---|---|---|
| committer | Robert Haas | 2017-04-01 00:43:32 +0000 |
| commit | 2113ac4cbb12b815804e8873d761cade9ddf49b9 (patch) | |
| tree | 26eafa3c03cb8108f45192c4df4a6fcdcd5f716e /src/include | |
| parent | c281cd5fe178c946dc23eae4d4642be5ddbe3eb4 (diff) | |
Don't use bgw_main even to specify in-core bgworker entrypoints.
On EXEC_BACKEND builds, this can fail if ASLR is in use.
Backpatch to 9.5. On master, completely remove the bgw_main field
completely, since there is no situation in which it is safe for an
EXEC_BACKEND build. On 9.6 and 9.5, leave the field intact to avoid
breaking things for third-party code that doesn't care about working
under EXEC_BACKEND. Prior to 9.5, there are no in-core bgworker
entrypoints.
Petr Jelinek, reviewed by me.
Discussion: http://postgr.es/m/09d8ad33-4287-a09b-a77f-77f8761adb5e@2ndquadrant.com
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/access/parallel.h | 2 | ||||
| -rw-r--r-- | src/include/postmaster/bgworker.h | 5 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/include/access/parallel.h b/src/include/access/parallel.h index 96ce4803dad..5065a3830cf 100644 --- a/src/include/access/parallel.h +++ b/src/include/access/parallel.h @@ -67,4 +67,6 @@ extern void AtEOXact_Parallel(bool isCommit); extern void AtEOSubXact_Parallel(bool isCommit, SubTransactionId mySubId); extern void ParallelWorkerReportLastRecEnd(XLogRecPtr last_xlog_end); +extern void ParallelWorkerMain(Datum main_arg); + #endif /* PARALLEL_H */ diff --git a/src/include/postmaster/bgworker.h b/src/include/postmaster/bgworker.h index 128e92cea1d..51a5978ea87 100644 --- a/src/include/postmaster/bgworker.h +++ b/src/include/postmaster/bgworker.h @@ -91,9 +91,8 @@ typedef struct BackgroundWorker int bgw_flags; BgWorkerStartTime bgw_start_time; int bgw_restart_time; /* in seconds, or BGW_NEVER_RESTART */ - bgworker_main_type bgw_main; - char bgw_library_name[BGW_MAXLEN]; /* only if bgw_main is NULL */ - char bgw_function_name[BGW_MAXLEN]; /* only if bgw_main is NULL */ + char bgw_library_name[BGW_MAXLEN]; + char bgw_function_name[BGW_MAXLEN]; Datum bgw_main_arg; char bgw_extra[BGW_EXTRALEN]; pid_t bgw_notify_pid; /* SIGUSR1 this backend on start/stop */ |
