Imported Upstream version 2.57.2
[platform/upstream/glib.git] / glib.supp
1 # GLib Valgrind suppressions file
2 #
3 # This provides a list of suppressions for all of GLib (including GIO), for all
4 # Valgrind tools (memcheck, drd, helgrind, etc.) for the false positives and
5 # deliberate one-time leaks which GLib causes to be reported when running under
6 # Valgrind.
7 #
8 # When running an application which links to GLib under Valgrind, you can pass
9 # this suppression file to Valgrind using --suppressions=/path/to/glib-2.0.supp.
10 #
11 # http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress
12 #
13 # Note that there is currently no way for Valgrind to load this automatically
14 # (https://bugs.kde.org/show_bug.cgi?id=160905), so the best GLib can currently
15 # do is to install this file as part of its development package.
16 #
17 # This file should be updated if GLib introduces a new deliberate one-time leak,
18 # or another false race positive in Valgrind: please file bugs at:
19 #
20 # https://gitlab.gnome.org/GNOME/glib/issues/new
21
22 {
23         gnutls-init-calloc
24         Memcheck:Leak
25         fun:calloc
26         ...
27         fun:gtls_gnutls_init
28 }
29
30 {
31         gnutls-init-realloc
32         Memcheck:Leak
33         fun:realloc
34         ...
35         fun:gtls_gnutls_init
36 }
37
38 {
39         g-tls-backend-gnutls-init
40         Memcheck:Leak
41         fun:g_once_impl
42         fun:g_tls_backend_gnutls_init
43 }
44
45 {
46         p11-tokens-init
47         Memcheck:Leak
48         fun:calloc
49         ...
50         fun:create_tokens_inlock
51         fun:initialize_module_inlock_reentrant
52 }
53
54 # One-time allocation from libc for getpwnam() results
55 {
56         g-local-vfs-getpwnam
57         Memcheck:Leak
58         fun:malloc
59         ...
60         fun:getpwnam
61         fun:g_local_vfs_parse_name
62 }
63
64 {
65         gobject-init-malloc
66         Memcheck:Leak
67         fun:malloc
68         ...
69         fun:gobject_init_ctor
70 }
71
72 {
73         gobject-init-realloc
74         Memcheck:Leak
75         fun:realloc
76         ...
77         fun:gobject_init_ctor
78 }
79
80 {
81         gobject-init-calloc
82         Memcheck:Leak
83         fun:calloc
84         ...
85         fun:gobject_init_ctor
86 }
87
88 {
89         g-type-register-dynamic
90         Memcheck:Leak
91         fun:malloc
92         ...
93         fun:g_type_register_dynamic
94 }
95
96 {
97         g-type-register-static
98         Memcheck:Leak
99         fun:malloc
100         ...
101         fun:g_type_register_static
102 }
103
104 {
105         g-type-register-static-realloc
106         Memcheck:Leak
107         fun:realloc
108         ...
109         fun:g_type_register_static
110 }
111
112 {
113         g-type-register-static-calloc
114         Memcheck:Leak
115         fun:calloc
116         ...
117         fun:g_type_register_static
118 }
119
120 {
121         g-type-add-interface-dynamic
122         Memcheck:Leak
123         fun:malloc
124         ...
125         fun:g_type_add_interface_dynamic
126 }
127
128 {
129         g-type-add-interface-static
130         Memcheck:Leak
131         fun:malloc
132         ...
133         fun:g_type_add_interface_static
134 }
135
136 {
137         g-test-rand-init
138         Memcheck:Leak
139         fun:calloc
140         ...
141         fun:g_rand_new_with_seed_array
142         fun:test_run_seed
143         ...
144         fun:g_test_run
145 }
146
147 {
148         g-test-rand-init2
149         Memcheck:Leak
150         fun:calloc
151         ...
152         fun:g_rand_new_with_seed_array
153         ...
154         fun:get_global_random
155         ...
156         fun:g_test_init
157 }
158
159 {
160         g-quark-table-new
161         Memcheck:Leak
162         fun:g_hash_table_new
163         ...
164         fun:quark_new
165 }
166
167 {
168         g-quark-table-resize
169         Memcheck:Leak
170         fun:g_hash_table_resize
171         ...
172         fun:quark_new
173 }
174
175 {
176         g-type-interface-init
177         Memcheck:Leak
178         fun:malloc
179         ...
180         fun:type_iface_vtable_base_init_Wm
181 }
182
183 {
184         g-type-class-init
185         Memcheck:Leak
186         fun:calloc
187         ...
188         fun:type_class_init_Wm
189 }
190
191 {
192         g-io-module-default-singleton-malloc
193         Memcheck:Leak
194         fun:malloc
195         ...
196         fun:g_type_create_instance
197         ...
198         fun:_g_io_module_get_default
199 }
200
201 {
202         g-io-module-default-singleton-module
203         Memcheck:Leak
204         fun:calloc
205         ...
206         fun:g_module_open
207         ...
208         fun:_g_io_module_get_default
209 }
210
211 {
212         g-get-language-names
213         Memcheck:Leak
214         fun:malloc
215         ...
216         fun:g_get_language_names
217 }
218
219 {
220         g-static-mutex
221         Memcheck:Leak
222         fun:malloc
223         ...
224         fun:g_static_mutex_get_mutex_impl
225 }
226
227 {
228         g-system-thread-init
229         Memcheck:Leak
230         fun:calloc
231         ...
232         fun:g_system_thread_new
233 }
234
235 {
236         g-io-module-default-proxy-resolver-gnome
237         Memcheck:Leak
238         fun:calloc
239         ...
240         fun:g_proxy_resolver_gnome_init
241         ...
242         fun:_g_io_module_get_default
243 }
244
245 # One-time getaddrinfo() configuration loading
246 {
247         g-threaded-resolver-getaddrinfo-config
248         Memcheck:Leak
249         fun:malloc
250         ...
251         fun:__resolv_conf_allocate
252         ...
253         fun:getaddrinfo
254         fun:do_lookup_by_name
255 }
256
257 # memcheck checks that the third argument to ioctl() is a valid pointer, but
258 # some ioctls use that argument as an integer
259 {
260    ioctl-with-non-pointer-param
261    Memcheck:Param
262    ioctl(generic)
263    fun:ioctl
264    fun:btrfs_reflink_with_progress
265 }
266
267 {
268         g-private-get
269         drd:ConflictingAccess
270         fun:g_private_get
271 }
272 {
273         g-private-get-helgrind
274         Helgrind:Race
275         fun:g_private_get
276 }
277
278
279 {
280         g-private-set
281         drd:ConflictingAccess
282         fun:g_private_set
283 }
284 {
285         g-private-set-helgrind
286         Helgrind:Race
287         fun:g_private_set
288 }
289
290 {
291         g-type-construct-free
292         drd:ConflictingAccess
293         fun:g_type_free_instance
294 }
295 {
296         g-type-construct-free-helgrind
297         Helgrind:Race
298         fun:g_type_free_instance
299 }
300
301 {
302         g-variant-unref
303         drd:ConflictingAccess
304         fun:g_variant_unref
305 }
306 {
307         g-variant-unref-helgrind
308         Helgrind:Race
309         fun:g_variant_unref
310 }
311
312 {
313         g-unix-signals-main
314         drd:ConflictingAccess
315         fun:_g_main_create_unix_signal_watch
316 }
317 {
318         g-unix-signals-dispatch
319         drd:ConflictingAccess
320         ...
321         fun:dispatch_unix_signals*
322 }
323 {
324         g-unix-signals-dispatch-helgrind
325         Helgrind:Race
326         ...
327         fun:dispatch_unix_signals*
328 }
329 {
330         g-unix-signals-other
331         drd:ConflictingAccess
332         fun:g_unix_signal_watch*
333 }
334 {
335         g-unix-signals-other-helgrind
336         Helgrind:Race
337         fun:g_unix_signal_watch*
338 }
339 {
340         g-unix-signals-handler
341         drd:ConflictingAccess
342         fun:g_unix_signal_handler*
343 }
344 {
345         g-unix-signals-handler-helgrind
346         Helgrind:Race
347         fun:g_unix_signal_handler*
348 }
349 {
350         g-unix-signals-worker
351         drd:ConflictingAccess
352         fun:glib_worker_main
353 }
354 {
355         g-unix-signals-worker-helgrind
356         Helgrind:Race
357         fun:glib_worker_main
358 }
359
360 {
361         g-wakeup-acknowledge
362         drd:ConflictingAccess
363         fun:read
364         fun:g_wakeup_acknowledge
365 }
366
367 {
368         g-type-fundamental
369         drd:ConflictingAccess
370         fun:g_type_fundamental
371 }
372 {
373         g-type-fundamental-helgrind
374         Helgrind:Race
375         fun:g_type_fundamental
376 }
377 {
378         g-type-class-peek-static
379         drd:ConflictingAccess
380         fun:g_type_class_peek_static
381 }
382 {
383         g-type-class-peek-static-helgrind
384         Helgrind:Race
385         fun:g_type_class_peek_static
386 }
387 {
388         g-type-is-a
389         drd:ConflictingAccess
390         ...
391         fun:g_type_is_a
392 }
393 {
394         g-type-is-a-helgrind
395         Helgrind:Race
396         ...
397         fun:g_type_is_a
398 }
399
400 {
401         g-inet-address-get-type
402         drd:ConflictingAccess
403         fun:g_inet_address_get_type
404 }
405 {
406         g-inet-address-get-type-helgrind
407         Helgrind:Race
408         fun:g_inet_address_get_type
409 }
410
411 # From: https://github.com/fredericgermain/valgrind/blob/master/glibc-2.X-drd.supp
412 {
413         drd-libc-stdio
414         drd:ConflictingAccess
415         obj:*/lib*/libc-*
416 }
417 {
418         drd-libc-recv
419         drd:ConflictingAccess
420         fun:recv
421 }
422 {
423         drd-libc-send
424         drd:ConflictingAccess
425         fun:send
426 }
427
428 # GSources do an opportunistic ref count check
429 {
430         g-source-set-ready-time
431         drd:ConflictingAccess
432         fun:g_source_set_ready_time
433 }
434 {
435         g-source-set-ready-time-helgrind
436         Helgrind:Race
437         fun:g_source_set_ready_time
438 }
439
440 {
441         g-source-iter-next
442         Helgrind:Race
443         fun:g_source_iter_next
444         fun:g_main_context_*
445         fun:g_main_context_iterate
446 }
447
448 {
449         g-object-instance-private
450         drd:ConflictingAccess
451         fun:*_get_instance_private
452 }
453 {
454         g-object-instance-private-helgrind
455         Helgrind:Race
456         fun:*_get_instance_private
457 }
458
459 # GLib legitimately calls pthread_cond_signal without a mutex held
460 {
461         g-task-thread-complete
462         drd:CondErr
463         ...
464         fun:g_cond_signal
465         fun:g_task_thread_complete
466 }
467 {
468         g-task-thread-complete
469         Helgrind:Misc
470         ...
471         fun:g_cond_signal
472         fun:g_task_thread_complete
473 }
474
475 # False positive, but I can't explain how (FIXME)
476 {
477         g-task-cond
478         Helgrind:Misc
479         ...
480         fun:g_cond_clear
481         fun:g_task_finalize
482 }
483
484 # Real race, but is_cancelled() is an opportunistic function anyway
485 {
486         g-cancellable-is-cancelled
487         Helgrind:Race
488         fun:g_cancellable_is_cancelled
489 }
490
491 # False positive
492 {
493         g-main-context-cond
494         Helgrind:Misc
495         ...
496         fun:g_cond_clear
497         fun:g_main_context_unref
498 }
499
500 # False positives
501 {
502         g-source-unlocked
503         Helgrind:Race
504         fun:g_source_*_unlocked
505 }
506 {
507         g-source-internal
508         Helgrind:Race
509         fun:g_source_*_internal
510 }
511
512 # False positive
513 {
514         g_object_real_dispose
515         Helgrind:Race
516         fun:g_object_real_dispose
517 }
518
519 # False positive
520 {
521         g_object_new_valist
522         Helgrind:Race
523         ...
524         fun:g_object_new_valist
525 }