monsterz.py crashed with error in blit()

Bug #275492 reported by JoshuaLutz
42
This bug affects 1 person
Affects Status Importance Assigned to Milestone
monsterz (Ubuntu)
Fix Released
Low
David Futcher
Intrepid
Invalid
Undecided
Unassigned
Jaunty
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: monsterz

Since upgrading to Intrepid from Hardy, Monsterz has been broken. The window forms, music starts and then it crashes before any splash screen displays.

ProblemType: Crash
Architecture: i386
DistroRelease: Ubuntu 8.10
ExecutablePath: /usr/share/games/monsterz/monsterz.py
InterpreterPath: /usr/bin/python2.5
Package: monsterz-data 0.7.1-2
PackageArchitecture: all
ProcAttrCurrent: unconfined
ProcCmdline: python /usr/share/games/monsterz/monsterz.py --outfd 42 --data /usr/share/games/monsterz --score /var/games/monsterz
ProcEnviron:
 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
 LANG=en_US.UTF-8
 SHELL=/bin/bash
PythonArgs: ['/usr/share/games/monsterz/monsterz.py', '--outfd', '42', '--data', '/usr/share/games/monsterz', '--score', '/var/games/monsterz']
SourcePackage: monsterz
Title: monsterz.py crashed with error in blit()
Uname: Linux 2.6.27-4-generic i686
UserGroups: adm admin cdrom dialout fuse lpadmin plugdev sambashare

Tags: apport-crash

Related branches

Revision history for this message
JoshuaLutz (josh-lutz) wrote :
Revision history for this message
M Dewitt (dewittmaxine) wrote :

I did a fresh install of Intrepid from Hardy, and I am experiencing the same problem.
I have attached a screen shot of what terminal says.

Revision history for this message
Arnaud Jeansen (ajeans) wrote :

Seems related to what I'm seeing here, a crash a few seconds after start up :

arnaud@dell-desktop:~$ monsterz
Traceback (most recent call last):
  File "/usr/share/games/monsterz/monsterz.py", line 1998, in <module>
    main()
  File "/usr/share/games/monsterz/monsterz.py", line 1993, in main
    monsterz.go()
  File "/usr/share/games/monsterz/monsterz.py", line 1271, in go
    iterator()
  File "/usr/share/games/monsterz/monsterz.py", line 1381, in iterate_menu
    self.copyright_draw()
  File "/usr/share/games/monsterz/monsterz.py", line 1300, in copyright_draw
    system.blit(scroll, (13, 437))
  File "/usr/share/games/monsterz/monsterz.py", line 403, in blit
    self.background.blit(surf, coords)
pygame.error: Surfaces must not be locked during blit

I spent some time tracking this down (this was a regression from hardy) :
monsterz intrepid (0.7.1) + pythom-pygame intrepid (1.8.1) =>blit error
monsterz hardy (0.7.0) + pythom-pygame intrepid (1.8.1) => blit error
monsterz intrepid (0.7.1) + pythom-pygame hardy (1.7.1) => works fine

I read on a pygame mailing list that locking changes were made in 1.8.x, this seems to break monsterz

This has been seen on Gentoo as well :
http://bugs.gentoo.org/show_bug.cgi?id=238774

And has also been relayed upstream, but no reply so far:
http://sam.zoy.org/monsterz/msg00092.html

Revision history for this message
agent 8131 (agent-8131) wrote :

