x_display = XOpenDisplay(NULL); returns NULL on latest UBUNTU systems

Sysprogs forums Forums VisualGDB x_display = XOpenDisplay(NULL); returns NULL on latest UBUNTU systems

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #21412
    Brian Beuken
    Participant

    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.0

    Suggesting 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

     

     

    #21413
    support
    Keymaster

    Hi,

    According to our records, your technical support period has expired. In order to keep on receiving technical support, please renew your license.

    #21414
    Brian Beuken
    Participant

    ah yes, so it has, ok I’ll get that renewed when we go back to work after the holidays. Thanks

     

     

    #21421
    support
    Keymaster

    Hi,

    No problem. Feel free to ping us once your license gets renewed and we can share some tricks on diagnosing this.

    #21424
    Brian Beuken
    Participant

    Happy to report, its now been renewed our purchase manager was working today..

     

    any idea what the issue might be?

     

    #21425
    support
    Keymaster

    Hi,

    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?

    #21432
    Brian Beuken
    Participant

    Hi

    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.
    #21453
    support
    Keymaster

    Hi,

    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.

    #25059
    Brian Beuken
    Participant

    Hi 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?

     

    #25060
    support
    Keymaster

    Sorry, this is not something managed by VisualGDB, so it’s hard to give any specific advice. Please refer to the Linux and X11 documentation.

    #25061
    Brian Beuken
    Participant

    Well 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?

     

    #25062
    support
    Keymaster

    VisualGDB 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.

    #25063
    Brian Beuken
    Participant

    incidently 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?

    #25064
    Brian Beuken
    Participant

    hmm 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

    #25065
    support
    Keymaster

    VisualGDB 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.

Viewing 15 posts - 1 through 15 (of 25 total)
  • You must be logged in to reply to this topic.