Imported Upstream version 2.61.3
[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-type-add-interface-static-realloc
158         Memcheck:Leak
159         match-leak-kinds:reachable
160         fun:realloc
161         ...
162         fun:g_type_add_interface_static
163 }
164
165 {
166         g-type-add-interface-static-calloc
167         Memcheck:Leak
168         match-leak-kinds:reachable
169         fun:calloc
170         ...
171         fun:g_type_add_interface_static
172 }
173
174 {
175         g-test-rand-init
176         Memcheck:Leak
177         fun:calloc
178         ...
179         fun:g_rand_new_with_seed_array
180         fun:test_run_seed
181         ...
182         fun:g_test_run
183 }
184
185 {
186         g-test-rand-init2
187         Memcheck:Leak
188         fun:calloc
189         ...
190         fun:g_rand_new_with_seed_array
191         ...
192         fun:get_global_random
193         ...
194         fun:g_test_init
195 }
196
197 {
198         g-quark-table-new
199         Memcheck:Leak
200         fun:g_hash_table_new
201         ...
202         fun:quark_new
203 }
204
205 {
206         g-quark-table-resize
207         Memcheck:Leak
208         ...
209         fun:g_hash_table_resize
210         ...
211         fun:quark_new
212 }
213
214 {
215         g-type-interface-init
216         Memcheck:Leak
217         fun:malloc
218         ...
219         fun:type_iface_vtable_base_init_Wm
220 }
221
222 {
223         g-type-class-init-calloc
224         Memcheck:Leak
225         match-leak-kinds:reachable
226         fun:calloc
227         ...
228         fun:type_class_init_Wm
229 }
230
231 {
232         g-type-class-init
233         Memcheck:Leak
234         fun:g_type_create_instance
235         ...
236         fun:type_class_init_Wm
237 }
238
239 {
240         g-object-do-class-init-signals
241         Memcheck:Leak
242         match-leak-kinds:reachable
243         ...
244         fun:g_signal_new
245         ...
246         fun:type_class_init_Wm
247 }
248
249 {
250         g-type-prerequisites
251         Memcheck:Leak
252         match-leak-kinds:reachable
253         fun:realloc
254         ...
255         fun:type_iface_add_prerequisite_W
256 }
257
258 {
259         g-type-add-interface-check
260         Memcheck:Leak
261         match-leak-kinds:reachable
262         fun:malloc
263         ...
264         fun:g_type_add_interface_check
265         ...
266         fun:type_class_init_Wm
267 }
268
269 {
270         g-type-add-interface-check-realloc
271         Memcheck:Leak
272         match-leak-kinds:reachable
273         fun:realloc
274         ...
275         fun:g_type_add_interface_check
276         ...
277         fun:type_class_init_Wm
278 }
279
280 {
281         g-object-class-install-property
282         Memcheck:Leak
283         match-leak-kinds:reachable
284         fun:malloc
285         ...
286         fun:validate_and_install_class_property
287         ...
288         fun:type_class_init_Wm
289 }
290
291 {
292         g-param-spec-pool-new
293         Memcheck:Leak
294         match-leak-kinds:reachable
295         fun:malloc
296         ...
297         fun:g_param_spec_pool_new
298         ...
299         fun:type_class_init_Wm
300 }
301
302 # weak_locations_lock in gobject.c
303 {
304         g-weak-ref-lock
305         Memcheck:Leak
306         match-leak-kinds:reachable
307         fun:malloc
308         ...
309         fun:g_rw_lock_get_impl
310         ...
311         fun:g_weak_ref_set
312 }
313
314 {
315         g-object-base-class-init-construct-pproperties
316         Memcheck:Leak
317         match-leak-kinds:reachable
318         fun:malloc
319         ...
320         fun:g_slist_copy
321         fun:g_object_base_class_init
322         fun:type_class_init_Wm
323 }
324
325 {
326         g-type-class-ref
327         Memcheck:Leak
328         fun:calloc
329         ...
330         fun:type_class_init_Wm
331         ...
332         fun:g_type_class_ref
333 }
334
335 {
336         g-io-module-default-singleton-malloc
337         Memcheck:Leak
338         fun:malloc
339         ...
340         fun:g_type_create_instance
341         ...
342         fun:_g_io_module_get_default
343 }
344
345 {
346         g-io-module-default-singleton-calloc
347         Memcheck:Leak
348         fun:calloc
349         ...
350         fun:g_type_create_instance
351         ...
352         fun:_g_io_module_get_default
353 }
354
355 # This one seems to show up sometimes with g_type_create_instance() at the top
356 # of the stack, as well.
357 {
358         g-io-module-default-singleton
359         Memcheck:Leak
360         fun:g_type_create_instance
361         ...
362         fun:_g_io_module_get_default
363 }
364
365 {
366         g-io-module-default-singleton-module
367         Memcheck:Leak
368         fun:calloc
369         ...
370         fun:g_module_open
371         ...
372         fun:_g_io_module_get_default
373 }
374
375 {
376         g-io-module-default-singleton-name
377         Memcheck:Leak
378         fun:malloc
379         ...
380         fun:g_strdup
381         ...
382         fun:_g_io_module_get_default*
383 }
384
385 {
386         g-get-language-names-malloc
387         Memcheck:Leak
388         fun:malloc
389         ...
390         fun:g_get_language_names
391 }
392
393 {
394         g-get-language-names-calloc
395         Memcheck:Leak
396         fun:calloc
397         ...
398         fun:g_get_language_names
399 }
400
401 {
402         g-static-mutex
403         Memcheck:Leak
404         fun:malloc
405         ...
406         fun:g_static_mutex_get_mutex_impl
407 }
408
409 {
410         g-system-thread-init
411         Memcheck:Leak
412         fun:calloc
413         ...
414         fun:g_system_thread_new
415 }
416
417 {
418         g-io-module-default-proxy-resolver-gnome
419         Memcheck:Leak
420         fun:calloc
421         ...
422         fun:g_proxy_resolver_gnome_init
423         ...
424         fun:_g_io_module_get_default
425 }
426
427 # One-time getaddrinfo() configuration loading
428 {
429         g-threaded-resolver-getaddrinfo-config
430         Memcheck:Leak
431         fun:malloc
432         ...
433         fun:__resolv_conf_allocate
434         ...
435         fun:getaddrinfo
436         fun:do_lookup_by_name
437 }
438
439 # memcheck checks that the third argument to ioctl() is a valid pointer, but
440 # some ioctls use that argument as an integer
441 {
442    ioctl-with-non-pointer-param
443    Memcheck:Param
444    ioctl(generic)
445    fun:ioctl
446    fun:btrfs_reflink_with_progress
447 }
448
449 {
450         g-private-get
451         drd:ConflictingAccess
452         fun:g_private_get
453 }
454 {
455         g-private-get-helgrind
456         Helgrind:Race
457         fun:g_private_get
458 }
459
460
461 {
462         g-private-set
463         drd:ConflictingAccess
464         fun:g_private_set
465 }
466 {
467         g-private-set-helgrind
468         Helgrind:Race
469         fun:g_private_set
470 }
471
472 {
473         g-type-construct-free
474         drd:ConflictingAccess
475         fun:g_type_free_instance
476 }
477 {
478         g-type-construct-free-helgrind
479         Helgrind:Race
480         fun:g_type_free_instance
481 }
482
483 {
484         g-variant-unref
485         drd:ConflictingAccess
486         fun:g_variant_unref
487 }
488 {
489         g-variant-unref-helgrind
490         Helgrind:Race
491         fun:g_variant_unref
492 }
493
494 {
495         g-unix-signals-main
496         drd:ConflictingAccess
497         fun:_g_main_create_unix_signal_watch
498 }
499 {
500         g-unix-signals-dispatch
501         drd:ConflictingAccess
502         ...
503         fun:dispatch_unix_signals*
504 }
505 {
506         g-unix-signals-dispatch-helgrind
507         Helgrind:Race
508         ...
509         fun:dispatch_unix_signals*
510 }
511 {
512         g-unix-signals-other
513         drd:ConflictingAccess
514         fun:g_unix_signal_watch*
515 }
516 {
517         g-unix-signals-other-helgrind
518         Helgrind:Race
519         fun:g_unix_signal_watch*
520 }
521 {
522         g-unix-signals-handler
523         drd:ConflictingAccess
524         fun:g_unix_signal_handler*
525 }
526 {
527         g-unix-signals-handler-helgrind
528         Helgrind:Race
529         fun:g_unix_signal_handler*
530 }
531 {
532         g-unix-signals-worker
533         drd:ConflictingAccess
534         fun:glib_worker_main
535 }
536 {
537         g-unix-signals-worker-helgrind
538         Helgrind:Race
539         fun:glib_worker_main
540 }
541
542 {
543         g-wakeup-acknowledge
544         drd:ConflictingAccess
545         fun:read
546         fun:g_wakeup_acknowledge
547 }
548
549 {
550         g-type-fundamental
551         drd:ConflictingAccess
552         fun:g_type_fundamental
553 }
554 {
555         g-type-fundamental-helgrind
556         Helgrind:Race
557         fun:g_type_fundamental
558 }
559 {
560         g-type-class-peek-static
561         drd:ConflictingAccess
562         fun:g_type_class_peek_static
563 }
564 {
565         g-type-class-peek-static-helgrind
566         Helgrind:Race
567         fun:g_type_class_peek_static
568 }
569 {
570         g-type-is-a
571         drd:ConflictingAccess
572         ...
573         fun:g_type_is_a
574 }
575 {
576         g-type-is-a-helgrind
577         Helgrind:Race
578         ...
579         fun:g_type_is_a
580 }
581
582 {
583         g-inet-address-get-type
584         drd:ConflictingAccess
585         fun:g_inet_address_get_type
586 }
587 {
588         g-inet-address-get-type-helgrind
589         Helgrind:Race
590         fun:g_inet_address_get_type
591 }
592
593 # From: https://github.com/fredericgermain/valgrind/blob/master/glibc-2.X-drd.supp
594 {
595         drd-libc-stdio
596         drd:ConflictingAccess
597         obj:*/lib*/libc-*
598 }
599 {
600         drd-libc-recv
601         drd:ConflictingAccess
602         fun:recv
603 }
604 {
605         drd-libc-send
606         drd:ConflictingAccess
607         fun:send
608 }
609
610 # GSources do an opportunistic ref count check
611 {
612         g-source-set-ready-time
613         drd:ConflictingAccess
614         fun:g_source_set_ready_time
615 }
616 {
617         g-source-set-ready-time-helgrind
618         Helgrind:Race
619         fun:g_source_set_ready_time
620 }
621
622 {
623         g-source-iter-next
624         Helgrind:Race
625         fun:g_source_iter_next
626         fun:g_main_context_*
627         fun:g_main_context_iterate
628 }
629
630 {
631         g-object-instance-private
632         drd:ConflictingAccess
633         fun:*_get_instance_private
634 }
635 {
636         g-object-instance-private-helgrind
637         Helgrind:Race
638         fun:*_get_instance_private
639 }
640
641 # GLib legitimately calls pthread_cond_signal without a mutex held
642 {
643         g-task-thread-complete
644         drd:CondErr
645         ...
646         fun:g_cond_signal
647         fun:g_task_thread_complete
648 }
649 {
650         g-task-thread-complete
651         Helgrind:Misc
652         ...
653         fun:g_cond_signal
654         fun:g_task_thread_complete
655 }
656
657 # False positive, but I can't explain how (FIXME)
658 {
659         g-task-cond
660         Helgrind:Misc
661         ...
662         fun:g_cond_clear
663         fun:g_task_finalize
664 }
665
666 # Real race, but is_cancelled() is an opportunistic function anyway
667 {
668         g-cancellable-is-cancelled
669         Helgrind:Race
670         fun:g_cancellable_is_cancelled
671 }
672
673 # False positive
674 {
675         g-main-context-cond
676         Helgrind:Misc
677         ...
678         fun:g_cond_clear
679         fun:g_main_context_unref
680 }
681
682 # False positives
683 {
684         g-source-unlocked
685         Helgrind:Race
686         fun:g_source_*_unlocked
687 }
688 {
689         g-source-internal
690         Helgrind:Race
691         fun:g_source_*_internal
692 }
693
694 # False positive
695 {
696         g_object_real_dispose
697         Helgrind:Race
698         fun:g_object_real_dispose
699 }
700
701 # False positive
702 {
703         g_object_new_valist
704         Helgrind:Race
705         ...
706         fun:g_object_new_valist
707 }
708
709 # g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
710 {
711         g_set_user_dirs_str
712         Memcheck:Leak
713         fun:malloc
714         ...
715         fun:set_str_if_different
716         fun:g_set_user_dirs
717 }
718
719 # g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
720 {
721         g_set_user_dirs_strv
722         Memcheck:Leak
723         fun:malloc
724         ...
725         fun:set_strv_if_different
726         fun:g_set_user_dirs
727 }
728
729 # g_get_system_data_dirs() caches a one-time allocation
730 {
731         g_get_system_data_dirs
732         Memcheck:Leak
733         fun:malloc
734         ...
735         fun:g_build_system_data_dirs
736         fun:g_get_system_data_dirs
737 }
738
739 # g_get_user_data_dir() caches a one-time allocation
740 {
741         g_get_user_data_dir
742         Memcheck:Leak
743         fun:realloc
744         ...
745         fun:g_build_user_data_dir
746         fun:g_get_user_data_dir
747 }
748
749 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
750 {
751         desktop_file_dirs_malloc
752         Memcheck:Leak
753         fun:malloc
754         ...
755         fun:desktop_file_dirs_lock
756 }
757
758 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
759 {
760         desktop_file_dirs_realloc
761         Memcheck:Leak
762         fun:realloc
763         ...
764         fun:desktop_file_dirs_lock
765 }
766
767 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
768 {
769         desktop_file_dir_unindexed_setup_search
770         Memcheck:Leak
771         fun:malloc
772         ...
773         fun:desktop_file_dir_unindexed_setup_search
774         fun:desktop_file_dir_unindexed_setup_search
775 }
776
777 # g_io_extension_point_register() caches a one-time allocation global table of @extension_points.
778 {
779         g_io_extension_point_register
780         Memcheck:Leak
781         fun:calloc
782         ...
783         fun:g_io_extension_point_register
784 }
785
786 # g_strerror() caches a one-time allocation global table of @errors.
787 {
788         g_strerror
789         Memcheck:Leak
790         fun:malloc
791         ...
792         fun:g_locale_to_utf8
793         fun:g_strerror
794 }
795
796 # g_socket_connection_factory_register_type() caches a one-time allocation global table of @connection_types.
797 {
798         g_socket_connection_factory_register_type
799         Memcheck:Leak
800         fun:calloc
801         ...
802         fun:g_socket_connection_factory_register_type
803 }
804
805 # g_dbus_error_quark() never unregisters itself as a GDBusError domain, as it’s always available
806 {
807         g_dbus_error_quark
808         Memcheck:Leak
809         fun:calloc
810         ...
811         fun:g_dbus_error_register_error_domain
812         fun:g_dbus_error_quark
813 }
814
815 # Thread-private data allocated once per thread
816 {
817         g_private_set_alloc0
818         Memcheck:Leak
819         fun:malloc
820         ...
821         fun:g_private_set_alloc0
822 }
823 {
824         g_private_set_alloc0-calloc
825         Memcheck:Leak
826         fun:calloc
827         ...
828         fun:g_private_set_alloc0
829 }
830
831 # Thread-private GMainContext stack
832 {
833         g_main_context_push_thread_default
834         Memcheck:Leak
835         fun:malloc
836         ...
837         fun:g_queue_new
838         fun:g_main_context_push_thread_default
839 }
840
841 # One-time allocations for #GFileInfo attribute cache
842 {
843         g_file_info_attribute_cache
844         Memcheck:Leak
845         fun:malloc
846         ...
847         fun:ensure_attribute_hash
848         ...
849         fun:g_file_*
850 }
851 {
852         g_file_info_attribute_cache2
853         Memcheck:Leak
854         fun:calloc
855         ...
856         fun:ensure_attribute_hash
857         ...
858         fun:g_file_*
859 }
860 {
861         g_file_info_attribute_cache3
862         Memcheck:Leak
863         fun:malloc
864         ...
865         fun:lookup_namespace
866         ...
867         fun:g_file_*
868 }
869 {
870         g_file_info_attribute_cache4
871         Memcheck:Leak
872         fun:calloc
873         ...
874         fun:lookup_namespace
875         ...
876         fun:g_file_*
877 }