]> granicus.if.org Git - postgresql/commit
Don't use bgw_main even to specify in-core bgworker entrypoints.
authorRobert Haas <rhaas@postgresql.org>
Sat, 1 Apr 2017 00:35:51 +0000 (20:35 -0400)
committerRobert Haas <rhaas@postgresql.org>
Sat, 1 Apr 2017 00:43:32 +0000 (20:43 -0400)
commit2113ac4cbb12b815804e8873d761cade9ddf49b9
tree26eafa3c03cb8108f45192c4df4a6fcdcd5f716e
parentc281cd5fe178c946dc23eae4d4642be5ddbe3eb4
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
doc/src/sgml/bgworker.sgml
src/backend/access/transam/parallel.c
src/backend/postmaster/bgworker.c
src/backend/replication/logical/launcher.c
src/include/access/parallel.h
src/include/postmaster/bgworker.h
src/test/modules/test_shm_mq/setup.c
src/test/modules/worker_spi/worker_spi.c