Imported Upstream version 2.59.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         glib-init-malloc
66         Memcheck:Leak
67         fun:malloc
68         ...
69         fun:g_quark_init
70         ...
71         fun:glib_init_ctor
72 }
73
74 {
75         glib-init-calloc
76         Memcheck:Leak
77         fun:calloc
78         ...
79         fun:g_quark_init
80         ...
81         fun:glib_init_ctor
82 }
83
84 {
85         gobject-init-malloc
86         Memcheck:Leak
87         fun:malloc
88         ...
89         fun:gobject_init_ctor
90 }
91
92 {
93         gobject-init-realloc
94         Memcheck:Leak
95         fun:realloc
96         ...
97         fun:gobject_init_ctor
98 }
99
100 {
101         gobject-init-calloc
102         Memcheck:Leak
103         fun:calloc
104         ...
105         fun:gobject_init_ctor
106 }
107
108 {
109         g-type-register-dynamic
110         Memcheck:Leak
111         fun:malloc
112         ...
113         fun:g_type_register_dynamic
114 }
115
116 {
117         g-type-register-static
118         Memcheck:Leak
119         fun:malloc
120         ...
121         fun:g_type_register_static
122 }
123
124 {
125         g-type-register-static-realloc
126         Memcheck:Leak
127         fun:realloc
128         ...
129         fun:g_type_register_static
130 }
131
132 {
133         g-type-register-static-calloc
134         Memcheck:Leak
135         fun:calloc
136         ...
137         fun:g_type_register_static
138 }
139
140 {
141         g-type-add-interface-dynamic
142         Memcheck:Leak
143         fun:malloc
144         ...
145         fun:g_type_add_interface_dynamic
146 }
147
148 {
149         g-type-add-interface-static
150         Memcheck:Leak
151         fun:malloc
152         ...
153         fun:g_type_add_interface_static
154 }
155
156 {
157         g-test-rand-init
158         Memcheck:Leak
159         fun:calloc
160         ...
161         fun:g_rand_new_with_seed_array
162         fun:test_run_seed
163         ...
164         fun:g_test_run
165 }
166
167 {
168         g-test-rand-init2
169         Memcheck:Leak
170         fun:calloc
171         ...
172         fun:g_rand_new_with_seed_array
173         ...
174         fun:get_global_random
175         ...
176         fun:g_test_init
177 }
178
179 {
180         g-quark-table-new
181         Memcheck:Leak
182         fun:g_hash_table_new
183         ...
184         fun:quark_new
185 }
186
187 {
188         g-quark-table-resize
189         Memcheck:Leak
190         fun:g_hash_table_resize
191         ...
192         fun:quark_new
193 }
194
195 {
196         g-type-interface-init
197         Memcheck:Leak
198         fun:malloc
199         ...
200         fun:type_iface_vtable_base_init_Wm
201 }
202
203 {
204         g-type-class-init
205         Memcheck:Leak
206         fun:g_type_create_instance
207         ...
208         fun:type_class_init_Wm
209 }
210
211 {
212         g-io-module-default-singleton-malloc
213         Memcheck:Leak
214         fun:malloc
215         ...
216         fun:g_type_create_instance
217         ...
218         fun:_g_io_module_get_default
219 }
220
221 {
222         g-io-module-default-singleton-module
223         Memcheck:Leak
224         fun:calloc
225         ...
226         fun:g_module_open
227         ...
228         fun:_g_io_module_get_default
229 }
230
231 {
232         g-io-module-default-singleton-name
233         Memcheck:Leak
234         fun:malloc
235         ...
236         fun:g_strdup
237         ...
238         fun:_g_io_module_get_default*
239 }
240
241 {
242         g-get-language-names-malloc
243         Memcheck:Leak
244         fun:malloc
245         ...
246         fun:g_get_language_names
247 }
248
249 {
250         g-get-language-names-calloc
251         Memcheck:Leak
252         fun:calloc
253         ...
254         fun:g_get_language_names
255 }
256
257 {
258         g-static-mutex
259         Memcheck:Leak
260         fun:malloc
261         ...
262         fun:g_static_mutex_get_mutex_impl
263 }
264
265 {
266         g-system-thread-init
267         Memcheck:Leak
268         fun:calloc
269         ...
270         fun:g_system_thread_new
271 }
272
273 {
274         g-io-module-default-proxy-resolver-gnome
275         Memcheck:Leak
276         fun:calloc
277         ...
278         fun:g_proxy_resolver_gnome_init
279         ...
280         fun:_g_io_module_get_default
281 }
282
283 # One-time getaddrinfo() configuration loading
284 {
285         g-threaded-resolver-getaddrinfo-config
286         Memcheck:Leak
287         fun:malloc
288         ...
289         fun:__resolv_conf_allocate
290         ...
291         fun:getaddrinfo
292         fun:do_lookup_by_name
293 }
294
295 # memcheck checks that the third argument to ioctl() is a valid pointer, but
296 # some ioctls use that argument as an integer
297 {
298    ioctl-with-non-pointer-param
299    Memcheck:Param
300    ioctl(generic)
301    fun:ioctl
302    fun:btrfs_reflink_with_progress
303 }
304
305 {
306         g-private-get
307         drd:ConflictingAccess
308         fun:g_private_get
309 }
310 {
311         g-private-get-helgrind
312         Helgrind:Race
313         fun:g_private_get
314 }
315
316
317 {
318         g-private-set
319         drd:ConflictingAccess
320         fun:g_private_set
321 }
322 {
323         g-private-set-helgrind
324         Helgrind:Race
325         fun:g_private_set
326 }
327
328 {
329         g-type-construct-free
330         drd:ConflictingAccess
331         fun:g_type_free_instance
332 }
333 {
334         g-type-construct-free-helgrind
335         Helgrind:Race
336         fun:g_type_free_instance
337 }
338
339 {
340         g-variant-unref
341         drd:ConflictingAccess
342         fun:g_variant_unref
343 }
344 {
345         g-variant-unref-helgrind
346         Helgrind:Race
347         fun:g_variant_unref
348 }
349
350 {
351         g-unix-signals-main
352         drd:ConflictingAccess
353         fun:_g_main_create_unix_signal_watch
354 }
355 {
356         g-unix-signals-dispatch
357         drd:ConflictingAccess
358         ...
359         fun:dispatch_unix_signals*
360 }
361 {
362         g-unix-signals-dispatch-helgrind
363         Helgrind:Race
364         ...
365         fun:dispatch_unix_signals*
366 }
367 {
368         g-unix-signals-other
369         drd:ConflictingAccess
370         fun:g_unix_signal_watch*
371 }
372 {
373         g-unix-signals-other-helgrind
374         Helgrind:Race
375         fun:g_unix_signal_watch*
376 }
377 {
378         g-unix-signals-handler
379         drd:ConflictingAccess
380         fun:g_unix_signal_handler*
381 }
382 {
383         g-unix-signals-handler-helgrind
384         Helgrind:Race
385         fun:g_unix_signal_handler*
386 }
387 {
388         g-unix-signals-worker
389         drd:ConflictingAccess
390         fun:glib_worker_main
391 }
392 {
393         g-unix-signals-worker-helgrind
394         Helgrind:Race
395         fun:glib_worker_main
396 }
397
398 {
399         g-wakeup-acknowledge
400         drd:ConflictingAccess
401         fun:read
402         fun:g_wakeup_acknowledge
403 }
404
405 {
406         g-type-fundamental
407         drd:ConflictingAccess
408         fun:g_type_fundamental
409 }
410 {
411         g-type-fundamental-helgrind
412         Helgrind:Race
413         fun:g_type_fundamental
414 }
415 {
416         g-type-class-peek-static
417         drd:ConflictingAccess
418         fun:g_type_class_peek_static
419 }
420 {
421         g-type-class-peek-static-helgrind
422         Helgrind:Race
423         fun:g_type_class_peek_static
424 }
425 {
426         g-type-is-a
427         drd:ConflictingAccess
428         ...
429         fun:g_type_is_a
430 }
431 {
432         g-type-is-a-helgrind
433         Helgrind:Race
434         ...
435         fun:g_type_is_a
436 }
437
438 {
439         g-inet-address-get-type
440         drd:ConflictingAccess
441         fun:g_inet_address_get_type
442 }
443 {
444         g-inet-address-get-type-helgrind
445         Helgrind:Race
446         fun:g_inet_address_get_type
447 }
448
449 # From: https://github.com/fredericgermain/valgrind/blob/master/glibc-2.X-drd.supp
450 {
451         drd-libc-stdio
452         drd:ConflictingAccess
453         obj:*/lib*/libc-*
454 }
455 {
456         drd-libc-recv
457         drd:ConflictingAccess
458         fun:recv
459 }
460 {
461         drd-libc-send
462         drd:ConflictingAccess
463         fun:send
464 }
465
466 # GSources do an opportunistic ref count check
467 {
468         g-source-set-ready-time
469         drd:ConflictingAccess
470         fun:g_source_set_ready_time
471 }
472 {
473         g-source-set-ready-time-helgrind
474         Helgrind:Race
475         fun:g_source_set_ready_time
476 }
477
478 {
479         g-source-iter-next
480         Helgrind:Race
481         fun:g_source_iter_next
482         fun:g_main_context_*
483         fun:g_main_context_iterate
484 }
485
486 {
487         g-object-instance-private
488         drd:ConflictingAccess
489         fun:*_get_instance_private
490 }
491 {
492         g-object-instance-private-helgrind
493         Helgrind:Race
494         fun:*_get_instance_private
495 }
496
497 # GLib legitimately calls pthread_cond_signal without a mutex held
498 {
499         g-task-thread-complete
500         drd:CondErr
501         ...
502         fun:g_cond_signal
503         fun:g_task_thread_complete
504 }
505 {
506         g-task-thread-complete
507         Helgrind:Misc
508         ...
509         fun:g_cond_signal
510         fun:g_task_thread_complete
511 }
512
513 # False positive, but I can't explain how (FIXME)
514 {
515         g-task-cond
516         Helgrind:Misc
517         ...
518         fun:g_cond_clear
519         fun:g_task_finalize
520 }
521
522 # Real race, but is_cancelled() is an opportunistic function anyway
523 {
524         g-cancellable-is-cancelled
525         Helgrind:Race
526         fun:g_cancellable_is_cancelled
527 }
528
529 # False positive
530 {
531         g-main-context-cond
532         Helgrind:Misc
533         ...
534         fun:g_cond_clear
535         fun:g_main_context_unref
536 }
537
538 # False positives
539 {
540         g-source-unlocked
541         Helgrind:Race
542         fun:g_source_*_unlocked
543 }
544 {
545         g-source-internal
546         Helgrind:Race
547         fun:g_source_*_internal
548 }
549
550 # False positive
551 {
552         g_object_real_dispose
553         Helgrind:Race
554         fun:g_object_real_dispose
555 }
556
557 # False positive
558 {
559         g_object_new_valist
560         Helgrind:Race
561         ...
562         fun:g_object_new_valist
563 }
564
565 # g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
566 {
567         g_set_user_dirs_str
568         Memcheck:Leak
569         fun:malloc
570         ...
571         fun:set_str_if_different
572         fun:g_set_user_dirs
573 }
574
575 # g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
576 {
577         g_set_user_dirs_strv
578         Memcheck:Leak
579         fun:malloc
580         ...
581         fun:set_strv_if_different
582         fun:g_set_user_dirs
583 }
584
585 # g_get_system_data_dirs() caches a one-time allocation
586 {
587         g_get_system_data_dirs
588         Memcheck:Leak
589         fun:malloc
590         ...
591         fun:g_build_system_data_dirs
592         fun:g_get_system_data_dirs
593 }
594
595 # g_get_user_data_dir() caches a one-time allocation
596 {
597         g_get_user_data_dir
598         Memcheck:Leak
599         fun:realloc
600         ...
601         fun:g_build_user_data_dir
602         fun:g_get_user_data_dir
603 }
604
605 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
606 {
607         desktop_file_dirs_malloc
608         Memcheck:Leak
609         fun:malloc
610         ...
611         fun:desktop_file_dirs_lock
612 }
613
614 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
615 {
616         desktop_file_dirs_realloc
617         Memcheck:Leak
618         fun:realloc
619         ...
620         fun:desktop_file_dirs_lock
621 }
622
623 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
624 {
625         desktop_file_dir_unindexed_setup_search
626         Memcheck:Leak
627         fun:malloc
628         ...
629         fun:desktop_file_dir_unindexed_setup_search
630         fun:desktop_file_dir_unindexed_setup_search
631 }
632
633 # g_io_extension_point_register() caches a one-time allocation global table of @extension_points.
634 {
635         g_io_extension_point_register
636         Memcheck:Leak
637         fun:calloc
638         ...
639         fun:g_io_extension_point_register
640 }
641
642 # g_strerror() caches a one-time allocation global table of @errors.
643 {
644         g_strerror
645         Memcheck:Leak
646         fun:malloc
647         ...
648         fun:g_locale_to_utf8
649         fun:g_strerror
650 }
651
652 # g_socket_connection_factory_register_type() caches a one-time allocation global table of @connection_types.
653 {
654         g_socket_connection_factory_register_type
655         Memcheck:Leak
656         fun:calloc
657         ...
658         fun:g_socket_connection_factory_register_type
659 }
660
661 # g_dbus_error_quark() never unregisters itself as a GDBusError domain, as it’s always available
662 {
663         g_dbus_error_quark
664         Memcheck:Leak
665         fun:calloc
666         ...
667         fun:g_dbus_error_register_error_domain
668         fun:g_dbus_error_quark
669 }
670
671 # Thread-private data allocated once per thread
672 {
673         g_private_set_alloc0
674         Memcheck:Leak
675         fun:malloc
676         ...
677         fun:g_private_set_alloc0
678 }
679
680 # Thread-private GMainContext stack
681 {
682         g_main_context_push_thread_default
683         Memcheck:Leak
684         fun:malloc
685         ...
686         fun:g_queue_new
687         fun:g_main_context_push_thread_default
688 }
689
690 # One-time allocations for #GFileInfo attribute cache
691 {
692         g_file_info_attribute_cache
693         Memcheck:Leak
694         fun:malloc
695         ...
696         fun:ensure_attribute_hash
697         ...
698         fun:g_file_*
699 }
700 {
701         g_file_info_attribute_cache2
702         Memcheck:Leak
703         fun:calloc
704         ...
705         fun:ensure_attribute_hash
706         ...
707         fun:g_file_*
708 }
709 {
710         g_file_info_attribute_cache3
711         Memcheck:Leak
712         fun:malloc
713         ...
714         fun:lookup_namespace
715         ...
716         fun:g_file_*
717 }
718 {
719         g_file_info_attribute_cache4
720         Memcheck:Leak
721         fun:calloc
722         ...
723         fun:lookup_namespace
724         ...
725         fun:g_file_*
726 }