-
Notifications
You must be signed in to change notification settings - Fork 15
/
spock.supp
495 lines (448 loc) · 9.09 KB
/
spock.supp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# We don't care about leaks in work done only once
# during startup, so suppress them. We could possibly free
# these cleanly, but ... meh.
{
spk_apply_start_sync_sub
Memcheck:Leak
match-leak-kinds: possible,definite,reachable
fun:*lloc*
...
fun:spock_sync_subscription
fun:spock_apply_main
}
{
spk_apply_start_getsub
Memcheck:Leak
match-leak-kinds: possible,definite,reachable
fun:*lloc*
...
fun:get_subscription
fun:spock_apply_main
}
{
spk_apply_start_queuetable
Memcheck:Leak
match-leak-kinds: possible,definite,reachable
fun:*lloc*
...
fun:get_queue_table_oid
fun:spock_apply_main
}
{
spk_apply_start_bgw
Memcheck:Leak
match-leak-kinds: possible,definite,reachable
fun:*lloc*
...
fun:BackgroundWorkerInitializeConnectionByOid
fun:spock_apply_main
}
{
spk_apply_start_replorigin
Memcheck:Leak
match-leak-kinds: possible,definite,reachable
fun:*lloc*
...
fun:replorigin_by_name
fun:spock_apply_main
}
{
spk_apply_start_resowner
Memcheck:Leak
match-leak-kinds: definite,definite,reachable
fun:*lloc*
...
fun:ResourceOwnerCreate
fun:spock_apply_main
}
{
spk_bgw_init
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:RegisterBackgroundWorker
fun:_PG_init
}
#
# spock's relcache persists across txns.
#
# These allocations are in CacheMemoryContext.
#
{
spk_relcache_update
Memcheck:Leak
match-leak-kinds: possible
fun:*lloc*
...
fun:spock_relation_cache_update
...
fun:apply_work
}
{
spk_relcache_open
Memcheck:Leak
match-leak-kinds: reachable
fun:*lloc*
...
fun:spock_relation_open
}
#
#
# These produce a lot of noise. They may be real leaks and need looking into,
# but are suppressed for now while I look for other issues. Pg should complain
# if we fail to close an opened relation.
#
{
spk_relation
Memcheck:Leak
match-leak-kinds: possible
fun:*lloc*
...
fun:relation_open
}
{
spk_relation
Memcheck:Leak
match-leak-kinds: possible
fun:*lloc*
...
fun:relation_open
}
#
# XXX
#
# Valgrind keeps claiming that bms_copy escapes heap_update. I cannot find how
# that could be happening. We'll suppress the report for now on the assumption
# that anything happening this deep in Pg should be causing much greater upset
# than in spk, but it merits further digging.
#
{
spk_pg_bms_copy
Memcheck:Leak
match-leak-kinds: reachable
fun:palloc
fun:bms_copy
fun:RelationGetIndexAttrBitmap
fun:heap_update
...
fun:standard_ProcessUtility
fun:spock_ProcessUtility
...
fun:handle_sql
...
fun:apply_work
}
# Anything else in standard_ProcessUtility called via spock_ProcessUtility
# during spk SQL execution.
#
# This MUST not be invoked in TopMemoryContext, and so long as txn state is sane
# cannot then allocate into TopMemoryContext. (Shame Valgrind doesn't let us name
# mempools for allocations).
{
spk_sql_processutility
Memcheck:Leak
match-leak-kinds: reachable,possible
fun:*lloc*
...
fun:standard_ProcessUtility
fun:spock_ProcessUtility
...
fun:handle_sql
...
fun:apply_work
fun:spock_apply_main
}
#
# XXX uncertain
#
# We're a bit suss about this one
#
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: possible
fun:MemoryContextAlloc
fun:MemoryContextStrdup
fun:spock_relation_cache_update
fun:spock_read_rel
fun:handle_relation
fun:replication_handler
fun:apply_work
}
#
# Core postgres noise. It doesn't try to be memcheck friendly.
#
{
pg_conffile
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
...
fun:guc_strdup
...
fun:ProcessConfigFile
}
{
pg_start
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:BackendStartup
fun:ServerLoop
fun:PostmasterMain
fun:main
}
{
pg_bgw
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
...
fun:do_start_bgworker
fun:maybe_start_bgworkers
}
{
pg_bgw_register
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:RegisterBackgroundWorker
fun:ApplyLauncherRegister
fun:PostmasterMain
fun:main
}
{
pg_init_locks
Memcheck:Leak
match-leak-kinds: possible
fun:MemoryContextAlloc*
...
fun:InitLocks
fun:CreateSharedMemoryAndSemaphores
fun:reset_shared
fun:PostmasterMain
fun:main
}
{
pg_bgw_state
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:BackgroundWorkerStateChange
}
{
pg_ps_display
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:save_ps_display_args
fun:main
}
#
# Pg's hash impl looks like it confuses valgrind
# (but verify TODO)
#
{
pg_hash
Memcheck:Leak
match-leak-kinds: possible
...
fun:element_alloc
fun:get_hash_entry
fun:hash_search_with_hash_value
}
{
pg_pmmain_blah
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:strdup
fun:PostmasterMain
fun:main
}
{
pg_tz
Memcheck:Leak
match-leak-kinds: possible
fun:MemoryContextAlloc
fun:element_alloc
fun:hash_create
fun:init_timezone_hashtable
fun:pg_tzset
fun:pg_timezone_initialize
fun:InitializeGUCOptions
fun:PostmasterMain
fun:main
}
{
pg_vac
Memcheck:Leak
match-leak-kinds: possible
fun:malloc
fun:StartAutovacuumWorker
}
{
pg_InitPostgres
Memcheck:Leak
match-leak-kinds: possible
fun:*lloc*
...
fun:InitPostgres
fun:PostgresMain
}
# "reachable"-only suppressions. These are used when we're looking for memory
# we can still access but are progressively allocating more of during long
# running processes like the apply worker our output plugin. To find them
# we must exclude things we're keeping around on purpose.
#
# This is allocated once on entry to apply_work
{
spk_reachable_msgcontext
Memcheck:Leak
match-leak-kinds: reachable
fun:MemoryContextAlloc
fun:MemoryContextCreate
fun:AllocSetContextCreate
fun:apply_work
fun:spock_apply_main
}
# This is stashed in a static var on first allocation and reused. It
# shouldn't grow.
{
spk_reachable_feedback
Memcheck:Leak
match-leak-kinds: reachable
fun:palloc
...
fun:makeStringInfo
fun:send_feedback
fun:apply_work
fun:spock_apply_main
}
# It's typical for syscache and catcache entries to live beyond a single txn.
# That's kind of the point. If spk fails to release cache entries that's not
# something we can detect easily, except maybe with CLOBBER_CACHE_ALWAYS,
# which runs like treacle under valgrind.
{
pg_reachable_catcache
Memcheck:Leak
match-leak-kinds: reachable,possible
fun:*lloc*
...
fun:SearchCatCache
}
# RelationGetIndexList adds indexes to the relcache. But importantly
# it returns a list_copy of the result, so we must not filter out the
# allocation there, only the cached stuff.
{
pg_reachable_indexlist
Memcheck:Leak
match-leak-kinds: reachable
fun:MemoryContextAlloc*
...
fun:index_open
...
fun:RelationGetIndexList
}
# GUCs normally have extended lifetimes
{
pg_reachable_guc
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:strdup
fun:guc_strdup
}
{
pg_reachable_guc_check
Memcheck:Leak
match-leak-kinds: reachable,possible
fun:*lloc*
fun:check_role
...
fun:parse_and_validate_value
fun:set_config_option
}
# Lots of things in standard_ProcessUtility mess with the syscache
# and they're not going to leak.
{
pg_reachable_processutility
Memcheck:Leak
match-leak-kinds: reachable
fun:*lloc*
...
fun:relation_open
...
fun:standard_ProcessUtility
}
# The smgr and md layer keep track of their own resources. If we fail to close
# relations we should see it at a higher level. We can see these allocations
# from random heap operations because smgr relation opening happens lazily, not
# at heap_open time.
{
pg_mdopen
Memcheck:Leak
match-leak-kinds: reachable
fun:*lloc*
...
fun:mdopen
}
#
# This report looks bogus. There should be no way for the allocated wait-event
# set to escape WaitLatchOrSocket. In spk it only arises once anyway.
#
{
pg_waitlatchorsocket
Memcheck:Leak
match-leak-kinds: reachable
fun:malloc
fun:AllocSetAlloc
fun:MemoryContextAllocZero
fun:CreateWaitEventSet
fun:WaitLatchOrSocket
}
#
# If we test across a txn boundary we may see pgstat allocations, and
# that's OK, we clean them later.
#
{
pg_pgstat
Memcheck:Leak
match-leak-kinds: reachable
fun:MemoryContextAlloc
fun:get_tabstat_stack_level
}
#
# Again, lock acquisition during heap_openrv can seem to leak if
# we do a leakcheck during a txn. It's fine, pg will complain
# if we fail to close relations.
#
{
pg_heap_openrv
Memcheck:Leak
match-leak-kinds: reachable
fun:*lloc*
...
fun:heap_openrv
}
{
pg_table_openrv
Memcheck:Leak
match-leak-kinds: reachable
fun:*lloc*
...
fun:table_openrv
}
#
# Tupledescs are refcounted. Any check we do during a txn
# will show such output.
#
#{
# pg_tupledesc_count
# Memcheck:Leak
# match-leak-kinds: reachable
# fun:MemoryContextAlloc
# fun:ResourceArrayEnlarge.part.4
# fun:IncrTupleDescRefCount
# fun:ExecSetSlotDescriptor
#}