GNOME Bugzilla – Bug 736941
computer-player: don't run search on UI thread
Last modified: 2014-09-24 13:49:00 UTC
Don't run the search on the UI thread.
Created attachment 286563 [details] [review] computer-player: don't run search on UI thread It doesn't matter at the low depths we use, but it'd be better not to block the UI for the duration of the search.
Attachment 286563 [details] pushed as 8bcb83c - computer-player: don't run search on UI thread
I reopen (if it works this time xD ) as I have many bugs since this morning. I had some: (iagno:30047): Gdk-WARNING **: iagno: Fatal IO error 11 (Ressource temporairement non disponible) on X server :0. but I’m not sure they are related. But now, I have a: [xcb] Unknown sequence number while processing queue [xcb] Most likely this is a multi-threaded client and XInitThreads has not been called [xcb] Aborting, sorry about that. iagno: xcb_io.c :274 : poll_for_event: l'assertion « !xcb_xlib_threads_sequence_lost » a échoué. Abandon (core dumped) and I’m quite sure it is. The command-line was `jhbuild run iagno -l 3 --fast-mode` with all my currently published patches applied.
I got the first error too, and assumed I was leaking threads, but I'm sure that's not happening, so I'm not sure what's wrong. And that second error looks like gobbledygook to me. Anyway I'm pretty sure my patch is indeed causing these.
How easy is it for you to reproduce this? I got your first error once, but have had no luck since then. From the error message, my guess is that we're accidentally using a GTK+ function from the AI thread, which is unsafe. But I don't see where or how we could be doing that.
(In reply to comment #5) > How easy is it for you to reproduce this? Meaning, if you could get a backtrace in gdb ('thread apply all bt full'), that would be great....
Got a backtrace with G_DEBUG=fatal-warnings
+ Trace 234113
Thread 9 (Thread 0x7fffd3c90700 (LWP 20521))
Created attachment 286690 [details] [review] Require vala 0.25.1 For Source.REMOVE
Created attachment 286691 [details] [review] computer-player: only use GTK+ on the UI thread
Attachment 286690 [details] pushed as 6899edc - Require vala 0.25.1 Attachment 286691 [details] pushed as 2fe4898 - computer-player: only use GTK+ on the UI thread
I reopen. There’s a crash when you undo one of your moves and the AI already began to think (like it’s usual in level 3, until my next patch is pushed), after the AI thread finished its calculations.
Created attachment 286758 [details] [review] computer-player: fix cancel_move()
The game is blocked if you undo fast two times and play, it’s the opponent turn and it doesn’t think. ^^
Created attachment 286878 [details] [review] computer-player: fix cancel_move()
Created attachment 286946 [details] [review] Fix cancel_move(). Looks like it works, even if I don’t understand all. Here is an updated patch that works on top of the “Faster history” patches, if needed.
Each yield statement causes the function to return, and each call to move_async.callback() causes it to resume from where it previously yielded. I feel like the code is more complicated than it ought to be, though. :/ Thanks for the free rebase.
Actually, for some reason my patch applies without change, and yours doesn't at all. Are you sure you haven't screwed up your local branches again? :) Whatever....
Comment on attachment 286878 [details] [review] computer-player: fix cancel_move() Attachment 286878 [details] pushed as 0f7e313 - computer-player: fix cancel_move()