Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 472042 - Regression: eclipse -noSplash prints errors if no DISPLAY is set on Linux
Summary: Regression: eclipse -noSplash prints errors if no DISPLAY is set on Linux
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Launcher (show other bugs)
Version: 4.5.0 Mars   Edit
Hardware: PC Linux
: P3 normal with 2 votes (vote)
Target Milestone: Neon.2   Edit
Assignee: Sravan Kumar Lakkimsetti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 454384
Blocks: 496873
  Show dependency tree
 
Reported: 2015-07-07 06:27 EDT by Anton Leherbauer CLA
Modified: 2018-05-17 22:59 EDT (History)
12 users (show)

See Also:
arunkumar.thondapu: review+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anton Leherbauer CLA 2015-07-07 06:27:35 EDT
I am trying to launch a headless application using the launcher executable and the -noSplash option. There is no DISPLAY.
Before Mars this worked just fine without errors, but now I get errors printed:

Eclipse: Cannot open display: 
Eclipse:
GTK+ Version Check

The application is started nonetheless, but the errors are annoying.
--launcher.suppressErrors does not help either.
Comment 1 Martin Oberhuber CLA 2015-08-06 09:27:36 EDT
CQ:WIND00-WB4-5749

Cosmetic only, but still an annoying regression in Mars (due to SWT probably).
Comment 2 Dennis Hendriks CLA 2015-10-29 04:50:35 EDT
This is still an issue in Mars Update 1.
Comment 3 Martin Oberhuber CLA 2016-03-31 16:27:53 EDT
Workaround: Instead of
    ./eclipse -noSplash ...
run this:
    java -jar plugins/org.eclipse.equinox.launcher_*.jar

Note that the "java -jar syntax" requires vmargs to be specified *before* application arguments, and without the -vmargs option.

Also, in case the eclipse install was the result of "updates", it's possible that there are multiple o.e.equinox.launcher_*.jar files and you'd need to check which version to use (most likely latest).

Personally, I'd much prefer a launcher command-line option like
    ./eclipse -noSplash --launcher.GTK_Check=0 ...
