Commit Graph
4889 Commits
Author SHA1 Message Date
Valdis Vitolins 6dce2117d5 Issue #1063: change length of s[ to 140ms 2022-03-31 22:56:35 +03:00
Valdis Vitolins 009f12107b Issue #1063: change pronunciation of ر from [[r]] to [[R]] 2022-03-31 22:54:53 +03:00
Valdis Vitolins db263a3233 Issue #1064: pronounce parenthesis in Arabic only used as special characters 2022-03-31 22:46:26 +03:00
Valdis Vitolins a6f0606efb Merge pull request #1138 2022-03-31 21:36:28 +03:00
Valdis Vitolins d4f0a97e9f Merge pull request #1142
Fix #1083 and improve some things in German
2022-03-31 21:28:56 +03:00
Valdis Vitolins 866fb512dd Merge pull request #1141 2022-03-31 21:16:35 +03:00
Valdis Vitolins 631dc1c1a9 Merge pull request #1140 2022-03-31 21:16:00 +03:00
Valdis Vitolins e896e01f28 Merge pull request #1139 2022-03-31 21:15:23 +03:00
Samuel Thibault ee0a468f95 soundicon: Avoid calling remove with uninitialized name
fname_temp is not always getting filled.
2022-03-28 01:03:31 +02:00
Samuel Thibault f23265419d tests: Check value returned by espeak-ng
Otherwise we would miss errors produced on shutdown.
2022-03-28 00:55:41 +02:00
Samuel Thibault 0f9a474ed4 Make msan warnings fatal
Otherwise they will go unnoticed.
2022-03-28 00:47:33 +02:00
Andiv06 0987aa6cfa Update Uzbek 2022-03-27 11:25:56 +03:00
Valdis Vitolins bec71b6d12 Merge pull request #1131 2022-03-26 19:28:16 +02:00
Samuel Thibault 127968a6f6 Add msan CI run
Now that all memory errors are fixed.

Ref #220
2022-03-25 22:39:33 +01:00
Valdis Vitolins eaa85563b8 Merge pull request #1136 2022-03-25 23:03:57 +02:00
Valdis Vitolins 2dc6de9cd1 Merge pull request #1126 2022-03-25 22:50:45 +02:00
Samuel Thibault fe63f1b3e7 MatchRule: Do not overflow the text
Some rules test against character not being of a certain type. That may
match with the \0 end-of-text marker, and thus actually step over
it and let MatchRule continue with uninitialized data after it, leading
to potential random behavior.

This commits fixes it by making sure that we don't read past that \0.

This seems to be changing the pronunciation of "capitals" from k'apIt@Lz to
k'apIt,alz, I don't know why, I guess the rule for it was actually
bogus?
2022-03-25 22:49:41 +02:00
Valdis Vitolins 22005d5c86 Test before pull request #1126: MatchRule: Do not overflow the text 2022-03-25 22:49:33 +02:00
Valdis Vitolins 5008cc9c30 Merge pull request #1137 2022-03-25 22:37:14 +02:00
Samuel Thibault 41fe49ea34 asan: Re-enable new_delete_type_mismatch
Now that it is fixed by

dab5457620 "Fix deleting FrameManagerImpl*"
261954b4bd "Fix deleting SpeechWaveGenerator"
2022-03-25 19:22:23 +01:00
Alexander Epaneshnikov 0931763144 enable all extra dictionaries by default
let's be honest, using espeak-ng without these dictionaries is simply
unbearable... at least for Russian. so let's all get a little bit happy.
2022-03-23 21:58:23 +03:00
Samuel Thibault e1c8adfcb5 Add tsan CI run
Now that all tsan errors are fixed.

