Sysprogs forums › Forums › VisualGDB › x_display = XOpenDisplay(NULL); returns NULL on latest UBUNTU systems
- This topic has 24 replies, 2 voices, and was last updated 5 years, 6 months ago by Brian Beuken.
-
AuthorPosts
-
July 19, 2018 at 18:16 #21412Brian BeukenParticipant
Got an odd issue, which I don’t “think” is VisualGDB related but it might be as there is some variables associated with the Xserver.
On an Odroid XU4 I recently upgraded it to the latest version of Ubuntu and now all my code fails at this point
x_display = XOpenDisplay(NULL);because x_display is always returning NULL, which is odd as it worked fine on previous versions.
I am also noting the same issue on a Lubuntu version on a NanoPi T4 SBC,
X11 is installed and everything compiles fine, but I can’t open a display. On the command line to check the DISPLAY environment variable I get
env|grep -e DISPLAY
DISPLAY=localhost:10.0Suggesting the DISPLAY variable is set up, even hard coding the “:10.0” or “:10” into XOpenDisplay still returns null.
Any ideas what might be wrong?
Debian and Rasbian based systems are fine. Just later version of Ubuntu
July 19, 2018 at 18:36 #21413supportKeymasterHi,
According to our records, your technical support period has expired. In order to keep on receiving technical support, please renew your license.
July 19, 2018 at 19:34 #21414Brian BeukenParticipantah yes, so it has, ok I’ll get that renewed when we go back to work after the holidays. Thanks
July 20, 2018 at 05:22 #21421supportKeymasterHi,
No problem. Feel free to ping us once your license gets renewed and we can share some tricks on diagnosing this.
July 20, 2018 at 11:49 #21424Brian BeukenParticipantHappy to report, its now been renewed our purchase manager was working today..
any idea what the issue might be?
July 20, 2018 at 23:48 #21425supportKeymasterHi,
Thanks for renewing your license. There are a few different ways in which VisualGDB can handle X11-based applications, so please let us know the following:
- Are you building the code on the device, or using a cross-compiler (that involves gdbserver)?
- Are you redirecting X11 windows to the Windows machine, or showing them on the target device (via VisualGDB Project Properties -> Debug Settings)?
Also do the regular X11-based tools (e.g. xterm) work when launched over SSH with SmarTTY or when launched directly using the keyboard/video output on the board?
July 23, 2018 at 03:08 #21432Brian BeukenParticipantHi
I’m building on the targets.
No, the setting in the VGDB properties is set to RemoteX11 windows not allowed. but setting to Display = 0 or Shown via XMing work either.
SmarTTY seems to work fine launched from the Visual Studio tool SSH manager, I’ve not tried it any other way.
The code compiles and starts up fine, but during my linux X11 display set up, I get to here
/*
* X11 native display initialization
*/x_display = XOpenDisplay(NULL);
if (x_display == NULL)
{
return ; // we need to trap this;
}where x_display is NULL causing a return (currently untrapped)
- This reply was modified 6 years, 5 months ago by Brian Beuken.
July 23, 2018 at 20:34 #21453supportKeymasterHi,
Thanks for checking that SmarTTY works, however this is unfortunately insufficient to track this down. Please try running xterm via SmarTTY and let us know if it shows the window on the Windows side correctly.
June 5, 2019 at 00:34 #25059Brian BeukenParticipantHi again, returning to this as it is now showing up on my Jetson Nano with Ubuntu 18.04, it does seem to be mostly an issue with Ubuntu systems, though xhost + and sometime sinstalling Xorg-dev usually fixes it.
For this instance, I’ve done xhost +, Xorg and Xorg-dev are in place but when I try to deploy in debug mode via Visual GDB XOpenDisplay(NULL) still returns null and I am unable to open a window. And my program stops as it can’t continue without an Xdisplay
However… if I go to the Jetson and open a terminal, navigate to the folder containing the deployed build… and use ./runnablebuild
The project works perfectly (though of course there’s no gdb working to get info or stop it)I have the Linux Gui (X11) set to show on target and as per the warning, I am logged in as brian, and xhost+ has been entered to avoid blocks..
Any ideas what this might be, its rather a pain to not be able to deply and run?
June 5, 2019 at 00:36 #25060supportKeymasterSorry, this is not something managed by VisualGDB, so it’s hard to give any specific advice. Please refer to the Linux and X11 documentation.
June 5, 2019 at 00:57 #25061Brian BeukenParticipantWell it does seem to relate to VisualGDB, why would it fail to open an Xwindow when run from GDB and yet happily open it when run from the terminal?
June 5, 2019 at 01:05 #25062supportKeymasterVisualGDB simply requests the target to enable the X11-over-SSH forwarding. The exact implementation of this logic is provided by the target and is outside VisualGDB’s control. Please refer to the Linux and X11 documentation for more details.
June 5, 2019 at 01:07 #25063Brian BeukenParticipantincidently if I set the debug option LinuxGUI(X11) to Forward to Windows… The call to XOpenDisplay does indeed return a valid value, but I have no XMing ability on my system, so VistualGDB does seem to have some impact on the XOpenDisplay function?
June 5, 2019 at 01:08 #25064Brian BeukenParticipanthmm ok but I can’t locate any information that will explain this… I will attempt to do a non GDB build and see what happens
June 5, 2019 at 01:08 #25065supportKeymasterVisualGDB simply requests the target to enable the X11-over-SSH forwarding. The exact implementation of this logic is provided by the target and is outside VisualGDB’s control. Please refer to the Linux and X11 documentation for more details.
-
AuthorPosts
- You must be logged in to reply to this topic.