After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 498237 - nsfdec crash with SK8ORDIE.
nsfdec crash with SK8ORDIE.
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.5
Other All
: High critical
: 0.10.7
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-11-19 17:07 UTC by Andreas Henriksson
Modified: 2008-03-25 15:55 UTC
See Also:
GNOME target: ---
GNOME version: 2.19/2.20


Attachments
Update files from nosefart-2.7-mls, add memguard.* and update Makefile.am. (310.32 KB, patch)
2008-03-24 16:25 UTC, Andreas Henriksson
committed Details | Review

Description Andreas Henriksson 2007-11-19 17:07:57 UTC
Version: 2.20.0

What were you doing when the application crashed?
Testing out the new playback support for Nes Sound Format, playing the NSF available at http://www.atarihq.com/tsr/nsf/sk8die2.zip


Distribution: Debian lenny/sid
Gnome Release: 2.20.1 2007-10-26 (Debian)
BugBuddy Version: 2.20.1

System: Linux 2.6.22-2-amd64 #1 SMP Thu Aug 30 23:43:59 UTC 2007 x86_64
X Vendor: The X.Org Foundation
X Vendor Release: 10400000
Selinux: No
Accessibility: Disabled
GTK+ Theme: Gorilla
Icon Theme: Gorilla

Memory status: size: 391299072 vsize: 391299072 resident: 35446784 share: 14872576 rss: 35446784 rss_rlim: 18446744073709551615
CPU usage: start_time: 1195492085 rtime: 87 utime: 80 stime: 7 cutime:0 cstime: 0 timeout: 0 it_real_value: 0 frequency: 100

Backtrace was generated from '/usr/bin/totem'

(no debugging symbols found)
Using host libthread_db library "/lib/libthread_db.so.1".
(no debugging symbols found)
[Thread debugging using libthread_db enabled]
[New Thread 0x2afa8322c480 (LWP 25675)]
[New Thread 0x44007950 (LWP 25685)]
[New Thread 0x43806950 (LWP 25684)]
[New Thread 0x43005950 (LWP 25683)]
[New Thread 0x42804950 (LWP 25682)]
[New Thread 0x42003950 (LWP 25681)]
[New Thread 0x41802950 (LWP 25680)]
[New Thread 0x41001950 (LWP 25679)]
[New Thread 0x40800950 (LWP 25677)]
0x00002afa80869d46 in poll () from /lib/libc.so.6

Thread 3 (Thread 0x43806950 (LWP 25684))

  • #0 waitpid
    from /lib/libpthread.so.0
  • #1 IA__g_spawn_sync
    at /build/buildd/glib2.0-2.14.3/glib/gspawn.c line 369
  • #2 IA__g_spawn_command_line_sync
    at /build/buildd/glib2.0-2.14.3/glib/gspawn.c line 677
  • #3 ??
    from /usr/lib/gtk-2.0/modules/libgnomebreakpad.so
  • #4 <signal handler called>
  • #5 ??
    from /usr/lib/gstreamer-0.10/libgstnsf.so
  • #6 ??
    from /usr/lib/gstreamer-0.10/libgstnsf.so
  • #7 gst_task_func
    at gsttask.c line 192
  • #8 g_thread_pool_thread_proxy
    at /build/buildd/glib2.0-2.14.3/glib/gthreadpool.c line 265
  • #9 g_thread_create_proxy
    at /build/buildd/glib2.0-2.14.3/glib/gthread.c line 635
  • #10 start_thread
    from /lib/libpthread.so.0
  • #11 clone
    from /lib/libc.so.6
  • #12 ??


