Bug#890941: flite1-dev: Example app from documentation crashes with SEGFAULT

Simon doublychargedhiggs at protonmail.com
Tue Feb 20 21:01:34 UTC 2018


Package: flite1-dev
Version: 2.0.0-release-3+b1
Severity: important

Dear Maintainer,
i'm trying to use libflite1 for a small project. For starters i tried the
example program given in the documentation 
(/usr/share/doc/flite/html/APIs.html):

#include <flite/flite.h>   /* This was "flite.h" in the orig. source */

register_cmu_us_kal();

int main(int argc, char **argv)
{
    cst_voice *v;
    if (argc != 2)
    {
        fprintf(stderr,"usage: flite_test FILE\n");
        exit(-1);
    }
    flite_init();
    v = register_cmu_us_kal(NULL);
    flite_file_to_speech(argv[1],v,"play");
}
 
Compiling this (with gcc Debian 6.3.0-18) produces warnings but no errors:

gcc -Iinclude/ -Wall -g   -c fl-example.c -o fl-example.o
fl-example.c:2:1: warning: data definition has no type or storage class
 register_cmu_us_kal();
 ^~~~~~~~~~~~~~~~~~~
fl-example.c:2:1: warning: type defaults to ‘int’ in declaration of ‘register_cmu_us_kal’ [-Wimplicit-int]
fl-example.c: In function ‘main’:
fl-example.c:13:7: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     v = register_cmu_us_kal(NULL);
       ^
gcc  fl-example.o -o fl-example -lflite_cmu_us_kal -lflite_usenglish -lflite_cmulex -lflite -lm

Running with any text file as argument however crashes:

(gdb) r foo.txt
Starting program: fl-example foo.txt
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff73a62d9 in flite_file_to_speech ()
   from /usr/lib/x86_64-linux-gnu/libflite.so.1
(gdb) where
#0  0x00007ffff73a62d9 in flite_file_to_speech ()
   from /usr/lib/x86_64-linux-gnu/libflite.so.1
#1  0x00005555555549bf in main (argc=2, argv=0x7fffffffeb18) at fl-example.c:14
(gdb) 


Other API functions like flite_voice_select(NULL) return NULL so seemingly
unable to find voices. However the commandline tool does:
flite -lv
Voices available: kal awb_time kal16 awb rms slt
And the commandline tool also plays text to audio or wav as expected.

Might this be a bug in the documentation or am i missing something?

Best regards,
simon



-- System Information:
Debian Release: 9.3
  APT prefers stable
  APT policy: (1001, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)

Versions of packages flite1-dev depends on:
ii  libc6-dev  2.24-11+deb9u1
ii  libflite1  2.0.0-release-3+b1

flite1-dev recommends no packages.

flite1-dev suggests no packages.

-- no debconf information


More information about the Pkg-a11y-devel mailing list