Subject: pkg/28924: game/exult pthread assertion failure on NetBSD -current
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <njoly@pasteur.fr>
List: pkgsrc-bugs
Date: 01/09/2005 21:51:00
>Number:         28924
>Category:       pkg
>Synopsis:       game/exult pthread assertion failure on NetBSD -current
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 09 21:51:00 +0000 2005
>Originator:     Nicolas Joly
>Release:        NetBSD 2.99.12
>Organization:
Institut Pasteur, Paris.
>Environment:
System: NetBSD cixy.dial.pasteur.fr 2.99.12 NetBSD 2.99.12 (CIXY) #6: Thu Jan 6 22:19:55 CET 2005 njoly@cixy.dial.pasteur.fr:/local/src/NetBSD/obj/i386/sys/arch/i386/compile/CIXY i386
Architecture: i386
Machine: i386
>Description:
While running exult on -current NetBSD/i386 (or NetBSD/amd64), i'm seeing many
pthread assertions failures :

njoly@cixy [~/Ultima7Vf]> exult 
Exult version 1.2
Built at: Jan  9 2005 15:21:09
Compile-time options: USE_EXULTSTUDIO, HAVE_ZIP_SUPPORT
Compiler: gcc, version: 3.3.3 (NetBSD nb3 20040520)

Platform: Unknown
Exult path settings:
Data          : /usr/pkg/share/exult
Digital music : /usr/pkg/share/exult/music

Music player: Internal cheapass forked midi player
Black Gate   : found
exult_bg.flx : found
Serpent Isle : not found (static/sispeech.spc)
exult_si.flx : found
Starting forked player failed
assertion "unreachable" failed: file "/local/src/NetBSD/src/lib/libpthread/pthread.c", line 523, function "pthread__idle"
[...]

Then, the system becomes unresponsive until the `exult.core' file is
generated (about 770MB).

I tracked down this problem, and noticed that exult program depend on a
missing `playmidi' command to play MIDI files :
http://sourceforge.net/projects/playmidi/
But i failed to make it work on NetBSD.

As a workaround for NetBSD, i patched `audio/midi_drivers/forked_player.cc'
to use native command `midiplay' instead.

For the pthread assertion failure, i can't figure if the problem comes from
exult code, or if our pthread library is faulty ... I'm not familiar enough
with pthreads.

>How-To-Repeat:
>Fix:
--- audio/midi_drivers/forked_player.cc.ori	2005-01-09 22:08:41.000000000 +0100
+++ audio/midi_drivers/forked_player.cc	2005-01-09 22:09:26.000000000 +0100
@@ -41,7 +41,11 @@
 // NB: This function doesn't return unless execlp fails!
 static  void    playFJmidifile(const char *name)
 {
+#ifdef __NetBSD__
+	execlp("midiplay","-v","-v",name,0);
+#else
 	execlp("playmidi","-v","-v","-e",name,0);
+#endif
 }
 
 forked_player::forked_player() : forked_job(-1)