I can confirm this bug under Ubuntu 8.10 on amd64 systems (I've tried 2).

Changed in monsterz:
status: New → Confirmed
Revision history for this message
Gina Häußge (foosel) wrote :

Same here, (X)Ubuntu 8.10 both on AMD64 as well as on a i386 system.

Revision history for this message
Arnaud Jeansen (ajeans) wrote :

I spent some time on it tonight (first time at reading python :().

It seems that at two points in the codebase, a pygame surface cannot be blit because the surface is still locked (there is an unlock() before the blit, but it seems to fail). Those two points are the copyright surface (this is the one that makes the game fail early), and the timeframe surface.

After some mindless trial and error, the problem appears to be related to the use of "enumerate" in for loops (it seems to keep some reference on the "alpha" 2D array which itself is linked to the surface). Because of the remaining link, the unlock() fails. I have a local change that replaces "enumerate" by "range" in some for loops, and it seems to correct the problem (I could start and play several games with pygame 1.8.1).

I will try to come up with a debdiff and maybe even a version in a PPA (Christmas vacation may make this more difficult).

Revision history for this message
Arnaud Jeansen (ajeans) wrote :

Patch generated using 'bzr diff'. I will be on vacation for the next few days, so I won't be able to generate a real debdiff or ask for an upload until January.

Anyone from MOTU to have a look at this ? Thanks.

Changed in monsterz:
status: Confirmed → In Progress
Revision history for this message
Arnaud Jeansen (ajeans) wrote :

As the package in Ubuntu is directly imported from Debian, I contacted the Debian maintainer (which also happens to be the main developer upstream) to point him to this bug and this patch.
It is still a non issue in Debian (the unstable pygame version is inferior to 1.8.1), so I hope he will be nice and roll an updated Debian package...

Revision history for this message
David Futcher (bobbo) wrote :

Fedora seems to have a patch to fix this. I'll look at applying it in the Ubuntu package.

Changed in monsterz:
assignee: nobody → bobbo
importance: Undecided → Low
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package monsterz - 0.7.1-2ubuntu1

---------------
monsterz (0.7.1-2ubuntu1) jaunty; urgency=low

  * debian/patches/020_fix_blit_crash.diff:
      - monsterz.py: Fix crash on startup in blit() function (LP: #275492)
      - Thanks to Arnaud Jeansen and Rafał Psota.

 -- David Futcher <email address hidden> Sun, 08 Feb 2009 20:31:18 +0000

Changed in monsterz:
status: In Progress → Fix Released
Revision history for this message
David Futcher (bobbo) wrote :

The Fedora patch is the same patch as attached to this bug. I have uploaded it (0.7.1-2ubuntu1), so should be in Jaunty by tomorrow. If someone can test this and post the results back here, I want to make sure the bug has been caught.

Revision history for this message
Arnaud Jeansen (ajeans) wrote : Re: [Bug 275492] Re: monsterz.py crashed with error in blit()

Hi David,

Thanks for the packaging, I was fearing the patch would sit in idle for a
long time.

I will try the jaunty package on my (still intrepid) setup. Will report
tonight.

Thanks,
Arnaud

On Sun, Feb 8, 2009 at 10:00 PM, David Futcher <email address hidden>wrote:

> The Fedora patch is the same patch as attached to this bug. I have
> uploaded it (0.7.1-2ubuntu1), so should be in Jaunty by tomorrow. If
> someone can test this and post the results back here, I want to make
> sure the bug has been caught.
>
> --
> monsterz.py crashed with error in blit()
> https://bugs.launchpad.net/bugs/275492
> You received this bug notification because you are a direct subscriber
> of the bug.
>

--
Arnaud Jeansen
<email address hidden>

Revision history for this message
Arnaud Jeansen (ajeans) wrote :

I installed manually the corrected package (jaunty) on my intrepid laptop. It unbreaks the game here (I had to play several games to confirm it :) ).

Thanks a lot for your work David.

Revision history for this message
jharrell (jon-harrell) wrote :

Running the latest 0.7.1-2ubuntu1 from the intrepid repositories and I am running into the lock error:

$ monsterz
Traceback (most recent call last):
  File "/usr/share/games/monsterz/monsterz.py", line 1998, in <module>
    main()
  File "/usr/share/games/monsterz/monsterz.py", line 1993, in main
    monsterz.go()
  File "/usr/share/games/monsterz/monsterz.py", line 1271, in go
    iterator()
  File "/usr/share/games/monsterz/monsterz.py", line 1381, in iterate_menu
    self.copyright_draw()
  File "/usr/share/games/monsterz/monsterz.py", line 1300, in copyright_draw
    system.blit(scroll, (13, 437))
  File "/usr/share/games/monsterz/monsterz.py", line 403, in blit
    self.background.blit(surf, coords)
pygame.error: Surfaces must not be locked during blit

Revision history for this message
Arnaud Jeansen (ajeans) wrote :

@Jon

The latest version 0.7.1-2ubuntu1 is not in the intrepid repositories (see https://launchpad.net/ubuntu/+source/monsterz), only in the upcoming jaunty version

To make it work, the work around is to manually install the jaunty version (it works fine, this is how I made it work at home).

To do so:
1) Go at this address: https://launchpad.net/ubuntu/jaunty/+source/monsterz/0.7.1-2ubuntu1
2) On the right hand side (Builds window), click on your architecture.
3) In the build page, on the right hand side (Resulting binaries window), click on "monsterz 0.7.1-2ubuntu1" to manually download the jaunty package
4) Install the package with gdebi (it should be asked on file download) and accept the installation (ignore the warning).

Good luck

Revision history for this message
jharrell (jon-harrell) wrote :

@Arnaud

Ok I ran through the manual install using the deb file found here http://launchpadlibrarian.net/22300806/monsterz_0.7.1-2ubuntu1_i386.deb - still get the same lock error.

and here is what fixed it:

First I removed the monsterz that was installed from the repo.
Then ran the gnome deb installer and everything is back to normal.

BEST game ever... maybe I'll take up python to add to it... Thanks.

Revision history for this message
Philipp Kern (pkern) wrote :

This is still unfixed in Intrepid and Jaunty because the patch only got included into the package, but not applied during building. The revision in Karmic (-3) fixes this issue and is reportedly installable on Intrepid.

Revision history for this message
Arnaud Jeansen (ajeans) wrote :

Hi Philippe,

The version in karmic comes from Debian, the patch was taken by them a few months ago, and we synced to debian again for karmic.

The version in Intrepid always had the problem, and has seen no updates, so it is still obviously there.

As to the version in Jaunty, I am somewhat surprised as I distinctly remember that updating to the new package fixed the issue with my system's version.

Are you 100% sure that the jaunty version is broken?

Revision history for this message
Alex Valavanis (valavanisalex) wrote :

Intrepid Ibex reached end-of-life on 30 April 2010 so I am closing the
report. The bug has been fixed in newer releases of Ubuntu.

Changed in monsterz (Ubuntu Intrepid):
status: New → Invalid
Revision history for this message
JC Hulce (soaringsky) wrote :

Thank you for taking the time to report this bug. This issue has been fixed in newer versions of Ubuntu, and Jaunty is EOL. Thus, I am closing this bugtask.

Changed in monsterz (Ubuntu Jaunty):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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