xshogi leaves gnushogi running after exit

Bug #131017 reported by Adrian Petrescu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnushogi (Ubuntu)
Fix Released
Undecided
Adrian Petrescu

Bug Description

Binary package hint: gnushogi

I am using gnushogi and xshogi 1.3-9 from the Feisty repositories.

STEPS TO REPRODUCE:
1. Start xshogi
2. Play a move or two against the computer in order to get it to launch the gnushogi subprocess
3. Exit xshogi using the window manager's "X" button instead of xshogi's "Exit" button.
4. Do a "ps aux | grep gnushogi"

You will see that gnushogi continues running even though xshogi has been stopped, with no way of stopping it short of killing the process by hand.

This is a very big deal because the longer gnushogi is running, the deeper it will inspect the game tree. After about an hour after doing this, gnushogi will be in the 90+% range of CPU usage and will cause a VERY visible slowdown in the system.

This bug is reproducible on every Ubuntu installation I've ever encountered.

I am not a gnushogi developer, but I don't think this would be a very hard bug to fix, but its consequences are quite severe.

Tags: patch
Revision history for this message
Adrian Petrescu (apetresc) wrote :

I just went and built the upstream source from http://directory.fsf.org/gnushogi.html and tried to reproduce the bug.

The bug exists there too. So it is not a problem with Ubuntu's package but a problem with gnushogi itself.

Revision history for this message
Adrian Petrescu (apetresc) wrote :

Nobody seemed interested in fixing this, so I went and did it myself. The problem was in xshogi.c . I added a protocol callback on the WM_DELETE_WINDOW event and tied it to a new handler (which also had to be added to the header file).

Now, when someone X's the program, ShutdownShogiPrograms() is also called, thus closing gnushogi, thus not leaving an invisible 100%-CPU process lying around :)

This is my first time submitting a patch to Ubuntu, so I hope I did everything right!

Changed in gnushogi:
assignee: nobody → apetrescu
status: New → Fix Released
status: Fix Released → In Progress
Revision history for this message
Adrian Petrescu (apetresc) wrote :

The patch that fixes this bug has been sitting in the comments for a long time now... what do I have to do to have this patch applied? (new contributor here)

Changed in gnushogi:
status: In Progress → Fix Committed
Changed in gnushogi:
status: Fix Committed → In Progress
Revision history for this message
Yann Dirson (ydirson-altern) wrote :

Separately from the xshogi patch here, the bug in gnushogi itself causing the infinite loop when it gets a SIGINT has just been fixed in 1.3.2-6.

Revision history for this message
Adrian Petrescu (apetresc) wrote :

That's great news, Yann. I notice you're the new maintainer of gnushogi in Debian. Any chance you could get the newest version of gnushogi into Ubuntu as well? It would be so good if this (very serious, in my opinion) bug could FINALLY be resolved after 2 years!

Revision history for this message
Yann Dirson (ydirson-altern) wrote :

1.3.2-7 seems to be in Ubuntu now, maybe this bug can be closed ?

Revision history for this message
Adrian Petrescu (apetresc) wrote :

Yes, it appears to be fixed now. It can be closed.

Changed in gnushogi (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.