Bug 30172

Summary: Segmentation fault in teachgammon
Product: Base System Reporter: Chris Wilmes <cwilmes>
Component: miscAssignee: dd <dd>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Chris Wilmes 2001-08-28 23:30:00 UTC
Segmentation fault in teachgammon (the backgammon tutorial in /usr/games) when returning to main menu from some other menu.

Problem also occurs on a friend's machine, which is running FreeBSD-current.

How-To-Repeat: Run the following commands:
% teachgammon (starts the program)
<space>       (takes user to main menu after initial screen)
i             (takes user to Introduction)
?             (is supposed to return user to main menu, but instead causes segmentation fault)
Comment 1 dima 2001-08-29 06:24:54 UTC
Chris Wilmes <cwilmes@creighton.edu> wrote:

Please wrap lines at or less than 80 characters.  Thanks.

> >Description:
> Segmentation fault in teachgammon (the backgammon tutorial in /usr/games) when returning to main menu from some other menu.
> 
> Problem also occurs on a friend's machine, which is running FreeBSD-current.
> >How-To-Repeat:
> Run the following commands:
> % teachgammon (starts the program)
> <space>       (takes user to main menu after initial screen)
> i             (takes user to Introduction)
> ?             (is supposed to return user to main menu, but instead causes segmentation fault)

Please try this patch: (apply in src/games/backgammon/teachgammon)

Index: ttext2.c
===================================================================
RCS file: /ref/cvsf/src/games/backgammon/teachgammon/ttext2.c,v
retrieving revision 1.3
diff -u -r1.3 ttext2.c
--- ttext2.c	30 Nov 1999 03:48:30 -0000	1.3
+++ ttext2.c	29 Aug 2001 05:23:04 -0000
@@ -41,7 +41,8 @@
 
 #include "back.h"
 
-char *prompt, *list, *opts;
+extern const char *const list[];
+char *prompt, *opts;
 
 const char	*const doubl[] = {
     "\nDoubling:",
Comment 2 dd freebsd_committer freebsd_triage 2001-08-30 08:41:52 UTC
Responsible Changed
From-To: freebsd-bugs->dd

I have a fix for this.
Comment 3 dd freebsd_committer freebsd_triage 2001-09-03 15:19:47 UTC
State Changed
From-To: open->closed

Fixed in -current, will MFC after a while.