[Development] OS X QString::fromNSString

Jeremy Whiting jpwhiting at kde.org
Tue Mar 3 03:31:44 CET 2015


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.

BR,
Jeremy

On Mon, Mar 2, 2015 at 7:16 PM, Jeremy Whiting <jpwhiting at kde.org> wrote:

> Hello,
>
> 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:
>
> bowser:qtspeech jeremy$ lldb
> examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak
>
> (lldb) target create
> "examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak"
>
> Current executable set to
> 'examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak'
> (x86_64).
>
> (lldb) r
>
> Process 477 launched:
> '/Users/jeremy/devel/kde/src/qtspeech/examples/widgets/hello_speak/hello_speak.app/Contents/MacOS/hello_speak'
> (x86_64)
>
> Setting voice name to  "Agnes"
>
> gender is  "VoiceGenderFemale"
>
> age is  0x2337
>
> 2015-03-02 19:08:43.649 hello_speak[477:8289] -[__NSCFNumber length]:
> unrecognized selector sent to instance 0x2337
>
> 2015-03-02 19:08:43.649 hello_speak[477:8289] An uncaught exception was
> raised
>
> 2015-03-02 19:08:43.650 hello_speak[477:8289] -[__NSCFNumber length]:
> unrecognized selector sent to instance 0x2337
>
> 2015-03-02 19:08:43.650 hello_speak[477:8289] (
>
> 0   CoreFoundation                      0x00007fff92a7266c
> __exceptionPreprocess + 172
>
> 1   libobjc.A.dylib                     0x00007fff93e6276e
> objc_exception_throw + 43
>
> 2   CoreFoundation                      0x00007fff92a756dd
> -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
>
> 3   CoreFoundation                      0x00007fff929bcaa4
> ___forwarding___ + 1028
>
> 4   CoreFoundation                      0x00007fff929bc618
> _CF_forwarding_prep_0 + 120
>
> 5   QtCore                              0x000000010002742b
> _ZN7QString12fromNSStringEPK8NSString + 59
>
> 6   QtTextToSpeech                      0x0000000100013f3e
> _ZNK23QTextToSpeechPrivateMac15voiceForNSVoiceEP8NSString + 1038
>
> 7   QtTextToSpeech                      0x000000010001489b
> _ZNK23QTextToSpeechPrivateMac15availableVoicesEv + 219
>
> 8   QtTextToSpeech                      0x00000001000155a3
> _ZNK13QTextToSpeech15availableVoicesEv + 19
>
> 9   hello_speak                         0x0000000100004590
> _ZN10MainWindow13localeChangedERK7QLocale + 176
>
> 10  hello_speak                         0x0000000100003dc7
> _ZN10MainWindowC2EP7QWidget + 935
>
> 11  hello_speak                         0x000000010000394e main + 62
>
> 12  hello_speak                         0x0000000100003904 start + 52
>
> 13  ???                                 0x0000000000000001 0x0 + 1
>
> )
>
> 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'
>
> *** First throw call stack:
>
> (
>
> 0   CoreFoundation                      0x00007fff92a7266c
> __exceptionPreprocess + 172
>
> 1   libobjc.A.dylib                     0x00007fff93e6276e
> objc_exception_throw + 43
>
> 2   CoreFoundation                      0x00007fff92a756dd
> -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
>
> 3   CoreFoundation                      0x00007fff929bcaa4
> ___forwarding___ + 1028
>
> 4   CoreFoundation                      0x00007fff929bc618
> _CF_forwarding_prep_0 + 120
>
> 5   QtCore                              0x000000010002742b
> _ZN7QString12fromNSStringEPK8NSString + 59
>
> 6   QtTextToSpeech                      0x0000000100013f3e
> _ZNK23QTextToSpeechPrivateMac15voiceForNSVoiceEP8NSString + 1038
>
> 7   QtTextToSpeech                      0x000000010001489b
> _ZNK23QTextToSpeechPrivateMac15availableVoicesEv + 219
>
> 8   QtTextToSpeech                      0x00000001000155a3
> _ZNK13QTextToSpeech15availableVoicesEv + 19
>
> 9   hello_speak                         0x0000000100004590
> _ZN10MainWindow13localeChangedERK7QLocale + 176
>
> 10  hello_speak                         0x0000000100003dc7
> _ZN10MainWindowC2EP7QWidget + 935
>
> 11  hello_speak                         0x000000010000394e main + 62
>
> 12  hello_speak                         0x0000000100003904 start + 52
>
> 13  ???                                 0x0000000000000001 0x0 + 1
>
> )
>
> libc++abi.dylib: terminating with uncaught exception of type NSException
>
> Process 477 stopped
>
> * thread #1: tid = 0x2061, 0x00007fff94542286
> libsystem_kernel.dylib`__pthread_kill + 10, queue =
> 'com.apple.main-thread', stop reason = signal SIGABRT
>
>     frame #0: 0x00007fff94542286 libsystem_kernel.dylib`__pthread_kill + 10
>
> libsystem_kernel.dylib`__pthread_kill + 10:
>
> -> 0x7fff94542286:  jae    0x7fff94542290            ; __pthread_kill + 20
>
>    0x7fff94542288:  movq   %rax, %rdi
>
>    0x7fff9454228b:  jmp    0x7fff9453dc53            ; cerror_nocancel
>
>    0x7fff94542290:  retq
>
> (lldb) q
>
> Quitting LLDB will kill one or more processes. Do you really want to
> proceed: [Y/n] y
>
>
> 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.
>
>
> thanks,
>
> Jeremy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20150302/ae4c01f7/attachment.html>


More information about the Development mailing list