From owner-freebsd-multimedia@FreeBSD.ORG Fri Jul 13 03:00:18 2007 Return-Path: X-Original-To: freebsd-multimedia@hub.freebsd.org Delivered-To: freebsd-multimedia@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 6A4E116A400 for ; Fri, 13 Jul 2007 03:00:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id 422B313C461 for ; Fri, 13 Jul 2007 03:00:18 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l6D30IfX060393 for ; Fri, 13 Jul 2007 03:00:18 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l6D30IbC060392; Fri, 13 Jul 2007 03:00:18 GMT (envelope-from gnats) Date: Fri, 13 Jul 2007 03:00:18 GMT Message-Id: <200707130300.l6D30IbC060392@freefall.freebsd.org> To: freebsd-multimedia@FreeBSD.org From: Gary Palmer Cc: Subject: Re: ports/113922: multimedia/ffmpeg segfaults on start X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Gary Palmer List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2007 03:00:18 -0000 The following reply was made to PR ports/113922; it has been noted by GNATS. From: Gary Palmer To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/113922: multimedia/ffmpeg segfaults on start Date: Fri, 13 Jul 2007 03:40:02 +0100 I also experienced the crash. I tracked it down to ffmpeg source code. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x8480000 (LWP 100306)] 0x48852af7 in __vfprintf () from /lib/libc.so.6 (gdb) bt #0 0x48852af7 in __vfprintf () from /lib/libc.so.6 #1 0x488536f1 in vfprintf () from /lib/libc.so.6 #2 0x0805fd7d in log_callback_help (ptr=0x0, level=1, fmt=0x837b39c "T²7\b", vl=0x82c4b7e "\203Ä\030[Ã\220S\203ì\b\215D$\034Pÿt$\034ÿt$\034è") at ffmpeg.c:3735 #3 0x082c4b7e in av_vlog (avcl=0x848e010, level=137788800, fmt=0x837b39c "T²7\b", vl=0x82c4baa "\203Ä\030[Ã\220è") at log.c:65 #4 0x082c4baa in av_log (avcl=0x848e010, level=0, fmt=0x837b39c "T²7\b") at log.c:58 #5 0x081a9c13 in av_opt_show (obj=0x8477130, av_log_obj=0x0) at opt.c:335 #6 0x0805fe93 in show_help () at ffmpeg.c:3771 #7 0x08060d03 in main (argc=1, argv=0xbfbfe808) at ffmpeg.c:3798 Notice the fmt parameters are garbage from 4 upwards #6 0x0805fe93 in show_help () at ffmpeg.c:3771 3771 av_opt_show(sws_opts, NULL); Looking through the code, sws_opts is populated at ffmpeg.c in main() at line 3794 with a call to sws_getContext The real fun is that the ffmpeg code has TWO definitions for sws_getContext when you have --enable-swscaler passed to configure (which is the default for the port). One is defined in libavcodec/imgresample.c and the other in libswscale/swscale.c At least on my system, the linker defaulted to the version in libavcodec which leads to the SIGSEGV. Putting "#if 0" around the definitions for sws_getContext, sws_freeContext and sws_scale in libavcodec/imgresample.c appears to stop the SIGSEGV for me. Alternatively, deleting the files/patch-libavcodec_Makefile patch file appears to also stop the coredump. I do not have enough experience with this port to know if either option has bad side effects