Imported Upstream version 2.59.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
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-get-language-names-malloc
233         Memcheck:Leak
234         fun:malloc
235         ...
236         fun:g_get_language_names
237 }
238
239 {
240         g-get-language-names-calloc
241         Memcheck:Leak
242         fun:calloc
243         ...
244         fun:g_get_language_names
245 }
246
247 {
248         g-static-mutex
249         Memcheck:Leak
250         fun:malloc
251         ...
252         fun:g_static_mutex_get_mutex_impl
253 }
254
255 {
256         g-system-thread-init
257         Memcheck:Leak
258         fun:calloc
259         ...
260         fun:g_system_thread_new
261 }
262
263 {
264         g-io-module-default-proxy-resolver-gnome
265         Memcheck:Leak
266         fun:calloc
267         ...
268         fun:g_proxy_resolver_gnome_init
269         ...
270         fun:_g_io_module_get_default
271 }
272
273 # One-time getaddrinfo() configuration loading
274 {
275         g-threaded-resolver-getaddrinfo-config
276         Memcheck:Leak
277         fun:malloc
278         ...
279         fun:__resolv_conf_allocate
280         ...
281         fun:getaddrinfo
282         fun:do_lookup_by_name
283 }
284
285 # memcheck checks that the third argument to ioctl() is a valid pointer, but
286 # some ioctls use that argument as an integer
287 {
288    ioctl-with-non-pointer-param
289    Memcheck:Param
290    ioctl(generic)
291    fun:ioctl
292    fun:btrfs_reflink_with_progress
293 }
294
295 {
296         g-private-get
297         drd:ConflictingAccess
298         fun:g_private_get
299 }
300 {
301         g-private-get-helgrind
302         Helgrind:Race
303         fun:g_private_get
304 }
305
306
307 {
308         g-private-set
309         drd:ConflictingAccess
310         fun:g_private_set
311 }
312 {
313         g-private-set-helgrind
314         Helgrind:Race
315         fun:g_private_set
316 }
317
318 {
319         g-type-construct-free
320         drd:ConflictingAccess
321         fun:g_type_free_instance
322 }
323 {
324         g-type-construct-free-helgrind
325         Helgrind:Race
326         fun:g_type_free_instance
327 }
328
329 {
330         g-variant-unref
331         drd:ConflictingAccess
332         fun:g_variant_unref
333 }
334 {
335         g-variant-unref-helgrind
336         Helgrind:Race
337         fun:g_variant_unref
338 }
339
340 {
341         g-unix-signals-main
342         drd:ConflictingAccess
343         fun:_g_main_create_unix_signal_watch
344 }
345 {
346         g-unix-signals-dispatch
347         drd:ConflictingAccess
348         ...
349         fun:dispatch_unix_signals*
350 }
351 {
352         g-unix-signals-dispatch-helgrind
353         Helgrind:Race
354         ...
355         fun:dispatch_unix_signals*
356 }
357 {
358         g-unix-signals-other
359         drd:ConflictingAccess
360         fun:g_unix_signal_watch*
361 }
362 {
363         g-unix-signals-other-helgrind
364         Helgrind:Race
365         fun:g_unix_signal_watch*
366 }
367 {
368         g-unix-signals-handler
369         drd:ConflictingAccess
370         fun:g_unix_signal_handler*
371 }
372 {
373         g-unix-signals-handler-helgrind
374         Helgrind:Race
375         fun:g_unix_signal_handler*
376 }
377 {
378         g-unix-signals-worker
379         drd:ConflictingAccess
380         fun:glib_worker_main
381 }
382 {
383         g-unix-signals-worker-helgrind
384         Helgrind:Race
385         fun:glib_worker_main
386 }
387
388 {
389         g-wakeup-acknowledge
390         drd:ConflictingAccess
391         fun:read
392         fun:g_wakeup_acknowledge
393 }
394
395 {
396         g-type-fundamental
397         drd:ConflictingAccess
398         fun:g_type_fundamental
399 }
400 {
401         g-type-fundamental-helgrind
402         Helgrind:Race
403         fun:g_type_fundamental
404 }
405 {
406         g-type-class-peek-static
407         drd:ConflictingAccess
408         fun:g_type_class_peek_static
409 }
410 {
411         g-type-class-peek-static-helgrind
412         Helgrind:Race
413         fun:g_type_class_peek_static
414 }
415 {
416         g-type-is-a
417         drd:ConflictingAccess
418         ...
419         fun:g_type_is_a
420 }
421 {
422         g-type-is-a-helgrind
423         Helgrind:Race
424         ...
425         fun:g_type_is_a
426 }
427
428 {
429         g-inet-address-get-type
430         drd:ConflictingAccess
431         fun:g_inet_address_get_type
432 }
433 {
434         g-inet-address-get-type-helgrind
435         Helgrind:Race
436         fun:g_inet_address_get_type
437 }
438
439 # From: https://github.com/fredericgermain/valgrind/blob/master/glibc-2.X-drd.supp
440 {
441         drd-libc-stdio
442         drd:ConflictingAccess
443         obj:*/lib*/libc-*
444 }
445 {
446         drd-libc-recv
447         drd:ConflictingAccess
448         fun:recv
449 }
450 {
451         drd-libc-send
452         drd:ConflictingAccess
453         fun:send
454 }
455
456 # GSources do an opportunistic ref count check
457 {
458         g-source-set-ready-time
459         drd:ConflictingAccess
460         fun:g_source_set_ready_time
461 }
462 {
463         g-source-set-ready-time-helgrind
464         Helgrind:Race
465         fun:g_source_set_ready_time
466 }
467
468 {
469         g-source-iter-next
470         Helgrind:Race
471         fun:g_source_iter_next
472         fun:g_main_context_*
473         fun:g_main_context_iterate
474 }
475
476 {
477         g-object-instance-private
478         drd:ConflictingAccess
479         fun:*_get_instance_private
480 }
481 {
482         g-object-instance-private-helgrind
483         Helgrind:Race
484         fun:*_get_instance_private
485 }
486
487 # GLib legitimately calls pthread_cond_signal without a mutex held
488 {
489         g-task-thread-complete
490         drd:CondErr
491         ...
492         fun:g_cond_signal
493         fun:g_task_thread_complete
494 }
495 {
496         g-task-thread-complete
497         Helgrind:Misc
498         ...
499         fun:g_cond_signal
500         fun:g_task_thread_complete
501 }
502
503 # False positive, but I can't explain how (FIXME)
504 {
505         g-task-cond
506         Helgrind:Misc
507         ...
508         fun:g_cond_clear
509         fun:g_task_finalize
510 }
511
512 # Real race, but is_cancelled() is an opportunistic function anyway
513 {
514         g-cancellable-is-cancelled
515         Helgrind:Race
516         fun:g_cancellable_is_cancelled
517 }
518
519 # False positive
520 {
521         g-main-context-cond
522         Helgrind:Misc
523         ...
524         fun:g_cond_clear
525         fun:g_main_context_unref
526 }
527
528 # False positives
529 {
530         g-source-unlocked
531         Helgrind:Race
532         fun:g_source_*_unlocked
533 }
534 {
535         g-source-internal
536         Helgrind:Race
537         fun:g_source_*_internal
538 }
539
540 # False positive
541 {
542         g_object_real_dispose
543         Helgrind:Race
544         fun:g_object_real_dispose
545 }
546
547 # False positive
548 {
549         g_object_new_valist
550         Helgrind:Race
551         ...
552         fun:g_object_new_valist
553 }
554
555 # g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
556 {
557         g_set_user_dirs_str
558         Memcheck:Leak
559         fun:malloc
560         ...
561         fun:set_str_if_different
562         fun:g_set_user_dirs
563 }
564
565 # g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
566 {
567         g_set_user_dirs_strv
568         Memcheck:Leak
569         fun:malloc
570         ...
571         fun:set_strv_if_different
572         fun:g_set_user_dirs
573 }
574
575 # g_get_system_data_dirs() caches a one-time allocation
576 {
577         g_get_system_data_dirs
578         Memcheck:Leak
579         fun:malloc
580         ...
581         fun:g_build_system_data_dirs
582         fun:g_get_system_data_dirs
583 }
584
585 # g_get_user_data_dir() caches a one-time allocation
586 {
587         g_get_user_data_dir
588         Memcheck:Leak
589         fun:realloc
590         ...
591         fun:g_build_user_data_dir
592         fun:g_get_user_data_dir
593 }
594
595 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
596 {
597         desktop_file_dirs_malloc
598         Memcheck:Leak
599         fun:malloc
600         ...
601         fun:desktop_file_dirs_lock
602 }
603
604 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
605 {
606         desktop_file_dirs_realloc
607         Memcheck:Leak
608         fun:realloc
609         ...
610         fun:desktop_file_dirs_lock
611 }
612
613 # gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
614 {
615         desktop_file_dir_unindexed_setup_search
616         Memcheck:Leak
617         fun:malloc
618         ...
619         fun:desktop_file_dir_unindexed_setup_search
620         fun:desktop_file_dir_unindexed_setup_search
621 }
622
623 # g_io_extension_point_register() caches a one-time allocation global table of @extension_points.
624 {
625         g_io_extension_point_register
626         Memcheck:Leak
627         fun:calloc
628         ...
629         fun:g_io_extension_point_register
630 }
631
632 # g_strerror() caches a one-time allocation global table of @errors.
633 {
634         g_strerror
635         Memcheck:Leak
636         fun:malloc
637         ...
638         fun:g_locale_to_utf8
639         fun:g_strerror
640 }
641
642 # g_socket_connection_factory_register_type() caches a one-time allocation global table of @connection_types.
643 {
644         g_socket_connection_factory_register_type
645         Memcheck:Leak
646         fun:calloc
647         ...
648         fun:g_socket_connection_factory_register_type
649 }
650
651 # g_dbus_error_quark() never unregisters itself as a GDBusError domain, as it’s always available
652 {
653         g_dbus_error_quark
654         Memcheck:Leak
655         fun:calloc
656         ...
657         fun:g_dbus_error_register_error_domain
658         fun:g_dbus_error_quark
659 }