about summary refs log tree commit diff stats
path: root/main.c
Commit message (Expand)AuthorAgeFilesLines
* applied Jukka's patch preventing some cornercases and making the EOF error me...arg@mig292006-11-271-1/+2
* applied yet another proposal of Manuelarg@mig292006-11-261-2/+2
* applied Jukka's sizeof K&R compliance patch, applied Manuels' last-line print...arg@mig292006-11-261-6/+8
* applied Jukka's stdinread patcharg@mig292006-11-261-2/+3
* applied Manuels patch (thanks to Manuel!)arg@mig292006-11-251-14/+21
* applied Gottox patchesarg@mig292006-11-211-2/+3
* applied Gottox' windowarea patcharg@mig292006-11-161-1/+6
* code polishing, removed unnecessary newlinesAnselm R. Garbe2006-10-061-21/+9
* removed the stack position stuffAnselm R. Garbe2006-10-051-4/+1
* keep master ratio on resizecol -> arrangeAnselm R. Garbe2006-10-051-3/+3
* added symbols for different modesAnselm R. Garbe2006-09-291-2/+5
* removed useless updatemasterAnselm R. Garbe2006-09-291-1/+1
* added the new dotile as described on mlAnselm R. Garbe2006-09-291-1/+1
* first step to a more flexible dotile() algorithmAnselm R. Garbe2006-09-291-2/+2
* applied Jukkas patcharg@mmvi2006-09-251-3/+3
* implemented the maximization as I described on the mailinglist, this feels be...arg@mmvi2006-09-221-1/+0
* removed a bunch of lines through making function signatures more consistent w...Anselm R. Garbe2006-09-121-19/+11
* applied Christof Musik's multihead patch for a pathologic cornercaseAnselm R. Garbe2006-09-121-1/+2
* fixed some other comments, now also the code side seems to be at a level to b...Anselm R. Garbe2006-09-111-2/+2
* using a global stack for focus recovery on arrange() - seems to work greatAnselm R. Garbe2006-09-071-0/+1
* small fixAnselm R. Garbe2006-09-061-0/+1
* applied Sanders max_and_focus.patchAnselm R. Garbe2006-09-041-0/+1
* trying a different configurationAnselm R. Garbe2006-08-251-3/+3
* fixed typoAnselm R. Garbe2006-08-251-1/+1
* removed a bunch of lines, made mode symbols configurableAnselm R. Garbe2006-08-251-1/+1
* new color stuff/new rendering stuffAnselm R. Garbe2006-08-251-5/+9
* back to 3 colorsAnselm R. Garbe2006-08-251-4/+3
* 3->4 colorsAnselm R. Garbe2006-08-241-3/+4
* changing tag indicator through underlineAnselm R. Garbe2006-08-241-0/+1
* removed a blank lineAnselm R. Garbe2006-08-231-1/+0
* separated setup stuff into main.c:setup() - this makes main() more readableAnselm R. Garbe2006-08-231-86/+95
* rearranged getprotoAnselm R. Garbe2006-08-221-6/+5
* removed winprop (merged into getproto)Anselm R. Garbe2006-08-221-27/+7
* removed DEFTAGAnselm R. Garbe2006-08-221-1/+1
* small renamings of two static functionsAnselm R.Garbe2006-08-211-2/+2
* small changes to dwm.1, rearranged order within main event loopAnselm R.Garbe2006-08-211-4/+4
* corrected order of cleanup code Anselm R.Garbe2006-08-161-1/+1
* we close stdin as wellAnselm R.Garbe2006-08-161-3/+4
* extended cleanupAnselm R.Garbe2006-08-151-0/+7
* applied jk_to_tab patchAnselm R.Garbe2006-08-151-2/+1
* changed main event loopAnselm R.Garbe2006-08-151-10/+7
* removed NUMLOCKMASK, added dynamically calculated numlockmask insteadAnselm R.Garbe2006-08-141-7/+19
* changed order of selecting input at root windowAnselm R.Garbe2006-08-141-4/+4
* removed unneecessary crapAnselm R.Garbe2006-08-141-1/+0
* some other small fixesAnselm R.Garbe2006-08-141-8/+8
* removed ungrabkeys again (because of sander's mail)Anselm R.Garbe2006-08-141-1/+0
* implemented ungrabkeys() which is called in cleanup()Anselm R.Garbe2006-08-141-0/+1
* supplying NULL args in selectAnselm R.Garbe2006-08-141-1/+1
* reducing ConnectionNumber calls to a bare minimumAnselm R.Garbe2006-08-141-4/+5
* implemented viewextend and added M-S-C-n shortcuts for extending the current ...Anselm R.Garbe2006-08-111-3/+3
a id='n361' href='#n361'>361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188









                                                                                                       




               

     
 
      

 
      

               

                  
 






























































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































































                                                                                                             









                          
# profanity suppressions file
#
# I recommend to use valgrind like this:
# G_DEBUG=gc-friendly G_SLICE=always-malloc valgrind --leak-check=full --log-file=out ./profanity
#
# This file is a combination of our own rules and
# * the glib2 suppressions file that usually can be found at /usr/share/glib-2.0/valgrind/glib.supp
# * python suppressions file from http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp
#

{
  _dl_init
  Memcheck:Leak
  ...
  fun:_dl_init
  ...
}

# glib

{
  glib
  Memcheck:Leak
  ...
  fun:start_thread
  fun:clone
}

## glib 2.60.4 suppressions file:

# GLib Valgrind suppressions file
#
# This provides a list of suppressions for all of GLib (including GIO), for all
# Valgrind tools (memcheck, drd, helgrind, etc.) for the false positives and
# deliberate one-time leaks which GLib causes to be reported when running under
# Valgrind.
#
# When running an application which links to GLib under Valgrind, you can pass
# this suppression file to Valgrind using --suppressions=/path/to/glib-2.0.supp.
#
# http://valgrind.org/docs/manual/manual-core.html#manual-core.suppress
#
# Note that there is currently no way for Valgrind to load this automatically
# (https://bugs.kde.org/show_bug.cgi?id=160905), so the best GLib can currently
# do is to install this file as part of its development package.
#
# This file should be updated if GLib introduces a new deliberate one-time leak,
# or another false race positive in Valgrind: please file bugs at:
#
# https://gitlab.gnome.org/GNOME/glib/issues/new

{
	gnutls-init-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:gtls_gnutls_init
}

{
	gnutls-init-realloc
	Memcheck:Leak
	fun:realloc
	...
	fun:gtls_gnutls_init
}

{
	g-tls-backend-gnutls-init
	Memcheck:Leak
	fun:g_once_impl
	fun:g_tls_backend_gnutls_init
}

{
	p11-tokens-init
	Memcheck:Leak
	fun:calloc
	...
	fun:create_tokens_inlock
	fun:initialize_module_inlock_reentrant
}

# One-time allocation from libc for getpwnam() results
{
	g-local-vfs-getpwnam
	Memcheck:Leak
	fun:malloc
	...
	fun:getpwnam
	fun:g_local_vfs_parse_name
}

{
	glib-init-malloc
	Memcheck:Leak
	fun:malloc
	...
	fun:g_quark_init
	...
	fun:glib_init_ctor
}

{
	glib-init-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:g_quark_init
	...
	fun:glib_init_ctor
}

{
	gobject-init-malloc
	Memcheck:Leak
	fun:malloc
	...
	fun:gobject_init_ctor
}

{
	gobject-init-realloc
	Memcheck:Leak
	fun:realloc
	...
	fun:gobject_init_ctor
}

{
	gobject-init-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:gobject_init_ctor
}

{
	g-type-register-dynamic
	Memcheck:Leak
	fun:malloc
	...
	fun:g_type_register_dynamic
}

{
	g-type-register-static
	Memcheck:Leak
	fun:malloc
	...
	fun:g_type_register_static
}

{
	g-type-register-static-realloc
	Memcheck:Leak
	fun:realloc
	...
	fun:g_type_register_static
}

{
	g-type-register-static-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:g_type_register_static
}

{
	g-type-add-interface-dynamic
	Memcheck:Leak
	fun:malloc
	...
	fun:g_type_add_interface_dynamic
}

{
	g-type-add-interface-static
	Memcheck:Leak
	fun:malloc
	...
	fun:g_type_add_interface_static
}

{
	g-test-rand-init
	Memcheck:Leak
	fun:calloc
	...
	fun:g_rand_new_with_seed_array
	fun:test_run_seed
	...
	fun:g_test_run
}

{
	g-test-rand-init2
	Memcheck:Leak
	fun:calloc
	...
	fun:g_rand_new_with_seed_array
	...
	fun:get_global_random
	...
	fun:g_test_init
}

{
	g-quark-table-new
	Memcheck:Leak
	fun:g_hash_table_new
	...
	fun:quark_new
}

{
	g-quark-table-resize
	Memcheck:Leak
	fun:g_hash_table_resize
	...
	fun:quark_new
}

{
	g-type-interface-init
	Memcheck:Leak
	fun:malloc
	...
	fun:type_iface_vtable_base_init_Wm
}

{
	g-type-class-init-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:g_type_create_instance
	...
	fun:type_class_init_Wm
}

{
	g-type-class-init
	Memcheck:Leak
	fun:g_type_create_instance
	...
	fun:type_class_init_Wm
}

{
	g-io-module-default-singleton-malloc
	Memcheck:Leak
	fun:malloc
	...
	fun:g_type_create_instance
	...
	fun:_g_io_module_get_default
}

{
	g-io-module-default-singleton-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:g_type_create_instance
	...
	fun:_g_io_module_get_default
}

# This one seems to show up sometimes with g_type_create_instance() at the top
# of the stack, as well.
{
	g-io-module-default-singleton
	Memcheck:Leak
	fun:g_type_create_instance
	...
	fun:_g_io_module_get_default
}

{
	g-io-module-default-singleton-module
	Memcheck:Leak
	fun:calloc
	...
	fun:g_module_open
	...
	fun:_g_io_module_get_default
}

{
	g-io-module-default-singleton-name
	Memcheck:Leak
	fun:malloc
	...
	fun:g_strdup
	...
	fun:_g_io_module_get_default*
}

{
	g-get-language-names-malloc
	Memcheck:Leak
	fun:malloc
	...
	fun:g_get_language_names
}

{
	g-get-language-names-calloc
	Memcheck:Leak
	fun:calloc
	...
	fun:g_get_language_names
}

{
	g-static-mutex
	Memcheck:Leak
	fun:malloc
	...
	fun:g_static_mutex_get_mutex_impl
}

{
	g-system-thread-init
	Memcheck:Leak
	fun:calloc
	...
	fun:g_system_thread_new
}

{
	g-io-module-default-proxy-resolver-gnome
	Memcheck:Leak
	fun:calloc
	...
	fun:g_proxy_resolver_gnome_init
	...
	fun:_g_io_module_get_default
}

# One-time getaddrinfo() configuration loading
{
	g-threaded-resolver-getaddrinfo-config
	Memcheck:Leak
	fun:malloc
	...
	fun:__resolv_conf_allocate
	...
	fun:getaddrinfo
	fun:do_lookup_by_name
}

# memcheck checks that the third argument to ioctl() is a valid pointer, but
# some ioctls use that argument as an integer
{
   ioctl-with-non-pointer-param
   Memcheck:Param
   ioctl(generic)
   fun:ioctl
   fun:btrfs_reflink_with_progress
}

{
	g-private-get
	drd:ConflictingAccess
	fun:g_private_get
}
{
	g-private-get-helgrind
	Helgrind:Race
	fun:g_private_get
}


{
	g-private-set
	drd:ConflictingAccess
	fun:g_private_set
}
{
	g-private-set-helgrind
	Helgrind:Race
	fun:g_private_set
}

{
	g-type-construct-free
	drd:ConflictingAccess
	fun:g_type_free_instance
}
{
	g-type-construct-free-helgrind
	Helgrind:Race
	fun:g_type_free_instance
}

{
	g-variant-unref
	drd:ConflictingAccess
	fun:g_variant_unref
}
{
	g-variant-unref-helgrind
	Helgrind:Race
	fun:g_variant_unref
}

{
	g-unix-signals-main
	drd:ConflictingAccess
	fun:_g_main_create_unix_signal_watch
}
{
	g-unix-signals-dispatch
	drd:ConflictingAccess
	...
	fun:dispatch_unix_signals*
}
{
	g-unix-signals-dispatch-helgrind
	Helgrind:Race
	...
	fun:dispatch_unix_signals*
}
{
	g-unix-signals-other
	drd:ConflictingAccess
	fun:g_unix_signal_watch*
}
{
	g-unix-signals-other-helgrind
	Helgrind:Race
	fun:g_unix_signal_watch*
}
{
	g-unix-signals-handler
	drd:ConflictingAccess
	fun:g_unix_signal_handler*
}
{
	g-unix-signals-handler-helgrind
	Helgrind:Race
	fun:g_unix_signal_handler*
}
{
	g-unix-signals-worker
	drd:ConflictingAccess
	fun:glib_worker_main
}
{
	g-unix-signals-worker-helgrind
	Helgrind:Race
	fun:glib_worker_main
}

{
	g-wakeup-acknowledge
	drd:ConflictingAccess
	fun:read
	fun:g_wakeup_acknowledge
}

{
	g-type-fundamental
	drd:ConflictingAccess
	fun:g_type_fundamental
}
{
	g-type-fundamental-helgrind
	Helgrind:Race
	fun:g_type_fundamental
}
{
	g-type-class-peek-static
	drd:ConflictingAccess
	fun:g_type_class_peek_static
}
{
	g-type-class-peek-static-helgrind
	Helgrind:Race
	fun:g_type_class_peek_static
}
{
	g-type-is-a
	drd:ConflictingAccess
	...
	fun:g_type_is_a
}
{
	g-type-is-a-helgrind
	Helgrind:Race
	...
	fun:g_type_is_a
}

{
	g-inet-address-get-type
	drd:ConflictingAccess
	fun:g_inet_address_get_type
}
{
	g-inet-address-get-type-helgrind
	Helgrind:Race
	fun:g_inet_address_get_type
}

# From: https://github.com/fredericgermain/valgrind/blob/master/glibc-2.X-drd.supp
{
	drd-libc-stdio
	drd:ConflictingAccess
	obj:*/lib*/libc-*
}
{
	drd-libc-recv
	drd:ConflictingAccess
	fun:recv
}
{
	drd-libc-send
	drd:ConflictingAccess
	fun:send
}

# GSources do an opportunistic ref count check
{
	g-source-set-ready-time
	drd:ConflictingAccess
	fun:g_source_set_ready_time
}
{
	g-source-set-ready-time-helgrind
	Helgrind:Race
	fun:g_source_set_ready_time
}

{
	g-source-iter-next
	Helgrind:Race
	fun:g_source_iter_next
	fun:g_main_context_*
	fun:g_main_context_iterate
}

{
	g-object-instance-private
	drd:ConflictingAccess
	fun:*_get_instance_private
}
{
	g-object-instance-private-helgrind
	Helgrind:Race
	fun:*_get_instance_private
}

# GLib legitimately calls pthread_cond_signal without a mutex held
{
	g-task-thread-complete
	drd:CondErr
	...
	fun:g_cond_signal
	fun:g_task_thread_complete
}
{
	g-task-thread-complete
	Helgrind:Misc
	...
	fun:g_cond_signal
	fun:g_task_thread_complete
}

# False positive, but I can't explain how (FIXME)
{
	g-task-cond
	Helgrind:Misc
	...
	fun:g_cond_clear
	fun:g_task_finalize
}

# Real race, but is_cancelled() is an opportunistic function anyway
{
	g-cancellable-is-cancelled
	Helgrind:Race
	fun:g_cancellable_is_cancelled
}

# False positive
{
	g-main-context-cond
	Helgrind:Misc
	...
	fun:g_cond_clear
	fun:g_main_context_unref
}

# False positives
{
	g-source-unlocked
	Helgrind:Race
	fun:g_source_*_unlocked
}
{
	g-source-internal
	Helgrind:Race
	fun:g_source_*_internal
}

# False positive
{
	g_object_real_dispose
	Helgrind:Race
	fun:g_object_real_dispose
}

# False positive
{
	g_object_new_valist
	Helgrind:Race
	...
	fun:g_object_new_valist
}

# g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
{
	g_set_user_dirs_str
	Memcheck:Leak
	fun:malloc
	...
	fun:set_str_if_different
	fun:g_set_user_dirs
}

# g_set_user_dirs() deliberately leaks the previous cached g_get_user_*() values.
{
	g_set_user_dirs_strv
	Memcheck:Leak
	fun:malloc
	...
	fun:set_strv_if_different
	fun:g_set_user_dirs
}

# g_get_system_data_dirs() caches a one-time allocation
{
	g_get_system_data_dirs
	Memcheck:Leak
	fun:malloc
	...
	fun:g_build_system_data_dirs
	fun:g_get_system_data_dirs
}

# g_get_user_data_dir() caches a one-time allocation
{
	g_get_user_data_dir
	Memcheck:Leak
	fun:realloc
	...
	fun:g_build_user_data_dir
	fun:g_get_user_data_dir
}

# gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
{
	desktop_file_dirs_malloc
	Memcheck:Leak
	fun:malloc
	...
	fun:desktop_file_dirs_lock
}

# gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
{
	desktop_file_dirs_realloc
	Memcheck:Leak
	fun:realloc
	...
	fun:desktop_file_dirs_lock
}

# gdesktopappinfo.c caches a one-time allocation global table of @desktop_file_dirs.
{
	desktop_file_dir_unindexed_setup_search
	Memcheck:Leak
	fun:malloc
	...
	fun:desktop_file_dir_unindexed_setup_search
	fun:desktop_file_dir_unindexed_setup_search
}

# g_io_extension_point_register() caches a one-time allocation global table of @extension_points.
{
	g_io_extension_point_register
	Memcheck:Leak
	fun:calloc
	...
	fun:g_io_extension_point_register
}

# g_strerror() caches a one-time allocation global table of @errors.
{
	g_strerror
	Memcheck:Leak
	fun:malloc
	...
	fun:g_locale_to_utf8
	fun:g_strerror
}

# g_socket_connection_factory_register_type() caches a one-time allocation global table of @connection_types.
{
	g_socket_connection_factory_register_type
	Memcheck:Leak
	fun:calloc
	...
	fun:g_socket_connection_factory_register_type
}

# g_dbus_error_quark() never unregisters itself as a GDBusError domain, as it’s always available
{
	g_dbus_error_quark
	Memcheck:Leak
	fun:calloc
	...
	fun:g_dbus_error_register_error_domain
	fun:g_dbus_error_quark
}

# Thread-private data allocated once per thread
{
	g_private_set_alloc0
	Memcheck:Leak
	fun:malloc
	...
	fun:g_private_set_alloc0
}

# Thread-private GMainContext stack
{
	g_main_context_push_thread_default
	Memcheck:Leak
	fun:malloc
	...
	fun:g_queue_new
	fun:g_main_context_push_thread_default
}

# One-time allocations for #GFileInfo attribute cache
{
	g_file_info_attribute_cache
	Memcheck:Leak
	fun:malloc
	...
	fun:ensure_attribute_hash
	...
	fun:g_file_*
}
{
	g_file_info_attribute_cache2
	Memcheck:Leak
	fun:calloc
	...
	fun:ensure_attribute_hash
	...
	fun:g_file_*
}
{
	g_file_info_attribute_cache3
	Memcheck:Leak
	fun:malloc
	...
	fun:lookup_namespace
	...
	fun:g_file_*
}
{
	g_file_info_attribute_cache4
	Memcheck:Leak
	fun:calloc
	...
	fun:lookup_namespace
	...
	fun:g_file_*
}

## python suppressions file:
#
# This is a valgrind suppression file that should be used when using valgrind.
#
#  Here's an example of running valgrind:
#
#	cd python/dist/src
#	valgrind --tool=memcheck --suppressions=Misc/valgrind-python.supp \
#		./python -E -tt ./Lib/test/regrtest.py -u bsddb,network
#
# You must edit Objects/obmalloc.c and uncomment Py_USING_MEMORY_DEBUGGER
# to use the preferred suppressions with Py_ADDRESS_IN_RANGE.
#
# If you do not want to recompile Python, you can uncomment
# suppressions for PyObject_Free and PyObject_Realloc.
#
# See Misc/README.valgrind for more information.

# all tool names: Addrcheck,Memcheck,cachegrind,helgrind,massif
{
   ADDRESS_IN_RANGE/Invalid read of size 4
   Memcheck:Addr4
   fun:Py_ADDRESS_IN_RANGE
}

{
   ADDRESS_IN_RANGE/Invalid read of size 4
   Memcheck:Value4
   fun:Py_ADDRESS_IN_RANGE
}

{
   ADDRESS_IN_RANGE/Invalid read of size 8 (x86_64 aka amd64)
   Memcheck:Value8
   fun:Py_ADDRESS_IN_RANGE
}

{
   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
   Memcheck:Cond
   fun:Py_ADDRESS_IN_RANGE
}

#
# Leaks (including possible leaks)
#    Hmmm, I wonder if this masks some real leaks.  I think it does.
#    Will need to fix that.
#

{
   Suppress leaking the GIL.  Happens once per process, see comment in ceval.c.
   Memcheck:Leak
   fun:malloc
   fun:PyThread_allocate_lock
   fun:PyEval_InitThreads
}

{
   Suppress leaking the GIL after a fork.
   Memcheck:Leak
   fun:malloc
   fun:PyThread_allocate_lock
   fun:PyEval_ReInitThreads
}

{
   Suppress leaking the autoTLSkey.  This looks like it shouldn't leak though.
   Memcheck:Leak
   fun:malloc
   fun:PyThread_create_key
   fun:_PyGILState_Init
   fun:Py_InitializeEx
   fun:Py_Main
}

{
   Hmmm, is this a real leak or like the GIL?
   Memcheck:Leak
   fun:malloc
   fun:PyThread_ReInitTLS
}

{
   Handle PyMalloc confusing valgrind (possibly leaked)
   Memcheck:Leak
   fun:realloc
   fun:_PyObject_GC_Resize
   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}

{
   Handle PyMalloc confusing valgrind (possibly leaked)
   Memcheck:Leak
   fun:malloc
   fun:_PyObject_GC_New
   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}

{
   Handle PyMalloc confusing valgrind (possibly leaked)
   Memcheck:Leak
   fun:malloc
   fun:_PyObject_GC_NewVar
   fun:COMMENT_THIS_LINE_TO_DISABLE_LEAK_WARNING
}

#
# Non-python specific leaks
#

{
   Handle pthread issue (possibly leaked)
   Memcheck:Leak
   fun:calloc
   fun:allocate_dtv
   fun:_dl_allocate_tls_storage
   fun:_dl_allocate_tls
}

{
   Handle pthread issue (possibly leaked)
   Memcheck:Leak
   fun:memalign
   fun:_dl_allocate_tls_storage
   fun:_dl_allocate_tls
}

###{
###   ADDRESS_IN_RANGE/Invalid read of size 4
###   Memcheck:Addr4
###   fun:PyObject_Free
###}
###
###{
###   ADDRESS_IN_RANGE/Invalid read of size 4
###   Memcheck:Value4
###   fun:PyObject_Free
###}
###
###{
###   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
###   Memcheck:Cond
###   fun:PyObject_Free
###}

###{
###   ADDRESS_IN_RANGE/Invalid read of size 4
###   Memcheck:Addr4
###   fun:PyObject_Realloc
###}
###
###{
###   ADDRESS_IN_RANGE/Invalid read of size 4
###   Memcheck:Value4
###   fun:PyObject_Realloc
###}
###
###{
###   ADDRESS_IN_RANGE/Conditional jump or move depends on uninitialised value
###   Memcheck:Cond
###   fun:PyObject_Realloc
###}

###
### All the suppressions below are for errors that occur within libraries
### that Python uses.  The problems to not appear to be related to Python's
### use of the libraries.
###

{
   Generic ubuntu ld problems
   Memcheck:Addr8
   obj:/lib/ld-2.4.so
   obj:/lib/ld-2.4.so
   obj:/lib/ld-2.4.so
   obj:/lib/ld-2.4.so
}

{
   Generic gentoo ld problems
   Memcheck:Cond
   obj:/lib/ld-2.3.4.so
   obj:/lib/ld-2.3.4.so
   obj:/lib/ld-2.3.4.so
   obj:/lib/ld-2.3.4.so
}

{
   DBM problems, see test_dbm
   Memcheck:Param
   write(buf)
   fun:write
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   fun:dbm_close
}

{
   DBM problems, see test_dbm
   Memcheck:Value8
   fun:memmove
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   fun:dbm_store
   fun:dbm_ass_sub
}

{
   DBM problems, see test_dbm
   Memcheck:Cond
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   fun:dbm_store
   fun:dbm_ass_sub
}

{
   DBM problems, see test_dbm
   Memcheck:Cond
   fun:memmove
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   obj:/usr/lib/libdb1.so.2
   fun:dbm_store
   fun:dbm_ass_sub
}

{
   GDBM problems, see test_gdbm
   Memcheck:Param
   write(buf)
   fun:write
   fun:gdbm_open

}

{
   ZLIB problems, see test_gzip
   Memcheck:Cond
   obj:/lib/libz.so.1.2.3
   obj:/lib/libz.so.1.2.3
   fun:deflate
}

{
   Avoid problems w/readline doing a putenv and leaking on exit
   Memcheck:Leak
   fun:malloc
   fun:xmalloc
   fun:sh_set_lines_and_columns
   fun:_rl_get_screen_size
   fun:_rl_init_terminal_io
   obj:/lib/libreadline.so.4.3
   fun:rl_initialize
}

###
### These occur from somewhere within the SSL, when running
###  test_socket_sll.  They are too general to leave on by default.
###
###{
###   somewhere in SSL stuff
###   Memcheck:Cond
###   fun:memset
###}
###{
###   somewhere in SSL stuff
###   Memcheck:Value4
###   fun:memset
###}
###
###{
###   somewhere in SSL stuff
###   Memcheck:Cond
###   fun:MD5_Update
###}
###
###{
###   somewhere in SSL stuff
###   Memcheck:Value4
###   fun:MD5_Update
###}

#
# All of these problems come from using test_socket_ssl
#
{
   from test_socket_ssl
   Memcheck:Cond
   fun:BN_bin2bn
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:BN_num_bits_word
}

{
   from test_socket_ssl
   Memcheck:Value4
   fun:BN_num_bits_word
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:BN_mod_exp_mont_word
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:BN_mod_exp_mont
}

{
   from test_socket_ssl
   Memcheck:Param
   write(buf)
   fun:write
   obj:/usr/lib/libcrypto.so.0.9.7
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:RSA_verify
}

{
   from test_socket_ssl
   Memcheck:Value4
   fun:RSA_verify
}

{
   from test_socket_ssl
   Memcheck:Value4
   fun:DES_set_key_unchecked
}

{
   from test_socket_ssl
   Memcheck:Value4
   fun:DES_encrypt2
}

{
   from test_socket_ssl
   Memcheck:Cond
   obj:/usr/lib/libssl.so.0.9.7
}

{
   from test_socket_ssl
   Memcheck:Value4
   obj:/usr/lib/libssl.so.0.9.7
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:BUF_MEM_grow_clean
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:memcpy
   fun:ssl3_read_bytes
}

{
   from test_socket_ssl
   Memcheck:Cond
   fun:SHA1_Update
}

{
   from test_socket_ssl
   Memcheck:Value4
   fun:SHA1_Update
}


# gcrypt initialization
{
  gcry_rngcsprng_randomize
  Memcheck:Leak
  fun:malloc
  ...
  fun:omemo_crypto_init
  ...
}