Date: Sat, 12 Sep 2009 17:08:15 GMT From: Kuan-Chung Chiu <buganini@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/138765: [patch] multimedia/audacious segfault with timidity Message-ID: <200909121708.n8CH8F6A020530@www.freebsd.org> Resent-Message-ID: <200909121710.n8CHA6rB020164@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 138765 >Category: ports >Synopsis: [patch] multimedia/audacious segfault with timidity >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Sep 12 17:10:06 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Kuan-Chung Chiu >Release: 9.0-CURRENT >Organization: N/A >Environment: FreeBSD Zeta.twbbs.org 9.0-CURRENT FreeBSD 9.0-CURRENT #0: Sun Sep 6 02:18:48 CST 2009 root@Zeta.twbbs.org:/usr/obj/usr/src/sys/ZETA i386 >Description: Zeta# gdb /usr/local/bin/audacious2 GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd"...(no debugging symbols found)... (gdb) run Starting program: /usr/local/bin/audacious2 [New LWP 100130] [New Thread 49c01140 (LWP 100130)] [New Thread 49cdb280 (LWP 100216)] [New Thread 49cda740 (LWP 100226)] Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 49c01140 (LWP 100130)] 0x4826bda1 in has_case_prefix (haystack=0x0, needle=0x482bc033 "file:/") at gconvert.c:1446 1446 while (*n && *h && (gdb) bt #0 0x4826bda1 in has_case_prefix (haystack=0x0, needle=0x482bc033 "file:/") at gconvert.c:1446 #1 0x4826c934 in IA__g_filename_from_uri (uri=0x0, hostname=0x0, error=0x0) at gconvert.c:1742 #2 0x48125875 in vfs_file_test (path=0x0, test=G_FILE_TEST_EXISTS) at vfs.c:362 #3 0x4d699f24 in open_file (name=0xbfbfe693 "goemon.cfg") at libtimidity/common.c:57 #4 0x4d6a4cca in read_config_file (name=0xbfbfe693 "goemon.cfg") at libtimidity/timidity.c:89 #5 0x4d6a501a in read_config_file (name=0x4a366970 "/usr/local/lib/timidity/timidity.cfg") at libtimidity/timidity.c:219 #6 0x4d6a5a77 in mid_init (config_file=0x4a366970 "/usr/local/lib/timidity/timidity.cfg") at libtimidity/timidity.c:431 #7 0x4d698e21 in xmmstimid_init () at xmms-timidity.c:104 #8 0x08063744 in plugin_system_init () #9 0x0805ac85 in main () (gdb) >How-To-Repeat: make -C /usr/ports/multimedia/audacious-plugins/ config; check TIMIDITY sudo make install cd ~ audacious2 >Fix: In common.c, open_file first try to open file directly and return if success, then search in searching paths. During the direct opening, g_filename_to_uri return 0x0 when file doesnt exist (in pwd), then the NULL path leads to crash. Adding sanity check before calling vfs_file_test solve problem. I added a patch file into files/ to solve the problem. Patch attached with submission follows: diff -ruN audacious-plugins.orig/files/patch-src-timidity-common.c audacious-plugins/files/patch-src-timidity-common.c --- audacious-plugins.orig/files/patch-src-timidity-common.c 1970-01-01 08:00:00.000000000 +0800 +++ audacious-plugins/files/patch-src-timidity-common.c 2009-09-13 01:02:51.480171971 +0800 @@ -0,0 +1,11 @@ +--- src/timidity/libtimidity/common.c.orig 2009-09-13 00:44:39.716129871 +0800 ++++ src/timidity/libtimidity/common.c 2009-09-13 00:46:40.841815329 +0800 +@@ -54,7 +54,7 @@ + DEBUG_MSG("Trying to open %s\n", name); + fp = NULL; + uri = g_filename_to_uri(name, NULL, NULL); +- if (aud_vfs_file_test(uri, G_FILE_TEST_EXISTS)) { ++ if (uri && aud_vfs_file_test(uri, G_FILE_TEST_EXISTS)) { + fp = aud_vfs_fopen(uri, OPEN_MODE); + } + g_free(uri); >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200909121708.n8CH8F6A020530>