[Qt-interest] Strange crash on OSX

Dan White ygor at comcast.net
Sun Aug 30 15:59:46 CEST 2009


I would start by using a few qDebug calls to see the value of both  
the string and the date objects.

On Aug 30, 2009, at 8:01 AM, Info wrote:

> Hi,
>
> I'm experiencing a strange crash on OSX which does not occur on
> Windows and I can't see a logical reason for it, the line in question
> is:
>
> QString message(QString("%1 %2").arg(err-
>> time().toString(Qt::SystemLocaleShortDate)).arg(err->detail()));
>
> Where err is a pointer to an object with a QDateTime and a QString and
> the error I receive is:
>
> EXC_BAD_ACCESS (Sometimes with Non-aligned pointer being freed)
>
> Now, I'm not freeing a pointer at this point but something must be,
> the stack trace up to the error is:
>
> #0	0x909ae3e5 in tiny_malloc_from_free_list
> #1	0x909a71cd in szone_malloc
> #2	0x909a70d8 in malloc_zone_malloc
> #3	0x909a706c in malloc
> #4	0x92d979be in icu::Calendar::createInstance
> #5	0x92da1abd in icu::SimpleDateFormat::initializeCalendar
> #6	0x92da171b in icu::SimpleDateFormat::construct
> #7	0x92da1673 in icu::SimpleDateFormat::SimpleDateFormat
> #8	0x92da157f in icu::DateFormat::create
> #9	0x92da13bf in udat_open
> #10	0x941b5afe in CFDateFormatterCreate
> #11	0x003384f8 in QSystemLocale::query
> #12	0x00336fa1 in QLocale::toString
> #13	0x00312d2e in QTime::toString
> #14	0x00316e3f in QDateTime::toString
>
> So it seems the error is in the QDateTime::toString() but I'm sure
> that it's something I'm doing that's causing it as I would have seen
> the problem before, I just can't figure out exactly what it is. Does
> anyone have any ideas?
>
> I'm getting a lot of strange errors like this lately which don't occur
> in Windows and didn't occur until I started using XCode to build the
> project so I am certain it must be a compiler or linker setting
> somewhere which may be causing the problem but I'm not sure how to
> diagnose it. Sometimes the app will run for hours, sometimes only
> seconds. The error above is the most common but I get similar errors
> elsewhere.
>
> Any help in tracking down the problem would be greatly appreciated!
>
> Thanks.
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list