to turn off the GTK version check.
Comment 4 David Williams CLA 2016-05-26 16:30:49 EDT
(In reply to Martin Oberhuber from comment #3)

> 
> Personally, I'd much prefer a launcher command-line option like
>     ./eclipse -noSplash --launcher.GTK_Check=0 ...
> to turn off the GTK version check.

I would much prefer this too. "We" should not have to go to extra programming effort to get "clean output". This has annoyed me for all of Neon (at least), but now I have a use case that it actually causes something "bad" to happen. It messes up my nicely formatted output! 

Here's roughly the way it is supposed to look, and the way it looked for the several hours I spent getting it to work: 

	Checking repo:
	file:///home/data/httpd/download.eclipse.org//releases/neon/


	Number of IUs in releases_neon: 27724
	[INFO] Elapsed seconds for this repo: 9

	Checking repo:
	file:///home/data/httpd/download.eclipse.org//staging/neon/


	Number of IUs in staging_neon: 8942
	[INFO] Elapsed seconds for this repo: 4

	Checking repo:
	file:///home/data/httpd/download.eclipse.org//releases/mars/


	Number of IUs in releases_mars: 27956
	[INFO] Elapsed seconds for this repo: 9

	Repository	 Number of IUs
	releases_neon	 27724
	staging_neon	 8942
	releases_mars	 27956


= = = = = = = = = 

And, then, when I moved it to "Hudson", here is the way it looks: 

	Checking repo:
	file:///home/data/httpd/download.eclipse.org//releases/neon/

Eclipse: Cannot open display: 

	Number of IUs in releases_neon: 27724
	[INFO] Elapsed seconds for this repo: 9

	Checking repo:
	file:///home/data/httpd/download.eclipse.org//staging/neon/

Eclipse: Cannot open display: 

	Number of IUs in staging_neon: 8942
	[INFO] Elapsed seconds for this repo: 4

	Checking repo:
	file:///home/data/httpd/download.eclipse.org//releases/mars/

Eclipse: Cannot open display: 

	Number of IUs in releases_mars: 27956
	[INFO] Elapsed seconds for this repo: 9

	Repository	 Number of IUs
	releases_neon	 27724
	staging_neon	 8942
	releases_mars	 27956

= = = = = = = = 

What a pain to have to spend even more time on what was meant to be a "simple utility" (but with nicely formatted output :)
Comment 5 Sravan Kumar Lakkimsetti CLA 2016-05-31 07:32:06 EDT
The bug is in launcher. Is it ok to fix this in 4.6.1?
Comment 6 Thomas Watson CLA 2016-05-31 08:32:38 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #5)
> The bug is in launcher. Is it ok to fix this in 4.6.1?

Yes, this is not a candidate for Neon.0
Comment 7 Thomas Watson CLA 2016-08-31 09:39:11 EDT
(In reply to Sravan Kumar Lakkimsetti from comment #5)
> The bug is in launcher. Is it ok to fix this in 4.6.1?

Any chance of looking at this for Neon.2?  Nothing happend for Neon.1
Comment 8 Sravan Kumar Lakkimsetti CLA 2016-08-31 09:58:04 EDT
I will look into this in M3
Comment 9 Eclipse Genie CLA 2016-10-12 09:50:28 EDT
New Gerrit change created: https://git.eclipse.org/r/83036
Comment 11 Markus Keller CLA 2016-10-24 14:19:26 EDT
(In reply to Eclipse Genie from comment #10)
The source change looks good to me (except for the bad indentation).
But to test this, we need a rebuild of the natives. Arun?
Comment 12 Arun Thondapu CLA 2016-10-25 13:07:42 EDT
(In reply to Markus Keller from comment #11)
> (In reply to Eclipse Genie from comment #10)
> The source change looks good to me (except for the bad indentation).
> But to test this, we need a rebuild of the natives. Arun?

Thanks for pointing out Markus, we do seem to have missed rebuilding the native binaries.

Sravan, are you going to take care of this?
Comment 13 Markus Keller CLA 2016-10-27 11:16:39 EDT
Binaries have been pushed with http://git.eclipse.org/c/equinox/rt.equinox.binaries.git/commit/?id=136a5af29a8c50fca138191b704d86626073796e

Verified in 4.7 M3 candidate eclipse-SDK-I20160606-1100-linux-gtk.tar.gz (32bit).
Comment 14 Thomas Watson CLA 2016-11-15 11:01:07 EST
Are there still plans to release this for Neon.2?  We are heading into RC builds so it better get in quick.
Comment 15 Eclipse Genie CLA 2016-11-16 01:46:05 EST
New Gerrit change created: https://git.eclipse.org/r/85108
Comment 17 Arun Thondapu CLA 2016-11-16 07:51:09 EST
Sravan, I have merged the backport of the source changes, will you be taking care of the binaries rebuilds?
Comment 18 Sravan Kumar Lakkimsetti CLA 2016-11-16 08:00:59 EST
(In reply to Arun Thondapu from comment #17)
> Sravan, I have merged the backport of the source changes, will you be taking
> care of the binaries rebuilds?

Sure I will do that
Comment 20 Andrey Loskutov CLA 2018-05-16 11:00:03 EDT
Looks like this cause regression via bug 534759.
Comment 21 Simeon Andreev CLA 2018-05-17 06:26:07 EDT
I opened https://git.eclipse.org/r/#/c/122853/ for bug 534759, would be nice if someone can provide validation steps for bug 472042 (this ticket).

So far I've checked with unset DISPLAY and running Java code formatter application. I don't see anything on the console other than the formatter outputs.
Comment 22 David Williams CLA 2018-05-17 22:56:55 EDT
(In reply to Simeon Andreev from comment #21)
> I opened https://git.eclipse.org/r/#/c/122853/ for bug 534759, would be nice
> if someone can provide validation steps for bug 472042 (this ticket).
> 
> So far I've checked with unset DISPLAY and running Java code formatter
> application. I don't see anything on the console other than the formatter
> outputs.

I am not familiar with the "Java code formatter application".
The script I mentioned in comment 4 is based on org.eclipse.equinox.p2.director application.
  
For exact steps -- an invocation something like the following should show the issue: 

./eclipse4.6.1/eclipse/eclipse -nosplash --launcher.suppressErrors -application org.eclipse.equinox.p2.director -repository "http://download.eclipse.org/releases/oxygen/" -list -vm /shared/common/jdk1.8.0_x64-latest/bin/java  1>repoOutput.txt

That is assuming Eclipse 4.6.1 has been extracted to ./eclipse4.6.1/eclipse
Such as by: 
tar -xf eclipse-platform-4.6.1-linux-gtk-x86_64.tar.gz -C ./eclipse4.6.1

I mention "4.6.1" since I could reproduce the issue with that version, but not 4.6.3 or 4.7.3a.
If you need it, 4.6.1 is now in 'archives' in 
/home/data/httpd/archive.eclipse.org/eclipse/downloads/drops4/R-4.6.1-201609071200/eclipse-platform-4.6.1-linux-gtk-x86_64.tar.gz
[That's the location to use in rsync, the web URL should be obvious]

I did also test if unsetting the DISPLAY variable sufficed -- because , and it did seem to on my system (Ubuntu 16.04).  On my latest Ubuntu install, using 4.6.1, the "extraneous" messages after "unset DISPLAY" (and running 4.6.1) are actually worse than comment 4: 
= = = 
Failed to connect to Mir: Failed to connect to server socket: No such file or directory
Unable to init server: Could not connect: Connection refused
Eclipse: Cannot open display: 
= = = 
On the Eclipse "build" machine, which literally has no display, the message is only the last line: 
= = = 
Eclipse: Cannot open display:
= = =
probably similar for latest Jenkins HIPP servers, but did not check. 

I hope all that is the type of information you were looking for. Let me know if not.
Comment 23 David Williams CLA 2018-05-17 22:59:56 EDT
(In reply to David Williams from comment #22)

Sorry, accidental 'save' while editing. 
For the following: 

> I did also test if unsetting the DISPLAY variable sufficed -- because , and
> it did seem to on my system (Ubuntu 16.04).  

I meant to say: 

I did also test if unsetting the DISPLAY variable sufficed -- because I did not think that it would -- but it did seem to on my system (Ubuntu 16.04).