Re: Can a background worker exist without shared memory access for EXEC_BACKEND cases?

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: Can a background worker exist without shared memory access for EXEC_BACKEND cases?
Дата
Msg-id CA+Tgmoa=A-OyUCDK032wmB_owRJC7VMeZeJMSs9sVaRT3RB=QQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Can a background worker exist without shared memory access for EXEC_BACKEND cases?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Ответы Re: Can a background worker exist without shared memory access for EXEC_BACKEND cases?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Список pgsql-hackers
On Wed, Aug 5, 2020 at 7:24 AM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
> In EXEC_BACKEND cases, right after PGSharedMemoryDetach(), the bg
> worker will no longer be able to access the backend parameters, see
> below(I tried this on my Ubuntu machine with a bgworker with no
> BGWORKER_SHMEM_ACCESS flag and defined EXEC_BACKEND macro in
> pg_config_manual.h) :
>
> (gdb) p *MyLatch
> Cannot access memory at address 0x7fd60424a6b4
> (gdb) p *ShmemVariableCache
> Cannot access memory at address 0x7fd58427bf80
> (gdb) p ProcStructLock
> $10 = (slock_t *) 0x7fd60429bd00 <error: Cannot access memory at
> address 0x7fd60429bd00>
> (gdb) p *AuxiliaryProcs
> Cannot access memory at address 0x7fd60424cc60
> (gdb) p *ProcGlobal
> Cannot access memory at address 0x7fd604232880

Well all of those are pointers into the main shared memory segment,
which is expected to be inaccessible after it is detached. Hopefully
nobody should be surprised that if you don't specify
BGWORKER_SHMEM_ACCESS, you can't access data stored in shared memory.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Can a background worker exist without shared memory access for EXEC_BACKEND cases?
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: Which SET TYPE don't actually require a rewrite