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