Commit 21e0261eaa65c2b1d6142b13e987a3e66324e744
1 parent
9fa557e3
Exists in
master
and in
5 other branches
Adding option to run appplication with valgrind.
Showing
4 changed files
with
182 additions
and
4 deletions
Show diff stats
Makefile.in
| @@ -63,6 +63,7 @@ INSTALL=@INSTALL@ | @@ -63,6 +63,7 @@ INSTALL=@INSTALL@ | ||
| 63 | INSTALL_DATA=@INSTALL_DATA@ | 63 | INSTALL_DATA=@INSTALL_DATA@ |
| 64 | INSTALL_PROGRAM=@INSTALL_PROGRAM@ | 64 | INSTALL_PROGRAM=@INSTALL_PROGRAM@ |
| 65 | HELP2MAN=@HELP2MAN@ | 65 | HELP2MAN=@HELP2MAN@ |
| 66 | +VALGRIND=@VALGRIND@ | ||
| 66 | 67 | ||
| 67 | #---[ Release Targets ]------------------------------------------------------------------ | 68 | #---[ Release Targets ]------------------------------------------------------------------ |
| 68 | 69 | ||
| @@ -231,6 +232,22 @@ run: \ | @@ -231,6 +232,22 @@ run: \ | ||
| 231 | 232 | ||
| 232 | @LD_LIBRARY_PATH=$(BINDBG) $(BINDBG)/$(PACKAGE_TARNAME)@EXEEXT@ | 233 | @LD_LIBRARY_PATH=$(BINDBG) $(BINDBG)/$(PACKAGE_TARNAME)@EXEEXT@ |
| 233 | 234 | ||
| 235 | +mem-check: \ | ||
| 236 | + $(BINDBG)/$(PACKAGE_TARNAME)@EXEEXT@ | ||
| 237 | + | ||
| 238 | +ifeq ($(VALGRIND),no) | ||
| 239 | + | ||
| 240 | + @LD_LIBRARY_PATH=$(BINDBG) \ | ||
| 241 | + $(BINDBG)/$(PACKAGE_TARNAME)@EXEEXT@ | ||
| 242 | + | ||
| 243 | +else | ||
| 244 | + @touch valgrind.suppression | ||
| 245 | + | ||
| 246 | + @LD_LIBRARY_PATH=$(BINDBG) \ | ||
| 247 | + $(VALGRIND) --leak-check=full --track-origins=yes --gen-suppressions=all --suppressions=valgrind.suppression \ | ||
| 248 | + $(BINDBG)/$(PACKAGE_TARNAME)@EXEEXT@ | ||
| 249 | +endif | ||
| 250 | + | ||
| 234 | #---[ Misc Targets ]--------------------------------------------------------------------- | 251 | #---[ Misc Targets ]--------------------------------------------------------------------- |
| 235 | 252 | ||
| 236 | locale: \ | 253 | locale: \ |
src/pw3270/common/config.c
| @@ -551,12 +551,10 @@ void configuration_deinit(void) | @@ -551,12 +551,10 @@ void configuration_deinit(void) | ||
| 551 | { | 551 | { |
| 552 | #if !defined(ENABLE_WINDOWS_REGISTRY) | 552 | #if !defined(ENABLE_WINDOWS_REGISTRY) |
| 553 | 553 | ||
| 554 | - gchar *text; | ||
| 555 | - | ||
| 556 | if(!program_config) | 554 | if(!program_config) |
| 557 | return; | 555 | return; |
| 558 | 556 | ||
| 559 | - text = g_key_file_to_data(program_config,NULL,NULL); | 557 | + g_autofree gchar * text = g_key_file_to_data(program_config,NULL,NULL); |
| 560 | 558 | ||
| 561 | if(text) | 559 | if(text) |
| 562 | { | 560 | { |
src/pw3270/main.c
| @@ -393,7 +393,6 @@ int main(int argc, char *argv[]) | @@ -393,7 +393,6 @@ int main(int argc, char *argv[]) | ||
| 393 | GOptionGroup * group = g_option_group_new( PACKAGE_NAME, NULL, NULL, NULL, NULL); | 393 | GOptionGroup * group = g_option_group_new( PACKAGE_NAME, NULL, NULL, NULL, NULL); |
| 394 | 394 | ||
| 395 | g_option_context_set_main_group(context, group); | 395 | g_option_context_set_main_group(context, group); |
| 396 | - | ||
| 397 | g_option_context_add_main_entries(context, app_options, NULL); | 396 | g_option_context_add_main_entries(context, app_options, NULL); |
| 398 | 397 | ||
| 399 | if(!g_option_context_parse( context, &argc, &argv, &error )) | 398 | if(!g_option_context_parse( context, &argc, &argv, &error )) |
| @@ -423,6 +422,8 @@ int main(int argc, char *argv[]) | @@ -423,6 +422,8 @@ int main(int argc, char *argv[]) | ||
| 423 | 422 | ||
| 424 | return -1; | 423 | return -1; |
| 425 | } | 424 | } |
| 425 | + | ||
| 426 | + g_option_context_free(context); | ||
| 426 | } | 427 | } |
| 427 | 428 | ||
| 428 | if(app_name) | 429 | if(app_name) |
| @@ -0,0 +1,162 @@ | @@ -0,0 +1,162 @@ | ||
| 1 | +{ | ||
| 2 | + libcrypto_BIO_read | ||
| 3 | + Memcheck:Cond | ||
| 4 | + ... | ||
| 5 | + fun:BIO_read | ||
| 6 | +} | ||
| 7 | + | ||
| 8 | +{ | ||
| 9 | + libcrypt_FIPS_selftest | ||
| 10 | + Memcheck:Cond | ||
| 11 | + ... | ||
| 12 | + fun:FIPS_selftest | ||
| 13 | +} | ||
| 14 | + | ||
| 15 | +{ | ||
| 16 | + libcrypt_FIPS_mode_set | ||
| 17 | + Memcheck:Cond | ||
| 18 | + ... | ||
| 19 | + fun:FIPS_mode_set | ||
| 20 | +} | ||
| 21 | + | ||
| 22 | +{ | ||
| 23 | + libcrypt_BIO_new_mem_buf | ||
| 24 | + Memcheck:Cond | ||
| 25 | + ... | ||
| 26 | + fun:BIO_new_mem_buf | ||
| 27 | +} | ||
| 28 | + | ||
| 29 | + | ||
| 30 | +{ | ||
| 31 | + g_type_register_fundamental | ||
| 32 | + Memcheck:Leak | ||
| 33 | + ... | ||
| 34 | + fun:g_type_register_fundamental | ||
| 35 | +} | ||
| 36 | + | ||
| 37 | +{ | ||
| 38 | + glib_dl_init | ||
| 39 | + Memcheck:Leak | ||
| 40 | + ... | ||
| 41 | + fun:_dl_init | ||
| 42 | +} | ||
| 43 | + | ||
| 44 | +{ | ||
| 45 | + pango_itemize_with_base_dir | ||
| 46 | + Memcheck:Leak | ||
| 47 | + ... | ||
| 48 | + fun:pango_itemize_with_base_dir | ||
| 49 | +} | ||
| 50 | + | ||
| 51 | +{ | ||
| 52 | + fontconfig_FcDefaultSubstitute | ||
| 53 | + Memcheck:Leak | ||
| 54 | + ... | ||
| 55 | + fun:FcDefaultSubstitute | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +{ | ||
| 59 | + fontconfig_FcConfigParseAndLoad | ||
| 60 | + Memcheck:Leak | ||
| 61 | + ... | ||
| 62 | + fun:FcConfigParseAndLoad | ||
| 63 | +} | ||
| 64 | + | ||
| 65 | +{ | ||
| 66 | + fontconfig_FcFontMatch | ||
| 67 | + Memcheck:Leak | ||
| 68 | + ... | ||
| 69 | + fun:FcFontMatch | ||
| 70 | +} | ||
| 71 | + | ||
| 72 | +{ | ||
| 73 | + g_type_register_static | ||
| 74 | + Memcheck:Leak | ||
| 75 | + ... | ||
| 76 | + fun:g_type_register_static | ||
| 77 | +} | ||
| 78 | + | ||
| 79 | +{ | ||
| 80 | + g_thread_pool_push | ||
| 81 | + Memcheck:Leak | ||
| 82 | + ... | ||
| 83 | + fun:g_task_run_in_thread | ||
| 84 | +} | ||
| 85 | + | ||
| 86 | +{ | ||
| 87 | + g_bus_get_sync | ||
| 88 | + Memcheck:Leak | ||
| 89 | + ... | ||
| 90 | + fun:g_bus_get_sync | ||
| 91 | +} | ||
| 92 | + | ||
| 93 | +{ | ||
| 94 | + g_type_add_interface_static | ||
| 95 | + Memcheck:Leak | ||
| 96 | + ... | ||
| 97 | + fun:g_type_add_interface_static | ||
| 98 | +} | ||
| 99 | + | ||
| 100 | +{ | ||
| 101 | + g_type_create_instance | ||
| 102 | + Memcheck:Leak | ||
| 103 | + ... | ||
| 104 | + fun:g_type_create_instance | ||
| 105 | +} | ||
| 106 | + | ||
| 107 | +{ | ||
| 108 | + fontconfig_FcPatternDuplicate | ||
| 109 | + Memcheck:Leak | ||
| 110 | + ... | ||
| 111 | + fun:FcPatternDuplicate | ||
| 112 | +} | ||
| 113 | + | ||
| 114 | +{ | ||
| 115 | + gtk_style_context_set_state | ||
| 116 | + Memcheck:Leak | ||
| 117 | + ... | ||
| 118 | + fun:gtk_style_context_set_state | ||
| 119 | +} | ||
| 120 | + | ||
| 121 | +{ | ||
| 122 | + g_param_spec_flags | ||
| 123 | + Memcheck:Leak | ||
| 124 | + ... | ||
| 125 | + fun:g_param_spec_flags | ||
| 126 | +} | ||
| 127 | + | ||
| 128 | +{ | ||
| 129 | + gtk_style_new | ||
| 130 | + Memcheck:Leak | ||
| 131 | + ... | ||
| 132 | + fun:gtk_style_new | ||
| 133 | +} | ||
| 134 | + | ||
| 135 | +{ | ||
| 136 | + libcrypto_BIO_read | ||
| 137 | + Memcheck:Cond | ||
| 138 | + fun:BIO_read | ||
| 139 | +} | ||
| 140 | + | ||
| 141 | +{ | ||
| 142 | + cairo_mask | ||
| 143 | + Memcheck:Cond | ||
| 144 | + ... | ||
| 145 | + fun:cairo_mask | ||
| 146 | +} | ||
| 147 | + | ||
| 148 | +{ | ||
| 149 | + gtk_css_dimension_value_new | ||
| 150 | + Memcheck:Leak | ||
| 151 | + ... | ||
| 152 | + fun:gtk_css_dimension_value_new | ||
| 153 | +} | ||
| 154 | + | ||
| 155 | +{ | ||
| 156 | + gtk_style_constructed | ||
| 157 | + Memcheck:Leak | ||
| 158 | + ... | ||
| 159 | + fun:gtk_style_constructed | ||
| 160 | +} | ||
| 161 | + | ||
| 162 | + |