Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

irregular segfaults during game play #30

Closed
LynxAbraxas opened this issue Nov 17, 2018 · 9 comments · Fixed by #298
Closed

irregular segfaults during game play #30

LynxAbraxas opened this issue Nov 17, 2018 · 9 comments · Fixed by #298
Milestone

Comments

@LynxAbraxas
Copy link
Contributor

Observed irregular segfaults that happen after playing a few up to many rounds (master branch run under linux, sometimes not occurring for hours) no obviously related to some specific game state. Probably needs gdb debugging during playing.

@LynxAbraxas
Copy link
Contributor Author

Tested if SDL surface locking is causing this with the changes from (LynxAbraxas@6a96bd2) and (LynxAbraxas@a6998b7) the crashes seem to be replaced by dead-locks of the game.

@MartinGuehmann
Copy link
Collaborator

Hey, I got a segfault while it was running on the debugger, must have something to do with the mouse and the blitter. Concerning that I changed the blitter thing on the Windows version, this does not seem so unsurprising.

#0 ??() at
#1 SDL_LowerBlit() at /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
#2 SDL_UpperBlit() at /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
#3 aui_SDLBlitter::Blt16To16(aui_Surface*, tagRECT*, aui_Surface*, tagRECT*, unsigned int)() at
#4 C3Blitter::Blt16To16(aui_Surface*, tagRECT*, aui_Surface*, tagRECT*, unsigned int)() at
#5 aui_Blitter::Blt(aui_Surface*, int, int, aui_Surface*, tagRECT*, unsigned int)() at
#6 aui_Mouse::BltDirtyRectInfoToPrimary()() at
#7 aui_UI::Draw()() at
#8 aui_UI::Process()() at
#9 CivApp::ProcessUI(unsigned int, unsigned int&)() at
#10 CivApp::Process()() at
#11 CivMain(int, char**)() at
#12 main() at

Unfortunately, I haven't figured out how to use the debugger in kdevelop. It shows me the frame stack but I can not click on the function and it sends me to the place in the source file if it is a cpp file. However, it does it if it is a c file.

The only thing I would do before really debugging is to merge in the changes from the Linux branch. It might be fixed there. Or the problem might be different. But I think that is could also be related to the mouse artifacts.

@LynxAbraxas
Copy link
Contributor Author

Yes, that looks very much like the ones I got, see e.g. the commit message of a6998b7.

@LynxAbraxas
Copy link
Contributor Author

Porting the game to SDL-2 (#92) might solve this issue, it might be better to spent time on #92 before loosing unnecessary time on this issue.

@LynxAbraxas
Copy link
Contributor Author

LynxAbraxas commented Dec 30, 2019

While debugging with f54c83e caught this:

Thread 1 "ctp2" hit Catchpoint 1 (signal SIGSEGV), 0x00007ffff76d8740 in SDL_Flip () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
#0  0x00007ffff76d8740 in SDL_Flip () from /usr/lib/x86_64-linux-gnu/libSDL-1.2.so.0
#1  0x0000555555845376 in aui_UI::Draw (this=0x5555578725bc) at ui/aui_common/aui_ui.cpp:1126
#2  0x0000555555846d6a in aui_UI::Process (this=0x5555578725bc) at ui/aui_common/aui_ui.cpp:1849
#3  0x00005555557809a4 in CivApp::ProcessUI (this=0x555556cb090c, target_milliseconds=30, used_milliseconds=@0x7fffffffeb0c: 0) at ctp/civapp.cpp:2397
#4  0x0000555555780e4a in CivApp::Process (this=0x555556cb090c) at ctp/civapp.cpp:2550
#5  0x0000555555776c68 in CivMain (iCmdShow=2, pSzCmdLine=0x7fffffffecb8) at ctp/civ3_main.cpp:1694
#6  0x0000555555776805 in main (argc=2, argv=0x7fffffffecb8) at ctp/civ3_main.cpp:1440

They have in common that they happen in aui_UI::Draw.

@LynxAbraxas
Copy link
Contributor Author

Tested #298 for many turns now and did not have this segfault any more. Since it did not appear often (sometimes not within weeks), I cannot say for sure that is solve with #298 but am confident that it might be.

@MartinGuehmann
Copy link
Collaborator

I would link this to #298, so that this is closed when #298. If #298 indeed fixes this issue then we can just forget about. If it doesn't then we can still reopen this issue or open a new one.

@LynxAbraxas
Copy link
Contributor Author

I would link this to #298, so that this is closed when #298. If #298 indeed fixes this issue then we can just forget about. If it doesn't then we can still reopen this issue or open a new one.

Sure, I just can't do the linking;-)

@MartinGuehmann MartinGuehmann linked a pull request Apr 24, 2020 that will close this issue
@MartinGuehmann
Copy link
Collaborator

I see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants