[Interest] Certain QTextCodecs causing crashes on Linux

Thiago Macieira thiago.macieira at intel.com
Wed Jul 31 20:54:30 CEST 2013


On quarta-feira, 31 de julho de 2013 18:21:42, Scott Aron Bloom wrote:
> As to the size of the codec.. Is there a way to tell the size?

Hmm... You can feed it an 'a' and see how many bytes come out. Actually, 
verify that the output is exactly one byte 0x61. That way, you'll also prevent 
someone from setting EBCDIC or other funky 8-bit codecs.

> The reason I ask, this functionality in the tool came from the applications
> need to allow the customer to set a Chinese codec, so that the customers
> mixed language text file could be read in.

Are you sure you need to set the *locale* codec for that? Please note that it 
affects filenames on disk too (on Unix) and just about every kind of 8-bit 
system API.

> Hrere is the traceback..
> 
> #0  0x0000003edaa328a5 in raise () from /lib64/libc.so.6
> #1  0x0000003edaa34085 in abort () from /lib64/libc.so.6
> #2  0x0000003edc25ea0f in g_assertion_message () from
> /lib64/libglib-2.0.so.0 
> #3  0x0000003edc25efb0 in g_assertion_message_expr
> () from /lib64/libglib-2.0.so.0 
> #4  0x0000003ee522562e in ?? () from
> /usr/lib64/libgconf-2.so.4
> #5  0x0000003ee5227c38 in ?? () from /usr/lib64/libgconf-2.so.4
> #6  0x0000003ee522906d in ?? () from /usr/lib64/libgconf-2.so.4
> #7  0x0000003ee5229663 in gconf_client_get_bool () from
> /usr/lib64/libgconf-2.so.4 
> #8  0x00007ffff78b571c in ?? () from
> /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4 
> #9  0x00007ffff789fd8a in
> QGtkStyle::styleHint(QStyle::StyleHint, QStyleOption const*, QWidget
> const*, QStyleHintReturn*) const () from
> /usr/local/Trolltech/Qt-4.7.4/lib/libQtGui.so.4 

Gtk style... I see exactly one use of gconf_client_get_bool:

styles/qgtkstyle_p.cpp:        bool result = gconf_client_get_bool(client, 
qPrintable(key), &err);

Remember that qPrintable is .toLocal8Bit().constData(). That means we've just 
passed an UTF-32 string to gconf. I bet that's why it choked.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130731/0f0ef28f/attachment.sig>


More information about the Interest mailing list