Thu 04 Nov 2010 04:29:18 PM UTC, comment #4:
Every rollout initiated from the Gtk GUI crashes here, too.
Another flavor: I start the tty version with "gnubg -t", then I type "new game", "rollout", and then CTRL-C after a couple of seconds.
After "quit" the program segfaults most of the time.
Valgrind brought me a little closer: The segfault is caused by OutputRolloutResult() in format.c, called from TextRolloutProgress in progress.c. I could no longer reproduce the segfault, when I just return the pointer sz in OutputRolloutResult() after it was initialized to the empty string.
OutputRolloutResult(shudder, what an ugly mess!) is seemingly not the problem because the function works okay while the rollout is in progress.
The segfault happens in the clean-up code: gnubg.c:PromptForExit() calls ProcessEvents() which calls g_main_context_iteration(). There I lost track.
You can probably reproduce the problem even without the crash: If the program does not crash, then you can see that the rollout interrupted with CTRL-C, and finished after that, is somehow still active. After confirming the quit, TextRolloutProgress() is called again, and outputs the rollout results (again), and most probably the buffers used by the function are no longer valid at this time.
I don't understand enough of the code but it looks to me that after the rollout is finished, some code has to be removed from the event loop and it isn't.
I can reproduce the behavior with today's CVS snapshot, with Gentoo build from 2010-01-07, and with earlier CVS versions from autumn 2009. If you need more detailled information (the valgrind output or tests I should run) just tell me.
Hope that helps,
Guido
|