Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2c62754

Browse files
committed
Make EXEC_BACKEND more convenient on macOS.
It's hard to disable ASLR on current macOS releases, for testing with-DEXEC_BACKEND. You could already set the environment variablePG_SHMEM_ADDR to something not likely to collide with mappings createdearlier in process startup. Let's also provide a default value thatworks on current releases and architectures, for developer convenience.As noted in the pre-existing comment, this is a horrible hack, but-DEXEC_BACKEND is only used by Unix-based PostgreSQL developers fortesting some otherwise Windows-only code paths, so it seems excusable.Back-patch to all supported branches.Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>Discussion:https://postgr.es/m/20210806032944.m4tz7j2w47mant26%40alap3.anarazel.de
1 parent7ba487c commit2c62754

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

‎src/backend/port/sysv_shmem.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ InternalIpcMemoryCreate(IpcMemoryKey memKey, Size size)
142142

143143
if (pg_shmem_addr)
144144
requestedAddress= (void*)strtoul(pg_shmem_addr,NULL,0);
145+
else
146+
{
147+
#if defined(__darwin__)&&SIZEOF_VOID_P==8
148+
/*
149+
* Provide a default value that is believed to avoid problems with
150+
* ASLR on the current macOS release.
151+
*/
152+
requestedAddress= (void*)0x80000000000;
153+
#endif
154+
}
145155
}
146156
#endif
147157

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp