Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 537010 - games-misc/bsd-games - cribbage should not erase responses to prompts
Summary: games-misc/bsd-games - cribbage should not erase responses to prompts
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Games (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-19 00:13 UTC by Don Wilburn
Modified: 2015-05-04 21:15 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info for bsd-games (bsd-games.txt,4.57 KB, text/plain)
2015-01-19 00:13 UTC, Don Wilburn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Don Wilburn 2015-01-19 00:13:16 UTC
Created attachment 394308 [details]
emerge --info for bsd-games

The problem is not with cribbage, but the symptom is.  I hope the bug wrangler can get it to the right place.
The cribbage game gives a series of prompts and status messages.  As soon as I touch a valid key in response, the prompt is eradicated and the response remains.  The prompt should not be erased in a proper version of the game. At least, not until is scrolled past several moves later.
I have an old version of Debian on my alpha.  The Debian cribbage plays correctly from Debian.  The Debian cribbage plays wrongly from Gentoo.  The Gentoo cribbage plays correctly in Debian.  The Gentoo cribbage plays wrongly in Gentoo.
The Debian installation is a few years old.  It's linux 2.6.x and has libc-2.7.so and libncurses.so.5.7.  
My Gentoo installation is pretty recent.  It's linux 3.17.4-gentoo, with libc-2.15.so and libncurses.so.5.9
This problem has manifested itself on all versions of Gentoo I've used.  
I used a separate Gentoo installation to enable a backtrace, but I lack the knowledge to properly acquire/interpret such data.
I don't know if any alpha developers play cribbage.  Please let me know how I can help pinpoint the cause.  Cribbage is small, but its dependencies are pretty fundamental.  Thanks.
Comment 1 Don Wilburn 2015-01-19 19:32:13 UTC
To clarify, the responses are not erased.  The prompt is erased.  
For example:  
*Cut to see whose crib it is -- low card wins?_
When a number is entered, the prompt should remain, like:
*Cut to see whose crib it is -- low card wins?23
But, the prompt disappears when a number it touched, leaving:
*23
FWIW, the first two prompts are not affected.  Those are asking if the player wants instructions and a long/short game.  The improper erasures begin with the third prompt (the cut) and continue there forward.
Comment 2 Tobias Klausmann gentoo-dev 2015-02-03 08:52:59 UTC
I just tried on my amd64 machine and the opening dialogue looks like this:

                                       Do you need instructions for cribbage? N
                                       Long (to 121) or Short (to 61)? L
                                      *5
                                        wins? 

So there is some breakage in how cribbage uses the terminal, but it is not Alpha-specific. Cribbage uses ncurses, so the bug might be in the interaction between it and the terminal library.

Removing Alpha from CC, since it's reproducible on amd64.
Comment 3 Don Wilburn 2015-05-04 21:15:29 UTC
I'm no programmer, but I looked around the internet for the cribbage source.  
The cribbage io.c code has a part that reads:
/* loop reading in the string, and put it in a temporary buffer */
	for (sp = linebuf; (c = readchar()) != '\n'; clrtoeol(), refresh()) {

I'd speculate that the problem is there.  The clrtoeol() function is from ncurses.  

It looks like the clrtoeol() function is supposed to clear from the cursor to the end of line.  In this bug, the part on the left I call the prompt is removed too.
Since the cribbage program works on an older installation, perhaps an ncurses update is what caused this problem.

If it is ncurses, I'd like to refer the problem to their developers.  I don't know how to confirm my speculation before I do such a thing.

I'm changing hardware to ALL, since it happens on amd64 too.  
I built a 32 bit ncurses library for my own amd64 Gentoo multilib installation, but an old 32 bit cribbage showed the same bug.  That was useless.
Slackware64 cribbage is broken too, ha ha.

The Gentoo developers may have bigger bugs to wrangle.  The backtrace is a mystery to me and might not be useful anyway.  Can anyone refer me somewhere for help on proving whether it's ncurses or not?  I can't imagine why an ncurses bug would only show up in cribbage.

Thanks,  DW