Community
Participate
Working Groups
To reproduce create a project called "foo:bar" and run a debug configuration with the default working directory, ${workspace_loc:foo:bar}. CDT converts the colon to double colon, which causes GDB to fail with: 705,536 4-environment-cd /workspace/foo::bar 705,536 4^error,msg="/workspace/foo::bar: No such file or directory." The problem manifests itself as an NPE: java.lang.NullPointerException at org.eclipse.cdt.dsf.gdb.service.command.GDBControl.getId(GDBControl.java:274) at org.eclipse.cdt.dsf.gdb.service.command.GDBControl_7_4.createComandControlContext(GDBControl_7_4.java:49) at org.eclipse.cdt.dsf.gdb.service.command.GDBControl.doInitialize(GDBControl.java:256) at org.eclipse.cdt.dsf.gdb.service.command.GDBControl.access$0(GDBControl.java:250) at org.eclipse.cdt.dsf.gdb.service.command.GDBControl$1.handleSuccess(GDBControl.java:245) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:385) at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:312) at org.eclipse.cdt.dsf.concurrent.ImmediateExecutor.execute(ImmediateExecutor.java:63) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.done(RequestMonitor.java:309) at org.eclipse.cdt.dsf.service.AbstractDsfService.initialize(AbstractDsfService.java:93) at org.eclipse.cdt.dsf.gdb.service.command.GDBControl.initialize(GDBControl.java:242) at org.eclipse.cdt.dsf.gdb.launching.ServicesLaunchSequence$2.execute(ServicesLaunchSequence.java:57) at org.eclipse.cdt.dsf.concurrent.Sequence.executeStep(Sequence.java:459) at org.eclipse.cdt.dsf.concurrent.Sequence.access$2(Sequence.java:373) at org.eclipse.cdt.dsf.concurrent.Sequence$2.handleSuccess(Sequence.java:420) at org.eclipse.cdt.dsf.concurrent.RequestMonitor.handleCompleted(RequestMonitor.java:385) at org.eclipse.cdt.dsf.concurrent.RequestMonitor$2.run(RequestMonitor.java:312) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:295) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) This is a recent regression.
New Gerrit change created: https://git.eclipse.org/r/83058
There might be a timing component to this bug - On my machine I am able to reproduce the problem of CDT changing "foo:bar" to "foo::bar", when computing the workspace project path, to give to GDB. However, for me, the NPE is not present. At first look, there are some other issues with having a column character in the project name; for instance, the build system doesn't seem to be able to generate a valid makefile, for the project, in that case. That seem to happen when I used the wizard to create an "hello world" type project, and named it "foo"bar", to this this bug. In any case, I'll add a patch that gets rid of the extra column character, during the launch sequence. It might at least hide this NPE, but it's possible the real issue would still be latent. Sergey - give it a try and report what happens?
(In reply to Marc Dumais from comment #2) There is definitely a race between processing of the gdb-reported error, which causes the session to end, and the concurrent activities still running at this time. The NPE goes away if I put "if (DsfSession.isSessionActive(fSession.getId()))" in front of line 57 in ServicesLaunchSequence.java. Even with this change the behavior is unsatisfactory since the gdb-reported error is logged to the error log, but not reported to the user. https://git.eclipse.org/r/83058 fixes the issue with doubling of semicolon.
Gerrit change https://git.eclipse.org/r/83058 was merged to [master]. Commit: http://git.eclipse.org/c/cdt/org.eclipse.cdt.git/commit/?id=f8488ac157e6eb1a718c395976359a85fe6fb60c