Bug 269583 - audio/festival: Segmentation fault
Summary: audio/festival: Segmentation fault
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: crash
Depends on:
Blocks:
 
Reported: 2023-02-16 13:58 UTC by Konstantin
Modified: 2023-02-28 16:27 UTC (History)
3 users (show)

See Also:
lwhsu: maintainer-feedback? (freebsd-2024)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Konstantin 2023-02-16 13:58:04 UTC
festival is not working

FreeBSD freessd 13.1-RELEASE-p3 FreeBSD 13.1-RELEASE-p3 GENERIC amd64

festival> (SayText "Hello")          
Segmentation fault

# echo 'Hello' | festival --tts
Segmentation fault
Comment 1 Li-Wen Hsu freebsd_committer freebsd_triage 2023-02-16 14:35:54 UTC
It would be nice it you can provide the backtrace or core dump files to help debug.
Comment 2 Graham Perrin freebsd_committer freebsd_triage 2023-02-18 11:02:46 UTC
(In reply to Li-Wen Hsu from comment #1)

Does this help? 

Core was generated by `festival.naked --libdir /usr/local/share/festival/lib'.
Program terminated with signal SIGSEGV, Segmentation fault.
Address not mapped to object.
#0  0x00000000003da271 in ?? ()
(gdb) bt
#0  0x00000000003da271 in ?? ()
#1  0x0000000820f72e70 in ?? ()
#2  0x0000000000468071 in ?? ()
#3  0x18ce0b98985c37b6 in ?? ()
#4  0x000000082bdcd9f0 in ?? ()
#5  0x0000000820f72e70 in ?? ()
#6  0x000000000046ad69 in ?? ()
#7  0x0000000820f72ed0 in ?? ()
#8  0x00000000004033d3 in ?? ()
#9  0x000000082bdcdc40 in ?? ()
#10 0x000000082bdcdc60 in ?? ()
#11 0x18ce0b98985c37b6 in ?? ()
#12 0x000000082bdcb2f0 in ?? ()
#13 0x000000082bdcb2c0 in ?? ()
#14 0x0000000820f72f58 in ?? ()
#15 0x0000000820f72ed0 in ?? ()
#16 0x00000000003e7549 in ?? ()
#17 0x0000000820f72f58 in ?? ()
#18 0x000000082e87d840 in ?? ()
#19 0x0000000820f72f30 in ?? ()
#20 0x000000000031faf2 in ?? ()
#21 0x0000000820f73088 in ?? ()
#22 0x0000000820f72ff0 in ?? ()
#23 0x0000000820f72fb8 in ?? ()
#24 0x0000000820f72f88 in ?? ()
#25 0x0000000820f72f30 in ?? ()
#26 0x00000000003b35ac in ?? ()
#27 0x18ce0b98985c37b6 in ?? ()
#28 0x0000000820f72f58 in ?? ()
#29 0x000000082e87d840 in ?? ()
#30 0x000000082bdcd9e0 in ?? ()
#31 0x0000000820f73210 in ?? ()
#32 0x00000000003200cc in ?? ()
#33 0x00000bba69ea0ae0 in ?? ()
#34 0x0000000000000000 in ?? ()
(gdb) q
% uname -aKU
FreeBSD mowa219-gjp4-8570p-freebsd 14.0-CURRENT FreeBSD 14.0-CURRENT #32 main-n260999-9e0d41c8f063: Fri Feb 17 21:25:16 GMT 2023     grahamperrin@mowa219-gjp4-8570p-freebsd:/usr/obj/usr/src/amd64.amd64/sys/GENERIC-NODEBUG amd64 1400080 1400080
% 

(I imagine not.)

Steps to the crash (based on <http://www.festvox.org/docs/manual-2.4.0/festival_7.html#Sample-command-driven-session>): 

% festival

Festival Speech Synthesis System 2.4:release December 2014
Copyright (C) University of Edinburgh, 1996-2010. All rights reserved.

clunits: Copyright (C) University of Edinburgh and CMU 1997-2010
clustergen_engine: Copyright (C) Carnegie Mellon University 2005-2014
hts_engine: 
The HMM-Based Speech Synthesis Engine "hts_engine API"
hts_engine API version 1.07 (http://hts-engine.sourceforge.net/)
Copyright (C) The HMM-Based Speech Synthesis Engine "hts_engine API"
Version 1.07 (http://hts-engine.sourceforge.net/)
Copyright (C) 2001-2012 Nagoya Institute of Technology
              2001-2008 Tokyo Institute of Technology
All rights reserved.

All rights reserved.
For details type `(festival_warranty)'
festival> (set! utt1 (Utterance Text "Hello world"))
#<Utterance 0x82e87d840>
festival> (utt.synth utt1)
Segmentation fault (core dumped)
Comment 3 Mikhail T. 2023-02-21 02:09:21 UTC
Which voices do you have installed/configured?
Comment 4 Konstantin 2023-02-21 04:22:51 UTC
With any voices the same - Segmentation fault

festival> (voice.list)
(msu_ru_nsh_clunits ked_diphone cmu_us_clb_arctic_clunits)

festival> default-voice-priority-list
(kal_diphone
 cmu_us_slt_cg
 cmu_us_rms_cg
 cmu_us_bdl_cg
 cmu_us_jmk_cg
 cmu_us_awb_cg
 ked_diphone
 don_diphone
 rab_diphone
 en1_mbrola
 us1_mbrola
 us2_mbrola
 us3_mbrola
 gsw_diphone
 el_diphone
 msu_ru_nsh_clunits)
Comment 5 Konstantin 2023-02-21 05:23:25 UTC
festival> voice_default
voice_ked_diphone

echo 'hello world' | festival --language americanenglish -b --tts
Segmentation fault
Comment 6 Mikhail T. 2023-02-21 07:09:35 UTC
Ok, I think, I know, what's going on :( Adding -fno-delete-null-pointer-checks to CXXFLAGS should solve the problem.

Could you, please, confirm, that it does?
Comment 7 commit-hook freebsd_committer freebsd_triage 2023-02-21 07:26:24 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=39e57d44aa5af331426f14f1a54c07d6912a7b91

commit 39e57d44aa5af331426f14f1a54c07d6912a7b91
Author:     Mikhail Teterin <mi@FreeBSD.org>
AuthorDate: 2023-02-21 07:23:22 +0000
Commit:     Mikhail Teterin <mi@FreeBSD.org>
CommitDate: 2023-02-21 07:23:22 +0000

    audio/festival: fix crash due to overly aggressive optimization

    Modern clang, optimize away checks like "if (this == NULL)", which
    are, indeed, redundant in good C++ code. Unfortunately, festival's
    code is not too good, and the checks are essential...

    PR:     269583

    While here, eliminate some of the other warnings raised by both
    compiler and valgrind, and adapt one more patch from Debian.

    Bump PORTREVISION.

 audio/festival/Makefile                            |   8 +-
 .../files/patch-hts-buffer-bounds-check (new)      | 313 +++++++++++++++++++++
 audio/festival/files/patch-warnings (new)          |  76 +++++
 3 files changed, 393 insertions(+), 4 deletions(-)
Comment 8 Konstantin 2023-02-22 07:17:37 UTC
It looks like it worked, I'll check for sure later, thanks.
Comment 9 Konstantin 2023-02-28 16:26:28 UTC
Everything works well with my asterisk, thanks a lot.