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

Commitc45b1d2

Browse files
committed
Fix initialization of dsa.c free area counter.
The backend local copy of dsa_area_control->freed_segment_counter wasnot properly initialized / maintained. This could, if unlucky, leadto keeping attached to a segment for too long.Found via valgrind bleat on buildfarm animal skink.Author: Thomas MunroDiscussion:https://postgr.es/m/20170407164935.obsf2jipjfos5zei@alap3.anarazel.de
1 parent8f0530f commitc45b1d2

File tree

1 file changed

+2
-0
lines changed
  • src/backend/utils/mmgr

1 file changed

+2
-0
lines changed

‎src/backend/utils/mmgr/dsa.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1244,6 +1244,7 @@ create_internal(void *place, size_t size,
12441244
area->mapping_pinned= false;
12451245
memset(area->segment_maps,0,sizeof(dsa_segment_map)*DSA_MAX_SEGMENTS);
12461246
area->high_segment_index=0;
1247+
area->freed_segment_counter=0;
12471248
LWLockInitialize(&control->lock,control->lwlock_tranche_id);
12481249
for (i=0;i<DSA_NUM_SIZE_CLASSES;++i)
12491250
LWLockInitialize(DSA_SCLASS_LOCK(area,i),
@@ -1322,6 +1323,7 @@ attach_internal(void *place, dsm_segment *segment, dsa_handle handle)
13221323
errmsg("could not attach to dynamic shared area")));
13231324
}
13241325
++control->refcnt;
1326+
area->freed_segment_counter=area->control->freed_segment_counter;
13251327
LWLockRelease(DSA_AREA_LOCK(area));
13261328

13271329
returnarea;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp