A reckless adventure with OpenGL
Moderator: Committer
Re: A reckless adventure with OpenGL
I couldn't apply your version of the patch because of line ending trouble, but the MSVC files are irrelevant here, so it should be all good.
Any code by me in this post is released under GPL 2.0 or later.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: A reckless adventure with OpenGL
Just got a crash when exiting the program. I started FreeOrion, went into single player galaxy exit, cancelled, went into options, set a few things like FPS limit and man rendering options, then clicked done, then exit on the main menu, and then got a crash popup. Attaching the debugger, the output says:
And from the stack, it looks to be something in a GL buffer, so I'm posting to this thread...
From some additional testing, it seems to be caused by going into the options screen, mousing over some text to make a popup appear (consistent with the BroseInfoWnd stuff in the stack), and then clicking done, and Exit on the main menu. I don't get a crash on exit without first making a tooltip appear by mousing over options screen text.
Code: Select all
Unhandled exception at 0x042faf2c in FreeOrion.exe: 0xC0000005: Access violation reading location 0x000007f0.
Code: Select all
> GiGi.dll!GG::GLBufferBase::~GLBufferBase() Line 24 + 0x1c bytes C++
GiGi.dll!GG::GLTexCoordBuffer::`vector deleting destructor'() + 0x5d bytes C++
GiGi.dll!GG::Font::RenderCache::~RenderCache() Line 647 + 0x65 bytes C++
GiGi.dll!GG::TextControl::~TextControl() Line 57 + 0x4b bytes C++
GiGi.dll!GG::TextControl::`vector deleting destructor'() + 0x43 bytes C++
GiGi.dll!GG::Wnd::~Wnd() Line 232 + 0x1a bytes C++
GiGi.dll!GG::Layout::~Layout() + 0xf3 bytes C++
GiGi.dll!GG::Layout::`vector deleting destructor'() + 0x43 bytes C++
GiGi.dll!GG::Wnd::~Wnd() Line 232 + 0x1a bytes C++
GiGi.dll!GG::TextBoxBrowseInfoWnd::~TextBoxBrowseInfoWnd() + 0xab bytes C++
FreeOrion.exe!GG::TextBoxBrowseInfoWnd::`scalar deleting destructor'() + 0xc bytes C++
Re: A reckless adventure with OpenGL
Couldn't reproduce. Found a different exit issue, though. (See other thread) How possible is it to try valgrind on windows?
Any code by me in this post is released under GPL 2.0 or later.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: A reckless adventure with OpenGL
Never tried it.
Crash also happens after going into the single player galaxy setup, hovering over some text to get a tooltip, cancelling, then exiting from the splash menu. Doesn't happen without showing a tooltip.
Crash also happens after going into the single player galaxy setup, hovering over some text to get a tooltip, cancelling, then exiting from the splash menu. Doesn't happen without showing a tooltip.
Re: A reckless adventure with OpenGL
Still couldn't reproduce, but found a potential cause. TextControl isn't checking if it has a cache before deleting it. Good idea to fix that whether or not it fixes the problem.
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
Any code by me in this post is released under GPL 2.0 or later.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: A reckless adventure with OpenGL
Applies and builds OK for me, and runs, but still crashes the same way.
Re: A reckless adventure with OpenGL
Deleting a NULL pointer is valid code in c++ (a no-op).
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: A reckless adventure with OpenGL
I suppose it's also notable that setting a class member variable to 0 in the destructor is pointless...
Re: A reckless adventure with OpenGL
Not pointless. Someone may try to use a reference to the class after it has been deleted and before other data has been written to the memory. Doing things that make that easy to notice when debugging can be good. Of course, TextControl is sometimes validly in a state without the cache, which weakens that point. Perhaps a more valid view is to hate seeing a delete without a corresponding setting to 0. Some style guides enforce that.
Didn't know about null deletion being a NOP. Seems very un-c++ like to be able to deal with that. No ideas on the error, then.
Didn't know about null deletion being a NOP. Seems very un-c++ like to be able to deal with that. No ideas on the error, then.
Any code by me in this post is released under GPL 2.0 or later.
Re: A reckless adventure with OpenGL
sure, just as there are various places in the FO code where we have break statements at the end of a default case block; kind of pointless with the code exactly as it is, but just a good thing to be in the habit of doing at the end of case blocks.Mitten.O wrote:Perhaps a more valid view is to hate seeing a delete without a corresponding setting to 0.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: A reckless adventure with OpenGL
Has this patch been committed?Mitten.O wrote:Still couldn't reproduce, but found a potential cause. TextControl isn't checking if it has a cache before deleting it. Good idea to fix that whether or not it fixes the problem.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: A reckless adventure with OpenGL
The above discussion was unresolved as to whether there was any benefit to the patch.Vezzra wrote:Has this patch been committed?
Re: A reckless adventure with OpenGL
Well,Geoff the Medio wrote:The above discussion was unresolved as to whether there was any benefit to the patch.
...this sounds like it would be a good idea to commit that patch anyway, regardless if it fixes the issue at hand or not...?Mitten.O wrote:TextControl isn't checking if it has a cache before deleting it. Good idea to fix that whether or not it fixes the problem.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13587
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: A reckless adventure with OpenGL
If you want, go ahead.Vezzra wrote:...sounds like it would be a good idea to commit that patch...