This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 153396 - Can't open display
Summary: Can't open display
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: Macintosh (x86) Mac OS X
: P2 blocker (vote)
Assignee: Thomas Preisler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-11-18 15:29 UTC by Alexander Pepin
Modified: 2009-02-19 20:30 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Pepin 2008-11-18 15:29:12 UTC
Steps to reproduce:
- create any project e.g. Welcome
- clean and build it
- try run the project
Result: Run failed due to "/usr/X11R6/bin/xterm Xt error: Can't open display:"
Comment 1 Thomas Preisler 2008-11-18 16:26:05 UTC
I see this once in a while too and I don't think it has anything to do with CND. Running xterm from terminal will also fail when it happens and I suspect some 
kind of Mac error. The error goes away if you re-login or restart.
Comment 2 Leonid Lenyashin 2008-11-18 16:57:22 UTC
Thomas,

From your comment it is not clear if you are going to fix it or not. If there is no problem with CND, then it does not
make any sense to keep this P1 open, in NEW state and w/o target milestone. My sense is that you should work it out with
QA and close as WONTFIX.

Leonid.
Comment 3 Alexander Pepin 2008-11-18 17:20:12 UTC
Thomas, 
 this was found in build 200811180201. At the same time build 20081029 works pretty good on the same machine, so I
expect that something wrong with CND trunk. I tried to run NB with a fresh userdir but got the same result (failed). 
It's P1 as it prevents us from testing on Mac. 
Comment 4 Thomas Preisler 2008-11-18 17:38:02 UTC
I will try build and let you know. Please try and reboot your system and see what happens? I have seem this problem on and off for that past 2 month and it happened after one of the Mac software updates. Nothing really have changed in the way we open the terminal.
Comment 5 Thomas Preisler 2008-11-18 18:34:29 UTC
Downgrade to p2. Seems like problem is isolated to Alexander's system. I just tried today's build and have no problems. Still investigating...
Comment 6 soldatov 2008-11-28 09:40:41 UTC
I verified this bug on apepin's machine again after restart (with latest build) and I can't open xterm also.

P.S. Also I can't open xterm from terminal by default. But If I added 'export DISPLAY=:0' line then xterm appears
without problems (If launched NB from this terminal in this case xterm works in NetBeans also)
Comment 7 Egor Ushakov 2008-12-12 15:55:31 UTC
The problem is that on this system DISPLAY is not set by default and so xterm is unable to run.
Simple "export DISPLAY=:0.0" solves the problem.
We should consider adding DISPLAY to the environment if it is not present (in case we run xterm).
Comment 8 Thomas Preisler 2008-12-12 16:51:30 UTC
Most likely caused by the following change in MakeActionProvider:

was:
if (System.getenv("DISPLAY") == null && conf.getProfile().getEnvironment().getenv("DISPLAY") == null) { // NOI18N

now:
// Make sure DISPLAY variable has been set
if (HostInfoProvider.getDefault().getEnv(conf.getDevelopmentHost().getName()).get("DISPLAY") == null && conf.getProfile().getEnvironment().getenv("DISPLAY") == null) { // 
NOI18N

I will investigate some more and possible revert back to what it was previously.

--thomas
Comment 9 Sergey Grinev 2008-12-12 17:36:10 UTC
possible fix: http://hg.netbeans.org/main?cmd=changeset;node=dbdd51242711

we didn't checked for DISPLAY on Mac previously
Comment 10 Thomas Preisler 2008-12-12 18:00:22 UTC
I checked the 6.5_fixes sources and it *does* set DISPLAY on Mac if not set. I think this check was (by accident) removed when I fixed 
http://www.netbeans.org/issues/show_bug.cgi?id=153166. Adding the check back should fix Alexander's problem. Root cause of the X11 I'm seeing on my 
Mac is different although the symptom are the same: X11 display refused. Not even xterm from a terminal works and I have to restart X11 to get it to work 
again.
Comment 11 Thomas Preisler 2008-12-12 18:03:52 UTC
I meant 6.5 sources. Fix for 153166 was backported to 6.5_fixes 6.5_fixes may be broken too.
Comment 12 Quality Engineering 2008-12-13 17:04:45 UTC
Integrated into 'main-golden', will be available in build *200812131401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/dbdd51242711
User: Sergey Grinev <sergius@netbeans.org>
Log: possible fix for #153396 Can't open display
Comment 13 Alexander Pepin 2008-12-15 13:14:07 UTC
fixed with the last changeset
Comment 14 Alexander Pepin 2008-12-15 13:47:44 UTC
verified in build 20081215
need to be included into patch2 to fix the flaw in patch1
Comment 15 jinb 2009-01-07 20:04:10 UTC
fix backported into release65_fixes branch
http://hg.netbeans.org/release65_fixes/rev/ec012e715706
Comment 16 Alexander Pepin 2009-01-19 18:55:07 UTC
verified in patch2