[Flac-dev] test_metaflac fails in make check for flac 1.1.2 after
--add-padding is performed
Tom Goetze
tgoetze at yahoo.com
Wed Aug 30 00:00:56 PDT 2006
Josh Coalson <xflac at yahoo.com> wrote: --- Tom Goetze wrote:
> doing "make check" on flac-1.1.2, I get a segmentation fault
>
> ././test_metaflac.sh: line 51: 17370 Segmentation fault flac
> $*
>
> My linux distribution is a linuxfromscratch 6.1.1
> I built flac using blfs 6.1 directions:
> gcc version 3.4.3
hmm, two things would help. first change the first line of
test_metaflac.sh to
#!/bin/sh -x
when you run the script you will see the exact invocation of flac
before the crash. if you send be the FLAC file, that might help.
also, if you can run the same command in gdb and get a backtrace
that would be another clue.
Josh
Seems like fwrite doesn't like to write to null. However, it seems clear from the code that using --test intentionally creates no outputfile for fwrite.
src/flac/main.c: 1730 retval = flac__decode_wav(infilename, option_values.test_only? 0 : outfilename, option_values.analyze, option_values.aopts, options);
Details below:
(gdb) run
Starting program: /home/tom/sources/flac-1.1.2/src/flac/.libs/lt-flac --silent --test metaflac.flac
Breakpoint 1, DecoderSession_process (d=0xbffff530) at decode.c:500
500 if(flac__utils_fwrite("\000", 1, 1, d->fout) != 1) {
(gdb) print d
$1 = (DecoderSession *) 0xbffff530
(gdb) print d->fout
$2 = (FILE *) 0x0
(gdb) n
Program received signal SIGSEGV, Segmentation fault.
0xb7ea7044 in fwrite () from /lib/libc.so.6
(gdb) bt
#0 0xb7ea7044 in fwrite () from /lib/libc.so.6
#1 0x0804ef09 in DecoderSession_process (d=0xbffff530) at decode.c:500
#2 0x08051275 in flac__decode_wav (infilename=0x8341978 "metaflac.flac", outfilename=0x0, analysis_mode=0, aopts=
{do_residual_text = 0, do_residual_gnuplot = 1}, options=
{common = {continue_through_decode_errors = 0, replaygain_synthesis_spec = {apply = 0, use_album_gain = 1, limiter = RGSS_LIMIT__HARD, noise_shaping = NOISE_SHAPING_LOW, preamp = 0}, is_ogg = 0, use_first_serial_number = 1, serial_number = 0, skip_specification = {is_relative = 0, value_is_samples = 1, value = {seconds = 0, samples = 0}}, until_specification = {is_relative = 0, value_is_samples = 1, value = {seconds = 0, samples = 0}}, has_cue_specification = 0, cue_specification = {has_start_point = -1207954168, has_end_point = 0, start_track = 3086395392, start_index = 40, end_track = 3086395392, end_index = 3086396416}}}) at decode.c:203
#3 0x0805a507 in decode_file (infilename=0x8341978 "metaflac.flac") at main.c:1730
#4 0x0805c241 in do_it () at main.c:486
#5 0x0805ca7b in main (argc=4, argv=0xbffffa34) at main.c:284
And output of adding -x:
options: -P 4096 -b 1152 -l 0 -q 0 -r 2,2 -V
sh: Verify OK, wrote 554232 bytes, ratio=0.967
+ chmod +w metaflac.flac
+ check_flac
+ run_flac --silent --test metaflac.flac
+ '[' xno = xyes ']'
+ flac --silent --test metaflac.flac
././test_metaflac.sh: line 51: 7636 Segmentation fault flac $*
+ die 'ERROR in metaflac.flac'
+ echo ERROR in metaflac.flac
ERROR in metaflac.flac
+ exit 1
FAIL: ./test_metaflac.sh
Would it change functionality to add another condition about non-null outputfile to the flac__decode_wav routine on decode.c:500?
Tom
---------------------------------
Want to be your own boss? Learn how on Yahoo! Small Business.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xiph.org/pipermail/flac-dev/attachments/20060830/7707efee/attachment.htm
More information about the Flac-dev
mailing list