----------- .xsession-errors (1981 sec old) ---------------------
(evolution:15766): gtkhtml-WARNING **: invalid character value: xdcbbd
(evolution:15766): gtkhtml-WARNING **: invalid character value: x1e3ebbd
(evolution:15766): gtkhtml-WARNING **: invalid character value: xd862d
(evolution:15766): gtkhtml-WARNING **: invalid character value: x1b78a3d
VLC media player 0.8.6c Janus
** (.:22994): CRITICAL **: gtk_pizza_set_size: assertion `pizza != NULL' failed
[00000287] main playlist: stopping playback
VLC media player 0.8.6c Janus
** (.:25328): CRITICAL **: gtk_pizza_set_size: assertion `pizza != NULL' failed
[00000287] main playlist: stopping playback
--------------------------------------------------
Comment 1 Andreas Henriksson 2007-11-19 17:21:37 UTC
Problem not reproduced without using Totem, so reassigning to gstreamer ("plugins bad" probably means I shouldn't expect much from the plugins, but reporting the problems might be useful anyway).

$ gst-launch-0.10 playbin uri=file:///tmp/SK8DIE2.NSF 
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstAudioSinkClock
Caught SIGSEGV accessing address 0x915
  • #0 poll
    from /lib/libc.so.6
  • #1 g_main_context_iterate
  • #2 IA__g_main_loop_run
  • #3 gst_bus_poll
  • #4 event_loop
  • #5 main
  • #6 __libc_start_main
    from /lib/libc.so.6
  • #7 _start

Comment 2 Andreas Henriksson 2007-12-31 00:27:01 UTC
Here's a probably more helpful backtrace:


Program received signal SIGSEGV, Segmentation fault.
0x00002aec1ecda0d6 in nes6502_execute (remaining_cycles=28188)
    at nes6502.c:1404
1404	    switch (opcode) {
(gdb) bt
  • #0 nes6502_execute
    at nes6502.c line 1404
  • #1 play_loop
    at gstnsf.c line 303
  • #2 gst_task_func
    at gsttask.c line 192
  • #3 g_thread_pool_thread_proxy
    at /build/buildd/glib2.0-2.14.4/glib/gthreadpool.c line 265
  • #4 g_thread_create_proxy
    at /build/buildd/glib2.0-2.14.4/glib/gthread.c line 635
  • #5 start_thread
    from /lib/libpthread.so.0
  • #6 clone
    from /lib/libc.so.6
  • #7 ??
$6 = 6422


I noted that PC is always 6422 and remaining_cycles always 28188 when it crashes...
I also guess the segfault shows up first on the switch because of the optimization. I guess the real problem is line 1401:

    opcode = bank_readbyte (PC++);




I though maybe this was a 64bit problem in the original (old?) code, but I've compiled http://belnet.dl.sourceforge.net/sourceforge/nosefart/nosefart-2.6-mls.tar.bz2  (which I guess is the original code for nsfdec) which plays the file without problem on my system.


Comment 3 Johan (not receiving bugmail) Dahlin 2007-12-31 01:58:06 UTC
Andreas, Thanks for the detailed analysis!

gst-plugins-bad (which provides the gstreamer plugin nsfdec) currently ships with an included copy of nosefart. Perhaps that version is out of date and needs to be updated to be able to play skate or die.

I currently don't have too much time to do this myself, but perhaps you could give it a go? If you do so, remember that there are some (minor) modifications done to the gstreamer copy of nosefart, they need to be forward ported to the new copy.
Comment 4 Andreas Henriksson 2007-12-31 02:13:33 UTC
I just tried copying nes6502.{c,h} from the downloaded version of nosefart, and adding #define NES6502_MEM_ACCESS_CTRL 1 to the top of both these files (as that is defined on the command line when you build nosefart) - replacing the files in gstreamer0.10-plugins-bad in Debians package. It actually built, but it crashed with something which looks totally different but seems to be the equivalent place for the new code....
I guess trying random things won't solve this. I think the next step would be to actually try to understand the code and I don't think I have enough motivation to dig that deep.... Sorry. :(
Maybe one day I'll get bored enough to have a look again...
Comment 5 Johan (not receiving bugmail) Dahlin 2007-12-31 03:08:57 UTC
You would need to copy over quite a few more files, all .c and .h files minus the gstnsf.[ch] pair needs to be updated.
Comment 6 Andreas Henriksson 2008-03-24 16:19:26 UTC
The "boring enough" day is apparently today!

Updating all *.c and *.h files from nosefart-2.7-mls, plus adding the new memguard.{c,h} does indeed solve the problem.

Comment 7 Andreas Henriksson 2008-03-24 16:25:46 UTC
Created attachment 107928 [details] [review]
Update files from nosefart-2.7-mls, add memguard.* and update Makefile.am.

This patch is against gstreamer0.10-plugins-bad 0.10.6 (debian sid package).
I've done the following:

Download and extract nosefart-2.7-mls.tar.bz2 as /tmp/nosefart-2.7-mls/
Get g-plugins-bad source and cd gst/nsf/

for a in *.c *.h memguard.c memguard.h
do
cp $(find /tmp/nosefart-2.7-mls/ -name $a) .
done

Edit Makefile.am and add memguard.c and memguard.h in the lists of nosefart source files.

cd ../.. ; automake

Rebuilding gstreamer plugins bad from this updated source can play the sk8ordie.nsf file without problem.
Comment 8 Sebastian Dröge (slomo) 2008-03-25 15:55:53 UTC
2008-03-25  Sebastian Dröge  <slomo@circular-chaos.org>

	Patch by: Andreas Henriksson <andreas at fatal dot set>

	* gst/nsf/Makefile.am:
	* gst/nsf/dis6502.h:
	* gst/nsf/fds_snd.c:
	* gst/nsf/fds_snd.h:
	* gst/nsf/fmopl.c:
	* gst/nsf/fmopl.h:
	* gst/nsf/gstnsf.c:
	* gst/nsf/log.c:
	* gst/nsf/log.h:
	* gst/nsf/memguard.c:
	* gst/nsf/memguard.h:
	* gst/nsf/mmc5_snd.c:
	* gst/nsf/mmc5_snd.h:
	* gst/nsf/nes6502.c:
	* gst/nsf/nes6502.h:
	* gst/nsf/nes_apu.c:
	* gst/nsf/nes_apu.h:
	* gst/nsf/nsf.c:
	* gst/nsf/nsf.h:
	* gst/nsf/osd.h:
	* gst/nsf/types.h:
	* gst/nsf/vrc7_snd.c:
	* gst/nsf/vrc7_snd.h:
	* gst/nsf/vrcvisnd.c:
	* gst/nsf/vrcvisnd.h:
	Update our internal nosefart to nosefart-2.7-mls to fix segfaults
	on some files. Fixes bug #498237.

	Remove some // comments, fix some compiler warnings and use pow()
	instead of a slow, selfmade implementation.