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

Commit46ef520

Browse files
Mark buffers as defined to Valgrind consistently.
Make PinBuffer() mark buffers as defined to Valgrind unconditionally,including when the buffer header spinlock must be acquired. Failure tohandle that case could lead to false positive reports from Valgrind.This theoretically creates a risk that we'll mark buffers defined evenwhen external callers don't end up with a buffer pin. That seemsperfectly acceptable, though, since in general we make no guaranteesabout buffers that are unsafe to access being reliably marked as unsafe.Oversight in commit1e0dfd1, which added valgrind buffer accessinstrumentation.
1 parent72eab84 commit46ef520

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/storage/buffer/bufmgr.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1636,11 +1636,13 @@ PinBuffer(BufferDesc *buf, BufferAccessStrategy strategy)
16361636
result= (buf_state&BM_VALID)!=0;
16371637

16381638
/*
1639-
* If we successfully acquired our first pin on this buffer
1640-
* within this backend, mark buffer contents defined
1639+
* Assume that we acquired a buffer pin for the purposes of
1640+
* Valgrind buffer client checks (even in !result case) to
1641+
* keep things simple. Buffers that are unsafe to access are
1642+
* not generally guaranteed to be marked undefined in any
1643+
* case.
16411644
*/
1642-
if (result)
1643-
VALGRIND_MAKE_MEM_DEFINED(BufHdrGetBlock(buf),BLCKSZ);
1645+
VALGRIND_MAKE_MEM_DEFINED(BufHdrGetBlock(buf),BLCKSZ);
16441646
break;
16451647
}
16461648
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp