Bug 79933 - Gnibbles exits unexpectedly trying to load level 000
Summary: Gnibbles exits unexpectedly trying to load level 000
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gnome-games
Version: 7.3
Hardware: i686
OS: Linux
medium
low
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-12-18 03:40 UTC by C Duvall
Modified: 2015-01-08 00:02 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-12-19 15:55:36 UTC


Attachments (Terms of Use)
Test patch to get rid of level 000 (549 bytes, patch)
2002-12-18 13:18 UTC, C Duvall
no flags Details | Diff

Description C Duvall 2002-12-18 03:40:13 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 Galeon/1.2.6 (X11; Linux i686; U;) Gecko/20020913

Description of problem:
When playing gnibbles, with the 'levels in random order' option selected,
gnibbles will occasionally exit unexpectedly attempting to load a new level. The
message on the console is:

Ack! Couldn't load level file /usr/share/gnibbles/level000.gnl

It's reproducable consistently when playing many, many games. The levels are in
random order, you know :)

--C

Version-Release number of selected component (if applicable):
gnome-games-1.4.0.1-5

How reproducible:
Sometimes

Steps to Reproduce:
1. Start Gnibbles
2. Choose the levels in random order option
3. Play a couple hundred games
    

Actual Results:  Game exits unexpectedly.

Expected Results:  A new level should be loaded.

Comment 1 Havoc Pennington 2002-12-18 04:31:45 UTC
Hmm, is this an excuse to spend an entire day playing gnibbles? ;-)

Comment 2 C Duvall 2002-12-18 13:18:09 UTC
Created attachment 88794 [details]
Test patch to get rid of level 000

This patch is untested as I haven't figured much out about rpm yet, but it
seems to be the only place where current_level could be set to 0.

Comment 3 Miloslav Trmac 2002-12-18 17:28:45 UTC
-
		tmp = rand () % MAXLEVEL;
+
		tmp = rand () % MAXLEVEL + 1;
This should be
+                       tmp = rand () % (MAXLEVEL - 1) + 1;
Otherwise you remove 0, and add MAXLEVEL


Comment 4 C Duvall 2002-12-18 20:24:16 UTC
MAXLEVEL is defined as 26 in the sources I have, and there is a level for it.
Other places in the source it does rand() % MAXLEVEL + 1, validly. It looks like
valid levels are 1-MAXLEVEL, inclusive.

Comment 5 C Duvall 2002-12-19 15:25:34 UTC
Looking further, this bug seems to be a dup of bug 52900 at bugzilla.gnome.org.
Same trivial patch was submitted as fix by someone else, seems to be fixed now
upstream.

Comment 6 Havoc Pennington 2002-12-19 15:55:36 UTC
Thanks for looking into this. We should have the fix in the next release, then.


Note You need to log in before you can comment on or make changes to this bug.