Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 70387 - media-libs/faad2: "faad --long-help" segfault
Summary: media-libs/faad2: "faad --long-help" segfault
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: Low minor (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard: Have BT, needs patching
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-07 15:43 UTC by Tom Noonan
Modified: 2006-01-15 09:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
faad2-2.0_long_opts.patch (faad2-2.0_long_opts.patch,533 bytes, patch)
2006-01-15 09:30 UTC, Thomas Cort (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Noonan 2004-11-07 15:43:35 UTC
faad2 --long-help option causes a segfault after the basic build / licence information is printed.  Recompiling does not help.  Seems to run fine otherwise.

Version faad2-2.0-r3

Reproducible: Always
Steps to Reproduce:
1.Execute faad --long-help
2.
3.

Actual Results:  
bash-2.05b$ faad --long-help
 *********** Ahead Software MPEG-4 AAC Decoder V2.0      ******************

 Build: Nov  7 2004
 Copyright 2002-2004: Ahead Software AG
 http://www.audiocoding.com
 Floating point version

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 You should have received a copy of the GNU General Public License
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

 **************************************************************************

Segmentation fault
Comment 1 Matt Taylor 2004-11-07 19:39:30 UTC
It segfaults with any invalid arg.  faad --help works, faad --fakelongarg crashes.  Also it doesn't crash on a default-linux/x86/gcc2 system.
Comment 2 foser (RETIRED) gentoo-dev 2004-11-09 06:54:46 UTC
probably some allocation issue
Comment 3 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-12-19 01:58:15 UTC
Taking over faad2 for sound herd.
Comment 4 Diego Elio Pettenò (RETIRED) gentoo-dev 2005-12-19 03:27:07 UTC
(gdb) bt
#0  0x00002f942d3c3690 in strncmp () from /lib/libc.so.6
#1  0x0000000000404add in _getopt_internal (argc=2, argv=0x79c25322e408, optstring=0x405ab3 "o:a:s:f:b:l:wgdhit",
    longopts=0x68, longind=0x79c25322e2f8, long_only=0) at getopt.c:468
#2  0x00000000004034b5 in main (argc=2, argv=0x79c25322e408) at main.c:1059
#3  0x00002f942d36f66c in __libc_start_main () from /lib/libc.so.6
#4  0x000000000040177a in _start ()

okay I have the trace, I'd like to mark this as UPSTREAM but upstream is dead...
I'll see in the next days if I can find a patch in their last cvs version, as their code is *really* messy.
Comment 5 Thomas Cort (RETIRED) gentoo-dev 2006-01-15 09:30:50 UTC
Created attachment 77175 [details, diff]
faad2-2.0_long_opts.patch

This patch fixes the segfault by added a NULL option at the end of long_options. From the getopt.3 manpage: "The last element of the [struct option] array has to be filled with zeroes."
Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2006-01-15 09:54:23 UTC
Thanks Thomas, patch applied in -r10.