<div dir="ltr">I love it when I send a question to an e-mail list then find the answer myself. My bad, the NSSpeechSynthesizer documentation at apple was wrong. Filing a bug now.<div><br></div><div>BR,</div><div>Jeremy</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 2, 2015 at 7:16 PM, Jeremy Whiting <span dir="ltr"><<a href="mailto:jpwhiting@kde.org" target="_blank">jpwhiting@kde.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>Inside QtSpeech in the mac backend we have a method that worked fine with Qt 5.4.0. I've recently upgraded to Qt 5.4.1 and when trying to run the example widget I'm getting an exception thrown when we call QString::fromNSString on the age string we get from the NSSpeechSynthesizer voice's attributes NSDictionary. The backtrace in lldb looks like this:</div><div><br></div><div>







<p><span>bowser:qtspeech jeremy$ lldb examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak </span></p>
<p><span>(lldb) target create "examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak"</span></p>
<p><span>Current executable set to 'examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak' (x86_64).</span></p>
<p><span>(lldb) </span><span>r</span></p>
<p><span>Process 477 launched: '/Users/jeremy/devel/kde/src/qtspeech/examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak' (x86_64)</span></p>
<p><span>Setting voice name to  "Agnes"</span></p>
<p><span>gender is  "VoiceGenderFemale"</span></p>
<p><span>age is  0x2337</span></p>
<p><span>2015-03-02 19:08:43.649 hello_speak[477:8289] -[__NSCFNumber length]: unrecognized selector sent to instance 0x2337</span></p>
<p><span>2015-03-02 19:08:43.649 hello_speak[477:8289] An uncaught exception was raised</span></p>
<p><span>2015-03-02 19:08:43.650 hello_speak[477:8289] -[__NSCFNumber length]: unrecognized selector sent to instance 0x2337</span></p>
<p><span>2015-03-02 19:08:43.650 hello_speak[477:8289] (</span></p>
<p><span><span>       </span>0   CoreFoundation                      0x00007fff92a7266c __exceptionPreprocess + 172</span></p>
<p><span><span>       </span>1   libobjc.A.dylib                     0x00007fff93e6276e objc_exception_throw + 43</span></p>
<p><span><span>       </span>2   CoreFoundation                      0x00007fff92a756dd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205</span></p>
<p><span><span>       </span>3   CoreFoundation                      0x00007fff929bcaa4 ___forwarding___ + 1028</span></p>
<p><span><span>       </span>4   CoreFoundation                      0x00007fff929bc618 _CF_forwarding_prep_0 + 120</span></p>
<p><span><span>       </span>5   QtCore                              0x000000010002742b _ZN7QString12fromNSStringEPK8NSString + 59</span></p>
<p><span><span>       </span>6   QtTextToSpeech                      0x0000000100013f3e _ZNK23QTextToSpeechPrivateMac15voiceForNSVoiceEP8NSString + 1038</span></p>
<p><span><span>       </span>7   QtTextToSpeech                      0x000000010001489b _ZNK23QTextToSpeechPrivateMac15availableVoicesEv + 219</span></p>
<p><span><span>       </span>8   QtTextToSpeech                      0x00000001000155a3 _ZNK13QTextToSpeech15availableVoicesEv + 19</span></p>
<p><span><span>       </span>9   hello_speak                         0x0000000100004590 _ZN10MainWindow13localeChangedERK7QLocale + 176</span></p>
<p><span><span>       </span>10  hello_speak                         0x0000000100003dc7 _ZN10MainWindowC2EP7QWidget + 935</span></p>
<p><span><span>       </span>11  hello_speak                         0x000000010000394e main + 62</span></p>
<p><span><span>       </span>12  hello_speak                         0x0000000100003904 start + 52</span></p>
<p><span><span>       </span>13  ???                                 0x0000000000000001 0x0 + 1</span></p>
<p><span>)</span></p>
<p><span>2015-03-02 19:08:43.650 hello_speak[477:8289] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFNumber length]: unrecognized selector sent to instance 0x2337'</span></p>
<p><span>*** First throw call stack:</span></p>
<p><span>(</span></p>
<p><span><span>       </span>0   CoreFoundation                      0x00007fff92a7266c __exceptionPreprocess + 172</span></p>
<p><span><span>       </span>1   libobjc.A.dylib                     0x00007fff93e6276e objc_exception_throw + 43</span></p>
<p><span><span>       </span>2   CoreFoundation                      0x00007fff92a756dd -[NSObject(NSObject) doesNotRecognizeSelector:] + 205</span></p>
<p><span><span>       </span>3   CoreFoundation                      0x00007fff929bcaa4 ___forwarding___ + 1028</span></p>
<p><span><span>       </span>4   CoreFoundation                      0x00007fff929bc618 _CF_forwarding_prep_0 + 120</span></p>
<p><span><span>       </span>5   QtCore                              0x000000010002742b _ZN7QString12fromNSStringEPK8NSString + 59</span></p>
<p><span><span>       </span>6   QtTextToSpeech                      0x0000000100013f3e _ZNK23QTextToSpeechPrivateMac15voiceForNSVoiceEP8NSString + 1038</span></p>
<p><span><span>       </span>7   QtTextToSpeech                      0x000000010001489b _ZNK23QTextToSpeechPrivateMac15availableVoicesEv + 219</span></p>
<p><span><span>       </span>8   QtTextToSpeech                      0x00000001000155a3 _ZNK13QTextToSpeech15availableVoicesEv + 19</span></p>
<p><span><span>       </span>9   hello_speak                         0x0000000100004590 _ZN10MainWindow13localeChangedERK7QLocale + 176</span></p>
<p><span><span>       </span>10  hello_speak                         0x0000000100003dc7 _ZN10MainWindowC2EP7QWidget + 935</span></p>
<p><span><span>       </span>11  hello_speak                         0x000000010000394e main + 62</span></p>
<p><span><span>       </span>12  hello_speak                         0x0000000100003904 start + 52</span></p>
<p><span><span>       </span>13  ???                                 0x0000000000000001 0x0 + 1</span></p>
<p><span>)</span></p>
<p><span>libc++abi.dylib: terminating with uncaught exception of type NSException</span></p>
<p><span>Process 477 stopped</span></p>
<p><span>* thread #1: tid = 0x2061, 0x00007fff94542286 libsystem_kernel.dylib`__pthread_kill + 10, queue = 'com.apple.main-thread', stop reason = signal SIGABRT</span></p>
<p><span>    frame #0: 0x00007fff94542286 libsystem_kernel.dylib`__pthread_kill + 10</span></p>
<p><span>libsystem_kernel.dylib`__pthread_kill + 10:</span></p>
<p><span>-> 0x7fff94542286:  jae    0x7fff94542290            ; __pthread_kill + 20</span></p>
<p><span>   0x7fff94542288:  movq   %rax, %rdi</span></p>
<p><span>   0x7fff9454228b:  jmp    0x7fff9453dc53            ; cerror_nocancel</span></p>
<p><span>   0x7fff94542290:  retq   </span></p>
<p><span>(lldb) </span><span>q</span></p>
<p><span>Quitting LLDB will kill one or more processes. Do you really want to proceed: [Y/n] y</span></p><p><span><br></span></p><p><span>Did something change within QString::fromNSString to cause it to throw an exception in some cases? It seems we are trying to send a message to some object that can't respond to that message.</span></p><p><span><br></span></p><p><span>thanks,</span></p><p><span>Jeremy</span></p></div></div>
</blockquote></div><br></div>