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

Bug 311233

Summary: [Usability] can't run a project undess "Debug As" is selected first.
Product: [Tools] CDT Reporter: Miwako Tokugawa <miwako.tokugawa>
Component: cdt-debugAssignee: cdt-debug-inbox <cdt-debug-inbox>
Status: NEW --- QA Contact: Jonah Graham <jonah>
Severity: normal    
Priority: P3 CC: marc.khouzam, pawel.1.piech
Version: 0 DD 1.1   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Miwako Tokugawa CLA 2010-04-30 15:18:50 EDT
Build Identifier: cdt-master-7.0.0-I201003151310.zip

When I try to run a helloc project, I see that a error(?) message box gets displayed for a split second then nothing happens. .metadata/.log has the following. 
!ENTRY org.eclipse.debug.core 4 125 2010-04-30 12:12:07.919
!MESSAGE Error logged from Debug Core:
!STACK 0
java.io.IOException: read error
        at org.eclipse.cdt.utils.spawner.SpawnerInputStream.read0(Native Method)
        at org.eclipse.cdt.utils.spawner.SpawnerInputStream.read(SpawnerInputStream.java:66)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at java.io.FilterInputStream.read(Unknown Source)
        at org.eclipse.debug.internal.core.OutputStreamMonitor.read(OutputStreamMonitor.java:144)
        at org.eclipse.debug.internal.core.OutputStreamMonitor.access$1(OutputStreamMonitor.java:134)
        at org.eclipse.debug.internal.core.OutputStreamMonitor$1.run(OutputStreamMonitor.java:207)
        at java.lang.Thread.run(Unknown Source)


Reproducible: Always

Steps to Reproduce:
1. untar eclipse-SDK-3.6M6-linux-gtk.tar.tar
2. install cdt-master-7.0.0-I201003151310.zip via Install New Software.. and select only the first (basic) CDT features.
3. Restart eclipse 
./eclipse -clean -data runtime -showlocation -vm [path]/jre1.6.0_17/bin/java -vmargs -Xmx758M
4. Create Hello World ANSI C Project. Build.
5. Run->Run As->Local C/C++ APplication
6. I get the error above.
Comment 1 Miwako Tokugawa CLA 2010-04-30 15:25:05 EDT
OK. Looks like everything works if I first selects "Debug As" and set up the debugger before selecting "Run As". Fortunately I figured this out but I'd say this's user-unfriendly.
Comment 2 Marc Khouzam CLA 2010-04-30 15:56:22 EDT
(In reply to comment #1)
> OK. Looks like everything works if I first selects "Debug As" and set up the
> debugger before selecting "Run As". Fortunately I figured this out but I'd say
> this's user-unfriendly.

That is not very good.
I wonder if this is the same as bug 308905.
Do you have EDC installed too?

Can you try with one of the latest nightly builds, or wait until Monday for the M7 build.
Comment 3 Miwako Tokugawa CLA 2010-04-30 16:00:37 EDT
> Can you try with one of the latest nightly builds, or wait until Monday for the
> M7 build.
OK. I'll try again with M7 on Monday.
Comment 4 Miwako Tokugawa CLA 2010-05-03 14:43:17 EDT
With M7, I get an error box
"Problem Occurred"
'Launching 1' has encountered a problem.
Plug-in "org.eclipse.cdt.launch" was unable to
instantiate class
"org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate".
Again, if I select the Debug As first, everything works fine.

Is EDC included in "CDT Main Features" or "CDT Optional Features"? I only have everything from CDT Main Features installed.
Comment 5 Marc Khouzam CLA 2010-05-03 15:10:22 EDT
(In reply to comment #4)
> With M7, I get an error box
> "Problem Occurred"
> 'Launching 1' has encountered a problem.
> Plug-in "org.eclipse.cdt.launch" was unable to
> instantiate class
> "org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate".
> Again, if I select the Debug As first, everything works fine.
> 
> Is EDC included in "CDT Main Features" or "CDT Optional Features"? I only have
> everything from CDT Main Features installed.

I tried your steps exactly and I can't reproduce this.
I'm on a Linux 32bit.  I installed eclipse M7 then CDT M7 then build a new Hello World C project and then Run-> Run As works fine for me.
Comment 6 Miwako Tokugawa CLA 2010-05-03 16:09:16 EDT
Mmm..
>I'm on a Linux 32bit.
Me too. I'm on EL5.
>I installed eclipse M7 then CDT M7 
I tried with eclipse M7 too. I tried installing only CDT Main Features" first then also "CDT Optional Features" (but not Remote Launcher) with it and still got the same error. I'm using JRE1.6. The backtrace is

java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
        at java.util.HashMap$KeyIterator.next(Unknown Source)
        at org.eclipse.ui.internal.activities.MutableActivityManager.updateIdentifiers(MutableActivityManager.java:880)
        at org.eclipse.ui.internal.activities.MutableActivityManager.updateListeners(MutableActivityManager.java:590)
        at org.eclipse.ui.internal.activities.MutableActivityManager.setEnabledActivityIds(MutableActivityManager.java:573)
        at org.eclipse.ui.internal.activities.ws.WorkbenchActivitySupport.setEnabledActivityIds(WorkbenchActivitySupport.java:320)
        at org.eclipse.cdt.launch.LaunchUtils.enableActivity(LaunchUtils.java:136)
        at org.eclipse.cdt.launch.AbstractCLaunchDelegate.<init>(AbstractCLaunchDelegate.java:124)
        at org.eclipse.cdt.launch.internal.LocalCDILaunchDelegate.<init>(LocalCDILaunchDelegate.java:59)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at java.lang.Class.newInstance0(Unknown Source)
        at java.lang.Class.newInstance(Unknown Source)
        at org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI.createExecutableExtension(RegistryStrategyOSGI.java:184)
        at org.eclipse.core.internal.registry.ExtensionRegistry.createExecutableExtension(ExtensionRegistry.java:904)
        at org.eclipse.core.internal.registry.ConfigurationElement.createExecutableExtension(ConfigurationElement.java:243)
        at org.eclipse.core.internal.registry.ConfigurationElementHandle.createExecutableExtension(ConfigurationElementHandle.java:55)
        at org.eclipse.debug.internal.core.LaunchDelegate.getDelegate(LaunchDelegate.java:85)
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:734)
        at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:702)
        at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:923)
        at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1126)
        at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
Comment 7 Marc Khouzam CLA 2010-05-05 08:59:55 EDT
I can't reproduce but I have a theory.

Which perspective are you in when you to the Run As?
Do you get an automatic perspective switch during the launch?
Comment 8 Miwako Tokugawa CLA 2010-05-07 16:33:39 EDT
Thanks for looking. (Sorry I didn't see this till now).
I can not reproduce this any longer myself.

Re: perspective
I don't remember clearly but I started out in Java perspective and was in C/C++ perspective when I did "Run As". The perspective switch is not automatic for me. I get a prompt when I create a C/C++ project.
Right now I tried both cases (Yes and No to the prompt) and still could not reproduce the problem.
Comment 9 Doug Schaefer CLA 2010-08-09 14:10:00 EDT
Not sure why this is assigned to me.