[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mingw-cross-env-list] Qt5 & icu (was: Any hints on how to debug on

From: Stefan Löffler
Subject: Re: [Mingw-cross-env-list] Qt5 & icu (was: Any hints on how to debug on MXE?)
Date: Wed, 13 May 2015 12:07:47 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


On 16.02.2015 10:33, Nikos Chantziaras wrote:
> However, I found the problem. I needed to replace the config flag in
> qtbase.mk:
>   -icu
> with:
>   -no-icu

I stumbled across the same issue recently.

> Qt5 seems unable to use a static ICU. I'm not sure what disabling ICU
> does though, but the text codecs seem to work fine even without it.

I should have checked the mailing list before starting debugging myself,
but at least this way I might be able to give a little more insight into
Qt has a bunch of built-in codecs
(http://doc.qt.io/qt-5/qtextcodec.html#details), that get used when ICU
is disabled.
With ICU enabled, most of the processing is run through ICU. Now ICU can
handle Qt's internal codecs, but does not seem to report them properly
(see https://bugreports.qt.io/browse/QTBUG-46090).
The real problem causing crashes, however, is
QTextCodec::codecForLocale() (and the functions it calls). This is used
in several places in Qt as a "last resort" that is not checked further
before dereferencing, therefore causing crashes when it returns NULL
(see https://bugreports.qt.io/browse/QTBUG-46089).

At least on my system, ucnv_getDefaultName() (used in
QIcuCodec::defaultCodecUnlocked, address@hidden, called by
QTextCodec::codecForLocale()) returns "US-ASCII". This is passed on to
QIcuCodec::codecForNameUnlocked() to actually construct the codec.
There, ucnv_getStandardName is called repeatedly (l460 and l463) to try
to resolve the name - which fails for whatever reason. This puts
QIcuCodec in qt_only mode (l468), and Qt does not support "US-ASCII" by
that name. Therefore, the whole chains returns a NULL codec, thus
causing the crash.

I don't know if this is a problem in mxe (not building icu properly), a
general icu problem (not resolving the canonical name "US-ASCII" to
itself by ucnv_getStandardName), or a Qt problem, though.

Anyway, building Qt without icu support should be fine, obviously at the
cost of any additional codecs supported by icu but not built into Qt by


reply via email to

[Prev in Thread] Current Thread [Next in Thread]