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

Second Example of 'Getting Started with Qt' Crashes on exit

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.0.0
    • Fix Version/s: 5.0.0 Beta 2
    • Component/s: Documentation
    • Labels:
      None

      Description

      http://qt-project.org/doc/qt-5.0/gettingstartedqt.html

      If you take the second example and fix the includes for qt5 then it will crash on exit as below:

      Program received signal SIGABRT, Aborted.
      0x00007ffff5642d95 in raise () from /lib64/libc.so.6
      (gdb) bt
      #0 0x00007ffff5642d95 in raise () from /lib64/libc.so.6
      #1 0x00007ffff56442ab in abort () from /lib64/libc.so.6
      #2 0x00007ffff567cece in __libc_message () from /lib64/libc.so.6
      #3 0x00007ffff5682c06 in malloc_printerr () from /lib64/libc.so.6
      #4 0x00007ffff7564ee0 in QVBoxLayout::~QVBoxLayout (this=0x7fffffffdb90, __in_chrg=<optimized out>) at kernel/qboxlayout.cpp:1345
      #5 0x00007ffff758632c in QWidget::~QWidget (this=0x7fffffffdb60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1404
      #6 0x0000000000401164 in main (argv=1, args=0x7fffffffdd08) at main.cpp:19
      (gdb) fr 5
      #5 0x00007ffff758632c in QWidget::~QWidget (this=0x7fffffffdb60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1404
      1404 delete d->layout;

      The problem is that the layout is deleted but it was allocated on the stack. The same issue can be reproduced under 4.7.4.

        Attachments

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

          Activity

            People

            Assignee:
            docteam Qt Documentation Team
            Reporter:
            richmoore Richard Moore (qtnetwork)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes