[Interest] Certain QTextCodecs causing crashes on Linux

Scott Aron Bloom scott.bloom at onshorecs.com
Wed Jul 31 18:44:10 CEST 2013


Ran into a weird situation.. I have to allow my customer to set the System Codec so when they load a file, it loads correctly.

However, in QA'ing the code, certain Text Codecs are causing a crash in QMessageBox (and presumably other widgets).


  6 int main( int argc, char ** argv )
  7 {
  8     QApplication appl( argc, argv );
  9     QString codecName = "UTF-8";
10     if ( argc > 1 )
11         codecName = argv[ 1 ];
12
 13     QTextCodec * codec = QTextCodec::codecForName( codecName.toAscii() );
14     if ( !codec )
15     {
 16         QMessageBox::warning( NULL, argv[ 0 ], QString( "%1 not found" ).arg( codecName ) );
17         return 1;
18     }
19
 20     QTextCodec::setCodecForLocale( codec );
21     QMessageBox::warning( NULL, argv[ 0 ], codecName );
22     return 0;
23 }

When called with UTF-32 I get the following crash:
[scott at localhost build]$ ./CodecTest UTF-32
**
GConf:ERROR:gconf-client.c:2021:gconf_client_lookup: assertion failed: (last_slash != NULL)
Aborted (core dumped)

This is with Qt 4.7.4.

Any Ideas?

Thanks
Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130731/4a67eac3/attachment.html>


More information about the Interest mailing list