Bug 194406 - Bad hostname crashes plugin
Summary: Bad hostname crashes plugin
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: eclipse-changelog
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Kyu Lee
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-06-07 20:14 UTC by Francis Kung
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 2.1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-08-03 20:53:49 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
Bug fix (1005 bytes, patch)
2006-06-08 13:44 UTC, Kyu Lee
no flags Details | Diff

Description Francis Kung 2006-06-07 20:14:25 UTC
Clicking on Windows -> Preferences -> ChangeLog produces an error if the local
machine's hostname cannot be resolved.

When the local machine's hostname is not in line with what the rest of the world
thinks (ie, the result of typing `hostname` != your machine's actual address),
it causes the plugin to crash.  Adding the non-real hostname (`hostname`) to
/etc/hosts fixes it.


From the errorlog... 

Plugin: changelog

Message: to-fcjpp2.toronto.redhat.com

Stack trace:
java.net.UnknownHostException: to-fcjpp2.toronto.redhat.com
   at java.net.InetAddress.getLocalHost(libgcj.so.7)
   at java.net.InetAddress.getLocalHost(libgcj.so.7)
   at
com.redhat.eclipse.changelog.core.ChangeLogPreferencesPage.getHostName(changelog.jar.so)
   at
com.redhat.eclipse.changelog.core.ChangelogPlugin.initializeDefaultPreferences(changelog.jar.so)
   at
org.eclipse.ui.plugin.AbstractUIPlugin.initializeDefaultPluginPreferences(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.core.runtime.Plugin.internalInitializeDefaultPluginPreferences(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.DefaultPreferences.loadDefaults(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.DefaultPreferences.load(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.EclipsePreferences.create(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.EclipsePreferences.node(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.internal.preferences.AbstractScope.getNode(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.preferences.ScopedPreferenceStore.setDefault(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
com.redhat.eclipse.changelog.core.ChangeLogPreferencesPage.initializeDefaultPreferences(changelog.jar.so)
   at
com.redhat.eclipse.changelog.core.ChangeLogPreferencesPage.init(changelog.jar.so)
   at
org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.jface.preference.PreferenceDialog.createPage(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.jface.preference.PreferenceDialog.showPage(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.jface.preference.PreferenceDialog$8.selectionChanged(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer$3.run(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.core.internal.runtime.InternalPlatform.run(org.eclipse.core.runtime_3.1.2.jar.so)
   at org.eclipse.core.runtime.Platform.run(org.eclipse.core.runtime_3.1.2.jar.so)
   at org.eclipse.ui.internal.JFaceUtil$1.run(org.eclipse.ui.workbench_3.1.2.jar.so)
   at org.eclipse.jface.util.SafeRunnable.run(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(org.eclipse.jface_3.1.1.jar.so)
   at org.eclipse.jface.util.OpenStrategy.access$4(org.eclipse.jface_3.1.1.jar.so)
   at org.eclipse.jface.util.OpenStrategy$3.run(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.RunnableLock.run(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.runAsyncMessages(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.readAndDispatch(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at org.eclipse.jface.window.Window.runEventLoop(org.eclipse.jface_3.1.1.jar.so)
   at org.eclipse.jface.window.Window.open(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.ui.internal.OpenPreferencesAction.run(org.eclipse.ui.workbench_3.1.2.jar.so)
   at org.eclipse.jface.action.Action.runWithEvent(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.action.ActionContributionItem.access$2(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Widget.sendEvent(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.runDeferredEvents(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.readAndDispatch(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.ui.workbench_3.1.2.jar.so)
   at org.eclipse.ui.internal.Workbench.runUI(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.internal.ide.IDEApplication.run(org.eclipse.ui.ide_3.1.1.jar.so)
   at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(org.eclipse.osgi_3.1.2.jar.so)
   at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(org.eclipse.osgi_3.1.2.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.7)
   at org.eclipse.core.launcher.Main.invokeFramework(startup.jar.so)
   at org.eclipse.core.launcher.Main.basicRun(startup.jar.so)
   at org.eclipse.core.launcher.Main.run(startup.jar.so)
   at org.eclipse.core.launcher.Main.main(startup.jar.so)
Caused by: java.net.UnknownHostException: to-fcjpp2.toronto.redhat.com
   at java.net.InetAddress.lookup(libgcj.so.7)
   at java.net.InetAddress.getLocalHost(libgcj.so.7)
   ...61 more

Session data:
eclipse.buildId=M20060118-1600
java.fullversion=GNU libgcj 4.1.0 20060304 (Red Hat 4.1.0-3)
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

----
Plugin: org.eclipse.jface

Message: Problems occurred when invoking code from plug-in: "org.eclipse.jface".

Stack Trace:
java.lang.NullPointerException
   at java.net.InetAddress.lookup(libgcj.so.7)
   at java.net.InetAddress.getHostName(libgcj.so.7)
   at
com.redhat.eclipse.changelog.core.ChangeLogPreferencesPage.getHostName(changelog.jar.so)
   at
com.redhat.eclipse.changelog.core.ChangeLogPreferencesPage.initializeDefaultPreferences(changelog.jar.so)
   at
com.redhat.eclipse.changelog.core.ChangeLogPreferencesPage.init(changelog.jar.so)
   at
org.eclipse.ui.internal.dialogs.WorkbenchPreferenceNode.createPage(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.jface.preference.PreferenceDialog.createPage(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.createPage(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.jface.preference.PreferenceDialog.showPage(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.ui.internal.dialogs.FilteredPreferenceDialog.showPage(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.jface.preference.PreferenceDialog$8.selectionChanged(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer$3.run(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.core.internal.runtime.InternalPlatform.run(org.eclipse.core.runtime_3.1.2.jar.so)
   at org.eclipse.core.runtime.Platform.run(org.eclipse.core.runtime_3.1.2.jar.so)
   at org.eclipse.ui.internal.JFaceUtil$1.run(org.eclipse.ui.workbench_3.1.2.jar.so)
   at org.eclipse.jface.util.SafeRunnable.run(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer.firePostSelectionChanged(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer.handlePostSelect(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.viewers.StructuredViewer$5.widgetSelected(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.util.OpenStrategy.firePostSelectionEvent(org.eclipse.jface_3.1.1.jar.so)
   at org.eclipse.jface.util.OpenStrategy.access$4(org.eclipse.jface_3.1.1.jar.so)
   at org.eclipse.jface.util.OpenStrategy$3.run(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.RunnableLock.run(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.runAsyncMessages(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.readAndDispatch(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at org.eclipse.jface.window.Window.runEventLoop(org.eclipse.jface_3.1.1.jar.so)
   at org.eclipse.jface.window.Window.open(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.ui.internal.OpenPreferencesAction.run(org.eclipse.ui.workbench_3.1.2.jar.so)
   at org.eclipse.jface.action.Action.runWithEvent(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.action.ActionContributionItem.access$2(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.jface.action.ActionContributionItem$5.handleEvent(org.eclipse.jface_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.EventTable.sendEvent(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Widget.sendEvent(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.runDeferredEvents(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.swt.widgets.Display.readAndDispatch(org.eclipse.swt.gtk.linux.x86_64_3.1.1.jar.so)
   at
org.eclipse.ui.internal.Workbench.runEventLoop(org.eclipse.ui.workbench_3.1.2.jar.so)
   at org.eclipse.ui.internal.Workbench.runUI(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.PlatformUI.createAndRunWorkbench(org.eclipse.ui.workbench_3.1.2.jar.so)
   at
org.eclipse.ui.internal.ide.IDEApplication.run(org.eclipse.ui.ide_3.1.1.jar.so)
   at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(org.eclipse.core.runtime_3.1.2.jar.so)
   at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(org.eclipse.osgi_3.1.2.jar.so)
   at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(org.eclipse.osgi_3.1.2.jar.so)
   at java.lang.reflect.Method.invoke(libgcj.so.7)
   at org.eclipse.core.launcher.Main.invokeFramework(startup.jar.so)
   at org.eclipse.core.launcher.Main.basicRun(startup.jar.so)
   at org.eclipse.core.launcher.Main.run(startup.jar.so)
   at org.eclipse.core.launcher.Main.main(startup.jar.so)

Session data:
eclipse.buildId=M20060118-1600
java.fullversion=GNU libgcj 4.1.0 20060304 (Red Hat 4.1.0-3)
BootLoader constants: OS=linux, ARCH=x86_64, WS=gtk, NL=en_US
Command-line arguments:  -os linux -ws gtk -arch x86_64

Comment 1 Ben Konrath 2006-06-07 20:31:07 UTC
Changing to FC5 as per our conversation.

Kyu, Can you take a look at this when you have a chance? Thanks.

Comment 2 Kyu Lee 2006-06-08 13:44:55 UTC
Created attachment 130740 [details]
Bug fix

Comment 3 Kyu Lee 2006-06-08 13:48:09 UTC
Comment on attachment 130740 [details]
Bug fix

ChangeLog throws an exception if java.net.InetAddress.getLocalHost() fails to
obtain localhost's host name. I think instead of throwing an exception, setting
a default value "LocalHost" is more reasonable since this host name is only
used to set author's default email address.


Note You need to log in before you can comment on or make changes to this bug.