Linux failure to compile wxString-related

Discussion of compilation configuration and issues

Re: Linux failure to compile wxString-related

Postby dev-wcs » Fri Nov 04, 2011 4:29 pm

Besides the current issue with wx on 64-bit Mac, there are other reasons to make sure wx (or any graphics library) is completely separate from the base code.

- We also want to be able to build the console version and plugins without any wx. And we want to be able to create APIs that call into the base code, and we don't want to have to include wx in that.
- When wx updates happen, only the GUI code will need to be updated.
- We also want to keep them separate to make it easy to code up the GUI with a different graphics library, in addition to, or as a replacement for, the wx version.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Views expressed are my own and
do not necessarily reflect those
of my employer, or anyone else.
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
dev-wcs
 
Posts: 97
Joined: Tue Jun 10, 2008 1:01 pm

Re: Linux failure to compile wxString-related

Postby SWGlassPit » Fri Nov 04, 2011 6:55 pm

That makes sense. If I can get the GUI code working under wxWidgets 3.0 (currently 2.9.2), that will clear up a lot of the mess, as it won't be problematic to use std::string and char pointers in the interfaces like it is with the current wxWidgets 2.8 API.
SWGlassPit
 
Posts: 15
Joined: Wed Oct 19, 2011 8:56 pm

Re: Linux failure to compile wxString-related

Postby SWGlassPit » Wed Nov 09, 2011 5:02 pm

SWGlassPit wrote:Let me get back to you on that -- I have some things I can still check. I was able to get other OpenGL-based code to run through the wxWidgets library, so I think the problem isn't in the backend -- that, or I'm just running into a bizarre edge case. Most likely, it's one of two things: either some of the changes I made in the wholesale sweep of things broke something in the wxGLCanvas object definition, or there's a header I changed that didn't get all of its dependent source files recompiled (testing a clean build first to rule out that option).

If I can't track it down, I may ask later for a debug comparison on a working linux build. I'll let you know if it gets that far though.

Thanks!


Found the source of this ^^^ crashing bug. wxWidgets does not declare wxGLCanvas to be double-buffered by default, and wxGLCanvas::SwapBuffers() does not perform a sanity check to make sure the canvas is double-buffered. Consequently, calling SwapBuffers() on a single-buffered canvas sends bogus information to the OpenGL backend, which makes gdk/X throw a fit. Removing the SwapBuffers() line in the VisualModelCanvas::onPaint() method fixes the problem, but at the cost of the image flickering when being dragged around. Explicitly passing WX_GL_DOUBLEBUFFER in the attributes argument to the wxGLCanvas constructor while retaining the SwapBuffers() call fixes the problem completely.
SWGlassPit
 
Posts: 15
Joined: Wed Oct 19, 2011 8:56 pm

Re: Linux failure to compile wxString-related

Postby jjkparker » Wed Nov 09, 2011 6:10 pm

Great, that's good to hear. It sounds like this bug isn't specific to your changes, right?
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Linux failure to compile wxString-related

Postby SWGlassPit » Wed Nov 09, 2011 7:04 pm

That's correct. I wonder if the Windows build of wxWidgets implicitly double-buffers the canvas. Need to look at the code to see.


Edit: --- Yes, the windows version of wxGLCanvas uses implicit double-buffering. The GTK version, on the other hand, does not.
SWGlassPit
 
Posts: 15
Joined: Wed Oct 19, 2011 8:56 pm

Re: Linux failure to compile wxString-related

Postby jjkparker » Thu Nov 10, 2011 5:35 pm

Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Linux failure to compile wxString-related

Postby SWGlassPit » Mon Nov 14, 2011 10:21 pm

Not sure if the bugzilla is not supposed to be public, but I don't have access to the linked bug.

I also found an access-after-free segfault in the destructors for OrbitViewCanvas and GroundTrackCanvas -- both destructors delete the modelContext variable from the ModelManager instance. The problem, however, is that there is only one wxGLContext for the program, and if a canvas tab is closed, the context is destroyed, causing a segfault when another canvas tries to use it. Fixed by removing the offending code from those destructors and moving it to the ModelManager destructor.
SWGlassPit
 
Posts: 15
Joined: Wed Oct 19, 2011 8:56 pm

Re: Linux failure to compile wxString-related

Postby jjkparker » Tue Nov 15, 2011 3:49 pm

The bugs are supposed to be public, but we just discovered some sort of misconfiguration the past couple days that's preventing that.

When that gets fixed I'll submit a second one as well. Keep them coming, as far as I'm concerned. If you'd like a bug submission account, we can probably give you access, but I'm also willing to proxy.

EDIT: Bugzilla is fixed now. Here's the new bug:
http://pows003.gsfc.nasa.gov/bugzilla/s ... gi?id=2591
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

Re: Linux failure to compile wxString-related

Postby SWGlassPit » Tue Nov 15, 2011 4:40 pm

If you could add edit permissions for me, I could upload my patches and comments for those bugs. Thanks!
SWGlassPit
 
Posts: 15
Joined: Wed Oct 19, 2011 8:56 pm

Re: Linux failure to compile wxString-related

Postby jjkparker » Tue Nov 15, 2011 4:47 pm

No problem, go ahead and make yourself an account and I'll approve it for you.
Joel J. K. Parker
Flight dynamics engineer, GMAT team
http://gmatcentral.org
jjkparker
 
Posts: 617
Joined: Thu Jan 07, 2010 9:48 pm
Location: NASA Goddard Space Flight Center, Greenbelt, MD

PreviousNext

Return to Compiling GMAT

Who is online

Users browsing this forum: No registered users and 1 guest

cron