Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-30931

ASSERT in QChar, caused by QUrl::toString()

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 4.8.6, 5.2.0
    • 4.8.4
    • None
    • Qt 4.8.4 ,Linux x64, gcc 4.7.2, Qt build with asserts enabled

    Description

      Using the following example

      #include <QUrl>
      int main(int argc, char** argv)
      {
      
          QString badUrl("http://localhost.de");
          badUrl.append(QChar(0x8be3a1));
      
          QUrl crashUrl(badUrl);
          QString ret = crashUrl.toString(); //crash here
      
          return 0;
      }
      

      causes an ASSERT

      ASSERT: "starter >= from" in file tools/qchar.cpp, line 1574

      Program received signal SIGABRT, Aborted.
      0x00007ffff6d43995 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
      56 ../nptl/sysdeps/unix/sysv/linux/raise.c: Datei oder Verzeichnis nicht gefunden.
      (gdb) bt
      #0 0x00007ffff6d43995 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
      #1 0x00007ffff6d44e07 in __GI_abort () at abort.c:90
      #2 0x00007ffff7955344 in qt_message_output (msgType=<optimized out>, msgType@entry=QtFatalMsg, buf=<optimized out>)
      at global/qglobal.cpp:2323
      #3 0x00007ffff79554a0 in qt_message(QtMsgType, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg,
      msg=msg@entry=0x7ffff7ad11d8 "ASSERT: \"%s\" in file %s, line %d", ap=ap@entry=0x7fffffffd348) at global/qglobal.cpp:2369
      #4 0x00007ffff7955614 in qFatal (msg=msg@entry=0x7ffff7ad11d8 "ASSERT: \"%s\" in file %s, line %d") at global/qglobal.cpp:2552
      #5 0x00007ffff7955656 in qt_assert (assertion=assertion@entry=0x7ffff7b153e0 "starter >= from",
      file=file@entry=0x7ffff7b153d0 "tools/qchar.cpp", line=line@entry=1574) at global/qglobal.cpp:2018
      #6 0x00007ffff79b4de9 in composeHelper (from=1, version=QChar::Unicode_3_2, str=0x7fffffffd5b0) at tools/qchar.cpp:1574
      #7 qt_string_normalize (data=data@entry=0x7fffffffd5b0, mode=mode@entry=QString::NormalizationForm_KC,
      version=version@entry=QChar::Unicode_3_2, from=from@entry=1) at tools/qstring.cpp:6376
      #8 0x00007ffff7a139ce in qt_nameprep (source=source@entry=0x7fffffffd5b0, from=from@entry=0) at io/qurl.cpp:3029
      #9 0x00007ffff7a1a518 in qt_is_idn_enabled (domain=...) at io/qurl.cpp:3277
      #10 qt_ACE_do (domain=..., op=<optimized out>, op@entry=NormalizeAce) at io/qurl.cpp:3329
      #11 0x00007ffff7a1a87a in QUrlPrivate::canonicalHost (this=this@entry=0x6040a0) at io/qurl.cpp:3494
      #12 0x00007ffff7a1ddd6 in QUrlPrivate::authority (this=0x6040a0, options=...) at io/qurl.cpp:3565
      #13 0x00007ffff7a20089 in QUrl::toString (this=0x7fffffffd810, options=...) at io/qurl.cpp:5821
      #14 0x0000000000401adf in main (argc=1, argv=0x7fffffffd948) at /home/buscher/QT/qcrash-qchar/main.cpp:11

      and makes all applications using QUrl crashable(assertable)

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            ritt.ks Konstantin Ritt
            buscher Bernd Buschinski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes