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

Commitde6428a

Browse files
committed
Avoid another valgrind complaint about write() of uninitalized bytes.
Peter Geoghegan, per buildfarm member skink and Andres FreundDiscussion:http://postgr.es/m/20180221053426.gp72lw67yfpzkw7a@alap3.anarazel.de
1 parent9a5c4f5 commitde6428a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/backend/utils/sort/logtape.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -739,6 +739,18 @@ LogicalTapeRewindForRead(LogicalTapeSet *lts, int tapenum, size_t buffer_size)
739739
*/
740740
if (lt->dirty)
741741
{
742+
/*
743+
* As long as we've filled the buffer at least once, its contents
744+
* are entirely defined from valgrind's point of view, even though
745+
* contents beyond the current end point may be stale. But it's
746+
* possible - at least in the case of a parallel sort - to sort
747+
* such small amount of data that we do not fill the buffer even
748+
* once. Tell valgrind that its contents are defined, so it
749+
* doesn't bleat.
750+
*/
751+
VALGRIND_MAKE_MEM_DEFINED(lt->buffer+lt->nbytes,
752+
lt->buffer_size-lt->nbytes);
753+
742754
TapeBlockSetNBytes(lt->buffer,lt->nbytes);
743755
ltsWriteBlock(lts,lt->curBlockNumber, (void*)lt->buffer);
744756
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp