Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 354119

Summary: Valgrind tools print error on stdout when valgrind is not installed on the host
Product: [Tools] Linux Tools Reporter: Martin Oberhuber <mober.at+eclipse>
Component: ValgrindAssignee: Andrew Robinson <arobinso>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: aegges, akurtakov, ddykstal.eclipse, ebaron, overholt
Version: 0.8.0   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard: stalebug

Description Martin Oberhuber CLA 2011-08-08 05:59:51 EDT
Build ID: Valgrind 0.7.0.201106060936 (==Indigo ==Linuxtools 0.8.0)
Host: Fedora 13 x86_64

When I look at the Valgrind Preference Page without valgrind installed, following error is printed to stdout.

Printing to stdout is not a good practice; it's particularly problematic when integrating the valgrind tools into a product along with other plugins, where not having valgrind installed is perfectly valid. I'm also not sure to what extent valgrind is needed on the host, when looking at remote profiling (as per bug 315504). Error handling seems OK so just printing to stdout should be suppressed.

Here's the exception from the Preference Page:

java.io.IOException: which: no valgrind in (/opt/WindRiver/wb332/workbench-3.3/analysis/host/bin/x86-linux2:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/wradmin/bin)

	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand.readIntoBuffer(ValgrindCommand.java:104)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand.whichValgrind(ValgrindCommand.java:36)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindPlugin.initializeDefaultPreferences(ValgrindPlugin.java:65)
	at org.eclipse.ui.plugin.AbstractUIPlugin.initializeDefaultPluginPreferences(AbstractUIPlugin.java:358)
	at org.eclipse.core.runtime.Plugin.internalInitializeDefaultPluginPreferences(Plugin.java:473)
	at org.eclipse.core.internal.preferences.legacy.InitLegacyPreferences.init(InitLegacyPreferences.java:52)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:146)
	at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
	at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
	at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
	at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:308)
	at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:544)
	at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:670)
	at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
	at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:76)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:250)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(ScopedPreferenceStore.java:285)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.internalGet(ScopedPreferenceStore.java:475)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getString(ScopedPreferenceStore.java:535)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindPreferencePage.loadPreferences(ValgrindPreferencePage.java:99)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindPreferencePage.createContents(ValgrindPreferencePage.java:93)
	at org.eclipse.jface.preference.PreferencePage.createControl(PreferencePage.java:232)
	at org.eclipse.jface.preference.PreferenceDialog.createPageControl(PreferenceDialog.java:1501)
	at org.eclipse.jface.preference.PreferenceDialog$14.run(PreferenceDialog.java:1258)




Here's a variant of the exception when opening the Valgrind Launch with valgrind not installed on the host:

	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand.readIntoBuffer(ValgrindCommand.java:104)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand.whichValgrind(ValgrindCommand.java:36)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindPlugin.initializeDefaultPreferences(ValgrindPlugin.java:65)
	at org.eclipse.ui.plugin.AbstractUIPlugin.initializeDefaultPluginPreferences(AbstractUIPlugin.java:358)
	at org.eclipse.core.runtime.Plugin.internalInitializeDefaultPluginPreferences(Plugin.java:473)
	at org.eclipse.core.internal.preferences.legacy.InitLegacyPreferences.init(InitLegacyPreferences.java:52)
	at org.eclipse.core.internal.preferences.PreferenceServiceRegistryHelper.applyRuntimeDefaults(PreferenceServiceRegistryHelper.java:146)
	at org.eclipse.core.internal.preferences.PreferencesService.applyRuntimeDefaults(PreferencesService.java:368)
	at org.eclipse.core.internal.preferences.DefaultPreferences.applyRuntimeDefaults(DefaultPreferences.java:166)
	at org.eclipse.core.internal.preferences.DefaultPreferences.load(DefaultPreferences.java:237)
	at org.eclipse.core.internal.preferences.EclipsePreferences.create(EclipsePreferences.java:308)
	at org.eclipse.core.internal.preferences.EclipsePreferences.internalNode(EclipsePreferences.java:544)
	at org.eclipse.core.internal.preferences.EclipsePreferences.node(EclipsePreferences.java:670)
	at org.eclipse.core.internal.preferences.AbstractScope.getNode(AbstractScope.java:38)
	at org.eclipse.core.runtime.preferences.DefaultScope.getNode(DefaultScope.java:76)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getDefaultPreferences(ScopedPreferenceStore.java:250)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getPreferenceNodes(ScopedPreferenceStore.java:285)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.internalGet(ScopedPreferenceStore.java:475)
	at org.eclipse.ui.preferences.ScopedPreferenceStore.getString(ScopedPreferenceStore.java:535)
	at org.eclipse.linuxtools.internal.valgrind.core.ValgrindCommand.whichValgrind(ValgrindCommand.java:30)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin.findValgrindLocation(ValgrindLaunchPlugin.java:149)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin.findValgrindVersion(ValgrindLaunchPlugin.java:159)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchPlugin.getValgrindVersion(ValgrindLaunchPlugin.java:134)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindOptionsTab.<init>(ValgrindOptionsTab.java:104)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindOptionsTab.<init>(ValgrindOptionsTab.java:98)
	at org.eclipse.linuxtools.internal.valgrind.launch.ValgrindLaunchConfigurationTabGroup.getProfileTabs(ValgrindLaunchConfigurationTabGroup.java:22)
	at org.eclipse.linuxtools.profiling.launch.ProfileLaunchConfigurationTabGroup.createTabs(ProfileLaunchConfigurationTabGroup.java:32)
Comment 1 Martin Oberhuber CLA 2012-01-24 05:04:11 EST
Ping, any comment on this ?
This shouldn't be terribly hard to fix I'd hope ...
Comment 2 Andrew Overholt CLA 2012-01-24 08:52:07 EST
Andrew R., please take a look at this.
Comment 3 Alexander Kurtakov CLA 2012-08-22 08:39:25 EDT
Is this bug fixed now ? I was not able to reproduce it.
Comment 4 Roland Grunberg CLA 2012-08-29 17:23:11 EDT
The ValgrindPreferencePage no longer exists as of 0513f1fc6a3ff095d33d47984e6ff1577d11a830. I've been unable to reproduce the same error through the launch configuration dialog.
Comment 5 Eclipse Genie CLA 2014-09-17 15:13:05 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet.

If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.
Comment 6 Alexander Kurtakov CLA 2014-09-18 00:23:36 EDT
Closing the bug now. Please open a new one if problem persists as this one seems to be too outdated.