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