Mercurial > hg > release > icedtea-web-1.5
changeset 1054:d2a31f081e48 default tip
Fixed possible segfault during files on and debug on
author | Jiri Vanek <jvanek@redhat.com> |
---|---|
date | Fri, 02 Oct 2015 15:41:51 +0200 |
parents | 60ec4f45fb23 |
children | |
files | ChangeLog plugin/icedteanp/IcedTeaNPPlugin.cc plugin/icedteanp/IcedTeaNPPlugin.h plugin/icedteanp/IcedTeaPluginUtils.h |
diffstat | 4 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Fri Sep 11 14:18:42 2015 +0200 +++ b/ChangeLog Fri Oct 02 15:41:51 2015 +0200 @@ -1,3 +1,13 @@ +2015-10-02 Jiri Vanek <jvanek@redhat.com> + + Fixed possible segfault during files on and debug on + * plugin/icedteanp/IcedTeaNPPlugin.cc: added file_logs_initiated initiated as + false. plugin_file_log initiated to NULL. + * plugin/icedteanp/IcedTeaNPPlugin.h: made aware about extern file_logs_initiated + * plugin/icedteanp/IcedTeaPluginUtils.h: (initialize_debug) set file_logs_initiated + to true after initFileLog finishes. (PLUGIN_DEBUG) and (PLUGIN_ERROR) logs to + file only when enabled and initiated. + 2015-09-11 Jiri Vanek <jvanek@redhat.com> Post-release changes
--- a/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Sep 11 14:18:42 2015 +0200 +++ b/plugin/icedteanp/IcedTeaNPPlugin.cc Fri Oct 02 15:41:51 2015 +0200 @@ -227,13 +227,14 @@ static guint appletviewer_watch_id = -1; bool debug_initiated = false; +bool file_logs_initiated = false; int plugin_debug = getenv ("ICEDTEAPLUGIN_DEBUG") != NULL; bool plugin_debug_headers = false; bool plugin_debug_to_file = false ; bool plugin_debug_to_streams = true ; bool plugin_debug_to_system = false; bool plugin_debug_to_console = true; -FILE * plugin_file_log; +FILE * plugin_file_log = NULL; std::string plugin_file_log_name; int plugin_debug_suspend = (getenv("ICEDTEAPLUGIN_DEBUG") != NULL) &&
--- a/plugin/icedteanp/IcedTeaNPPlugin.h Fri Sep 11 14:18:42 2015 +0200 +++ b/plugin/icedteanp/IcedTeaNPPlugin.h Fri Oct 02 15:41:51 2015 +0200 @@ -117,6 +117,7 @@ // debug switches extern bool debug_initiated; +extern bool file_logs_initiated; extern int plugin_debug; extern bool plugin_debug_headers; extern bool plugin_debug_to_file;
--- a/plugin/icedteanp/IcedTeaPluginUtils.h Fri Sep 11 14:18:42 2015 +0200 +++ b/plugin/icedteanp/IcedTeaPluginUtils.h Fri Oct 02 15:41:51 2015 +0200 @@ -85,6 +85,7 @@ plugin_debug_to_console = is_java_console_enabled(); \ if (plugin_debug_to_file) { \ IcedTeaPluginUtilities::initFileLog(); \ + file_logs_initiated = true; \ } \ if (plugin_debug_to_console) { \ /*initialisation done during jvm startup*/ \ @@ -133,7 +134,7 @@ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (stdout, "%s", ldebug_message);\ } \ - if (plugin_debug_to_file) { \ + if (plugin_debug_to_file && file_logs_initiated) { \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (plugin_file_log, "%s", ldebug_message); \ fflush(plugin_file_log); \ @@ -179,7 +180,7 @@ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (stderr, "%s", ldebug_message); \ } \ - if (plugin_debug_to_file) { \ + if (plugin_debug_to_file && file_logs_initiated) { \ snprintf(ldebug_message, MESSAGE_SIZE, "%s%s", ldebug_header, ldebug_body); \ fprintf (plugin_file_log, "%s", ldebug_message); \ fflush(plugin_file_log); \