Ref #220
2022-03-23 19:06:37 +01:00
Valdis Vitolins 51b7325307 Merge pull request #810 2022-03-23 19:44:44 +02:00
tset-tset-tset 927642102e Add some patterns to ja_rules 2022-03-23 19:42:32 +02:00
Valdis Vitolins 850b9c8742 Merge pull request #1134 2022-03-23 19:39:15 +02:00
Valdis Vitolins 5b67176356 Merge pull request #1130 2022-03-23 19:37:15 +02:00
Valdis Vitolins dc2af5f637 Merge pull request #1129 2022-03-23 19:37:01 +02:00
Andiv06 9180c109d5 Update Uyghur 2022-03-21 19:37:44 +02:00
Samuel Thibault 2d4fcfaf17 Add lsan CI run
Now that all lsan errors are fixed.

Ref #220
2022-03-20 21:57:19 +01:00
Samuel Thibault 55b2e9b2a3 MatchRule: Prevent non-eating special characters from eating characters
Special characters such as N, S1, etc. are not actually eating
characters. Their treatment should thus *not* update pre_ptr and post_ptr,
otherwise those would underflow/overflow, e.g. in the case

@) s (_NS1  [z]

this would overflow. This for instance noticeable with the memory sanitizer:

ESPEAK_DATA_PATH=$PWD ./src/espeak-ng -qX "capitals"
Translate 'capitals'
  1	c        [k]

  1	a        [a]

  1	p        [p]

  1	i        [I]

  1	t        [t]

  1	a        [a]

  1	l        [l]
 20	l (C     [l]

==2837201==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f7f4422744b in utf8_in2 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:281:2
    #1 0x7f7f442281bc in utf8_in /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:332:9
    #2 0x7f7f440e0d31 in MatchRule /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/dictionary.c:1767:21
    #3 0x7f7f440d937f in TranslateRules /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/dictionary.c:2320:6
    #4 0x7f7f44230e5f in TranslateWord3 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:733:15
    #5 0x7f7f44229844 in TranslateWord /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1100:14
    #6 0x7f7f44256e50 in TranslateWord2 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1361:11
    #7 0x7f7f4424d6cc in TranslateClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:2623:17
    #8 0x7f7f44213359 in SpeakNextClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/synthesize.c:1569:2
    #9 0x7f7f441a9f56 in Synthesize /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:457:2
    #10 0x7f7f441a9023 in sync_espeak_Synth /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:570:29
    #11 0x7f7f441ad59f in espeak_ng_Synthesize /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:678:10
    #12 0x7f7f4410b3f4 in espeak_Synth /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/espeak_api.c:90:32
    #13 0x4a8be3 in main /home/samy/brl/speech/espeak-ng-git/src/espeak-ng.c:691:3
    #14 0x7f7f43a2e7fc in __libc_start_main csu/../csu/libc-start.c:332:16
    #15 0x421449 in _start (/home/samy/ens/projet/1/speech/espeak-ng-git/src/.libs/espeak-ng+0x421449)

  Uninitialized value was created by an allocation of 'sbuf' in the stack frame of function 'TranslateClause'
    #0 0x7f7f4423a1f0 in TranslateClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1941

While trying to match _NS1, MatchRule is overflowing the buffer.

It happens that this had not usually posed problem because rules usually
have these non-eating special characters last in the rule and thus it wasn't
mattering that post_ptr is pointing outside valid text.
2022-03-20 21:51:05 +01:00
Samuel Thibault caf8e650c2 MatchRule: Support multibyte doubled letters
When matching a double-letter whose encoding needs multiple bytes, to
properly skip the double-letter we have to skip these bytes, like other
rules.
2022-03-20 21:50:43 +01:00
Valdis Vitolins a9f48fdb15 Update changed abbreviation for Mandarin 2022-03-20 22:37:52 +02:00
Valdis Vitolins b630a47a9c Merge pull request #1127 2022-03-20 22:33:16 +02:00
Valdis Vitolins b40f6e411f Update changelog 2022-03-20 22:32:52 +02:00
Valdis Vitolins 1e310d95a3 Merge pull request #1125 2022-03-20 22:21:15 +02:00
Valdis Vitolins 07ec8170d1 Merge pull request #1124 2022-03-20 22:20:53 +02:00
Valdis Vitolins 370b47846b Merge pull request #1123 2022-03-20 22:20:29 +02:00
Valdis Vitolins 4f9ec83598 Merge pull request #1122 2022-03-20 22:20:02 +02:00
Valdis Vitolins 3572290fbf Merge pull request #1121 2022-03-20 22:19:45 +02:00
Valdis Vitolins cfec1551a0 Merge pull request #1119 2022-03-20 22:19:03 +02:00
Valdis Vitolins 24a1cc76b7 Merge pull request #1118 2022-03-20 22:18:40 +02:00
Valdis Vitolins ab9f5bd015 Merge pull request #1115
Fix asan usan CI merge
2022-03-20 22:18:05 +02:00
Andiv06 c43f2b569c Update cantonese 2022-03-20 11:20:58 +02:00
Samuel Thibault 0f85657c7b MatchRule: Do not underflow the text
Some rules test against character not being of a certain type. That may
match with the \0 beginning-of-text marker, and thus actually step over
it and let MatchRule continue with uninitialized data before it, leading
to potential random behavior.

This commits fixes it by making sure that we don't read before that \0.
2022-03-20 02:56:37 +01:00
Samuel Thibault e87691ad3b Prevent LookupDict2 from overflowing wtab
LookupDict2 looks forward in the wtab array, it should still stop at its
end. Otherwise the memory sanitizer reports this:

testing en A. B C, D. E: F.
==65960==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7ff9d7ef0de8 in LookupDict2 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/dictionary.c:2676:11
    #1 0x7ff9d7eec2ec in LookupDictList /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/dictionary.c:2899:10
    #2 0x7ff9d802860a in TranslateWord3 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:588:12
    #3 0x7ff9d80249d4 in TranslateWord /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1100:14
    #4 0x7ff9d8051fe0 in TranslateWord2 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1361:11
    #5 0x7ff9d804885c in TranslateClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:2623:17
    #6 0x7ff9d800e4e9 in SpeakNextClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/synthesize.c:1569:2
    #7 0x7ff9d7fa50e6 in Synthesize /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:457:2
    #8 0x7ff9d7fa41b3 in sync_espeak_Synth /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:570:29
    #9 0x7ff9d7fa872f in espeak_ng_Synthesize /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:678:10
    #10 0x7ff9d7f06584 in espeak_Synth /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/espeak_api.c:90:32
    #11 0x4a8be3 in main /home/samy/brl/speech/espeak-ng-git/src/espeak-ng.c:691:3
    #12 0x7ff9d78297fc in __libc_start_main csu/../csu/libc-start.c:332:16
    #13 0x421449 in _start (/home/samy/ens/projet/1/speech/espeak-ng-git/src/.libs/espeak-ng+0x421449)

  Uninitialized value was created by an allocation of 'words' in the stack frame of function 'TranslateClause'
    #0 0x7ff9d8035380 in TranslateClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1941
2022-03-20 02:24:13 +01:00
Samuel Thibault c8de29dec9 Properly compare strings
Strictly speaking, we are not supposed to use memcmp to compare strings
since we are not supposed to read beyond \0, which memcmp is supposed to
potentially do. Sanitizers would warn about it, and using strncmp happens to
provide the proper semantic while being not really slower, so better
just use them.
2022-03-20 00:35:27 +01:00
Samuel Thibault 4aeb78e788 LoadVoice: Fix phonemes_name initialization
phonemes_name is only initialized when V_LANGUAGE is met. This is not
necessarily the case, notably with

testing espeak_SetVoiceByName("!v/Annie") (language variant; intonation)
Cannot set intonation: language not set, or is invalid.
Uninitialized bytes in __interceptor_strcmp at offset 0 inside [0x7fff8a875e30, 1)
==4169902==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x4c6a49 in LookupPhonemeTable /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/synthdata.c:363:7
    #1 0x4c6a49 in SelectPhonemeTableName /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/synthdata.c:380:12
    #2 0x5098a9 in LoadVoice /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/voices.c:950:34
    #3 0x50edcf in espeak_ng_SetVoiceByName /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/voices.c:1585:7
    #4 0x4aad63 in espeak_SetVoiceByName /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/espeak_api.c:125:32
    #5 0x4a3fe1 in test_espeak_set_voice_by_name_language_variant_intonation_parameter /home/samy/brl/speech/espeak-ng-git/tests/api.c:356:2
    #6 0x4a3fe1 in main /home/samy/brl/speech/espeak-ng-git/tests/api.c:567:2
    #7 0x7f26e88cb7fc in __libc_start_main csu/../csu/libc-start.c:332:16
    #8 0x4213a9 in _start (/home/samy/ens/projet/1/speech/espeak-ng-git/tests/api.test+0x4213a9)

  Uninitialized value was created by an allocation of 'phonemes_name' in the stack frame of function 'LoadVoice'
    #0 0x504290 in LoadVoice /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/voices.c:519

so better catch it properly rather than relying on uninitialized data.
2022-03-20 00:31:58 +01:00
Samuel Thibault b457d6f58e Fix uninitialized fields
The memory sanitizer would complain:

==4157154==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fc191d0a85b in TranslateWord3 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1065:7
    #1 0x7fc191d02916 in TranslateWord /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1100:14
    #2 0x7fc191d1b324 in TranslateWord2 /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:1448:15
    #3 0x7fc191d14ebc in TranslateClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/translate.c:2623:17
    #4 0x7fc191cfbc9b in SpeakNextClause /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/synthesize.c:1569:2
    #5 0x7fc191cd52fc in Synthesize /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:457:2
    #6 0x7fc191cd6d7c in sync_espeak_Synth /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:570:29
    #7 0x7fc191cd6d7c in espeak_ng_Synthesize /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/speech.c:678:10
    #8 0x7fc191ca0340 in espeak_Synth /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/espeak_api.c:90:32
    #9 0x4a4381 in main /home/samy/brl/speech/espeak-ng-git/src/espeak-ng.c:691:3
    #10 0x7fc19168b7fc in __libc_start_main csu/../csu/libc-start.c:332:16
    #11 0x421449 in _start (/home/samy/ens/projet/1/speech/espeak-ng-git/src/.libs/espeak-ng+0x421449)

  Uninitialized value was created by a heap allocation
    #0 0x45000d in malloc (/home/samy/ens/projet/1/speech/espeak-ng-git/src/.libs/espeak-ng+0x45000d)
    #1 0x7fc191d1ca29 in NewTranslator /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/tr_languages.c:242:26
    #2 0x7fc191d1ca29 in SelectTranslator /home/samy/brl/speech/espeak-ng-git/src/libespeak-ng/tr_languages.c:482:7

(and similar for expect_verb_sn expect_noun, expect_past,
clause_upper_count, clause_lower_count)

Indeed TranslateWord3 doesn't always initialize these fields. Better
just initialize them directly from the Translator creation.
2022-03-20 00:27:44 +01:00
Samuel Thibault 9cee174426 sPlayer: fix accessing bw
The bw array is 0-based, not 1-based.
2022-03-19 10:55:06 +01:00
Samuel Thibault 261954b4bd Fix deleting SpeechWaveGenerator
Similarly to dab5457620 "Fix deleting FrameManagerImpl*", we need a
virtual destructor. clang was complaining about it:

src/speechPlayer/src/speechPlayer.cpp:52:2: warning: delete called on 'SpeechWaveGenerator' that is abstract but has non-virtual destructor [-Wdelete-abstract-non-virtual-dtor]
        delete playerHandleInfo->waveGenerator;
        ^
2022-03-19 10:50:28 +01:00