[Interest] Porting to Qt5/macx-xcode Mountain Lion

Joshua Grauman jnfo-c at grauman.com
Thu Jan 24 18:11:49 CET 2013


> Hi,
>
> On Thu, Jan 24, 2013 at 7:08 AM, Joshua Grauman <jnfo-c at grauman.com> wrote:
>> First a disclaimer, I know very little about Mac OS specifics. I only have
>> a Mac to build my app for it.
>>
>> I am porting two apps to Mac OS Mountain Lion and Qt5. The apps have run
>> fine on quite a few of the Qt4 series versions in Windows/Linux/Mac (Snow
>> Leopard). They both run fine in Qt5/Linux. I just installed the latest
>> Mountain Lion version with latest XCode. I've gotten them to compile by
>> running:
>>
>> qmake -spec macx-xcode project.pro
>> xcodebuild
>>
>> But two completely different programs both segfault on a simple line:
>>
>>    QFile file("file");
>>    if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
>>      exit(0);
>>    QTextStream in(&file);
>>    in.setCodec("UTF-8");
>>    while(!in.atEnd())
>>    {
>>      QString line = in.readLine(); //segfault here
>>    ...
>>
>> At first I thought it was new Mac OS sandboxing stupidity limiting my file
>> acces, but I have have been able to get that line to run fine in a minimal
>> example (so I'm guessing that's not it, but I'm still not positive).
>
> Where's your backtrace? A backtrace should be able to tell you at
> least where exactly it segfaults (possibly within Qt code). And make
> sure you have Qt built with debugging symbols, otherwise the backtrace
> won't be very useful.
>
> Andreas
>

Sorry, you're right that I should have included this for completeness.

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   QtCore                              0x0000000100d6bb0b QTextStreamPrivate::fillReadBuffer(long long) + 299
1   QtCore                              0x0000000100d6c26f QTextStreamPrivate::scan(QChar const**, int*, int, QTextStreamPrivate::TokenDelimiter) + 143
2   QtCore                              0x0000000100d6d5dd QTextStream::readLine(long long) + 125
3   com.yourcompany.trainer             0x0000000100005e59 main + 2825
4   com.yourcompany.trainer             0x00000001000028d4 start + 52

Thanks for any help!

Josh



More information about the Interest mailing list