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

Segfault running trivial QML example

    XMLWordPrintable

Details

    Description

      kde-devel@chimera:~/kde/src/playground/qml$ cat modeldemo.qml

      import Qt 4.7

      Rectangle {}
      kde-devel@chimera:~/kde/src/playground/qml$ qml modeldemo.qml
      Segmentation fault
      kde-devel@chimera:~/kde/src/playground/qml$ valgrind qml modeldemo.qml
      ==3139== Memcheck, a memory error detector.
      ==3139== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
      ==3139== Using LibVEX rev 1884, a library for dynamic binary translation.
      ==3139== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
      ==3139== Using valgrind-3.4.1-Debian, a dynamic binary instrumentation framework.
      ==3139== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
      ==3139== For more details, rerun with: -v
      ==3139==
      ==3139== Invalid read of size 1
      ==3139== at 0x506A68A: QDeclarativePrivate::registerType(QDeclarativePrivate::RegisterType const&) (qdeclarativemetatype.cpp:438)
      ==3139== by 0x424BC2: int qmlRegisterUncreatableType<DeviceOrientation>(char const*, int, int, char const*, QString const&) (qdeclarative.h:154)
      ==3139== by 0x414208: QDeclarativeViewer::registerTypes() (qmlruntime.cpp:1443)
      ==3139== by 0x449334: main (main.cpp:205)
      ==3139== Address 0x700000004 is not stack'd, malloc'd or (recently) free'd
      ==3139==
      ==3139== Process terminating with default action of signal 11 (SIGSEGV)
      ==3139== Access not within mapped region at address 0x700000004
      ==3139== at 0x506A68A: QDeclarativePrivate::registerType(QDeclarativePrivate::RegisterType const&) (qdeclarativemetatype.cpp:438)
      ==3139== by 0x424BC2: int qmlRegisterUncreatableType<DeviceOrientation>(char const*, int, int, char const*, QString const&) (qdeclarative.h:154)
      ==3139== by 0x414208: QDeclarativeViewer::registerTypes() (qmlruntime.cpp:1443)
      ==3139== by 0x449334: main (main.cpp:205)
      ==3139== If you believe this happened as a result of a stack overflow in your
      ==3139== program's main thread (unlikely but possible), you can try to increase
      ==3139== the size of the main thread stack using the --main-stacksize= flag.
      ==3139== The main thread stack size used in this run was 8388608.
      ==3139==
      ==3139== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 482 from 4)
      ==3139== malloc/free: in use at exit: 1,062,591 bytes in 10,465 blocks.
      ==3139== malloc/free: 33,388 allocs, 22,923 frees, 4,574,230 bytes allocated.
      ==3139== For counts of detected errors, rerun with: -v
      ==3139== searching for pointers to 10,465 not-freed blocks.
      ==3139== checked 6,643,584 bytes.
      ==3139==
      ==3139== LEAK SUMMARY:
      ==3139== definitely lost: 288 bytes in 2 blocks.
      ==3139== possibly lost: 63,822 bytes in 1,189 blocks.
      ==3139== still reachable: 998,481 bytes in 9,274 blocks.
      ==3139== suppressed: 0 bytes in 0 blocks.
      ==3139== Rerun with --leak-check=full to see details of leaked memory.
      Segmentation fault
      kde-devel@chimera:~/kde/src/playground/qml$ gdb -args qml modeldemo.qml
      GNU gdb 6.8-debian
      Copyright (C) 2008 Free Software Foundation, Inc.
      License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law. Type "show copying"
      and "show warranty" for details.
      This GDB was configured as "x86_64-linux-gnu"...
      (gdb) r
      Starting program: /home/kde-devel/kde/bin/qml modeldemo.qml
      [Thread debugging using libthread_db enabled]
      [New Thread 0x7f34af09d790 (LWP 3145)]
      Qt: gdb: -nograb added to command-line options.
      Use the -dograb option to enforce grabbing.

      Program received signal SIGSEGV, Segmentation fault.
      [Switching to Thread 0x7f34af09d790 (LWP 3145)]
      0x00007f34aebcc68a in QDeclarativePrivate::registerType (type=@0x7fff41740270) at /home/kde-devel/kde/src/qt/src/declarative/qml/qdeclarativemetatype.cpp:438
      438 for (int ii = 0; type.elementName[ii]; ++ii)

      { (gdb) bt #0 0x00007f34aebcc68a in QDeclarativePrivate::registerType (type=@0x7fff41740270) at /home/kde-devel/kde/src/qt/src/declarative/qml/qdeclarativemetatype.cpp:438 #1 0x0000000000424bc3 in qmlRegisterUncreatableType<DeviceOrientation> (uri=0x44eee3 "Qt", versionMajor=4, versionMinor=7, qmlName=0x44eed7 "Orientation", reason=@0x7fff41740360) at ../../include/QtDeclarative/../../../../src/qt/src/declarative/qml/qdeclarative.h:154 #2 0x0000000000414209 in QDeclarativeViewer::registerTypes () at /home/kde-devel/kde/src/qt/tools/qml/qmlruntime.cpp:1443 #3 0x0000000000449335 in main (argc=2, argv=0x7fff41740a88) at /home/kde-devel/kde/src/qt/tools/qml/main.cpp:205 (gdb) l 433 }

      434
      435 int QDeclarativePrivate::registerType(const QDeclarativePrivate::RegisterType &type)
      436 {
      437 if (type.elementName) {
      438 for (int ii = 0; type.elementName[ii]; ++ii) {
      439 if (!isalnum(type.elementName[ii]))

      { 440 qWarning("QDeclarativeMetaType: Invalid QML element name %s", type.elementName); 441 return -1; 442 }

      (gdb) c
      Continuing.

      Program terminated with signal SIGSEGV, Segmentation fault.
      The program no longer exists.
      (gdb) q
      kde-devel@chimera:~/kde/src/playground/qml$ qmake -version
      QMake version 2.01a
      Using Qt version 4.7.0 in /home/kde-devel/kde/lib
      kde-devel@chimera:~/kde/src/playground/qml$ cs qt
      kde-devel@chimera:~/kde/src/qt(4.7.beta1)$ git describe
      v4.7.0-beta1
      kde-devel@chimera:~/kde/src/qt(4.7.beta1)$

      Other computers don't reproduce the segfault.

      I can run C++ applications that create their own QDeclarativeView (ie, not using the qml application)

      Attachments

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

        Activity

          People

            aakenned Aaron Kennedy
            steveire Stephen Kelly (Personal)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes