Results 1 to 6 of 6

Thread: Crash when qDebug in destructor

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2014
    Posts
    20
    Thanks
    2

    Default Crash when qDebug in destructor

    I create a singleton class. I write "qDebug()<<"~Garbo";" in its destructor. But when close the program, its crash.
    Any help will be appreciated.
    The stack is following.
    (gdb) bt
    #0 0x0000003c82275795 in malloc_consolidate () from /lib64/libc.so.6
    #1 0x0000003c82278612 in _int_malloc () from /lib64/libc.so.6
    #2 0x0000003c82279a3d in malloc () from /lib64/libc.so.6
    #3 0x0000003c8221fb21 in __gconv_open () from /lib64/libc.so.6
    #4 0x0000003c8221f4c2 in iconv_open () from /lib64/libc.so.6
    #5 0x00007f93fad70605 in QIconvCodec::createIconv_t (to=0x0, from=0x7f93fadd2d19 "UTF-16")
    at /var/tmp/qt-x11-src-4.5.1/src/corelib/codecs/qiconvcodec.cpp:456
    #6 0x00007f93fad70e3c in QIconvCodec::convertFromUnicode (this=<value optimized out>, uc=0x1e4da0a, len=3, convState=0x0)
    at /var/tmp/qt-x11-src-4.5.1/src/corelib/codecs/qiconvcodec.cpp:328
    #7 0x00007f93fad6b418 in QTextCodec::fromUnicode (this=0x71, str=<value optimized out>)
    at /var/tmp/qt-x11-src-4.5.1/src/corelib/codecs/qtextcodec.cpp:1189
    #8 0x00007f93fac93c31 in QString::toLocal8Bit (this=0x1c7ad50)
    at /var/tmp/qt-x11-src-4.5.1/src/corelib/tools/qstring.cpp:3358
    #9 0x000000000040c80e in QDebug::~QDebug (this=0x7fff65a4e7b0, __in_chrg=<value optimized out>)
    at /opt/qtsdk-2009.02/qt/include/QtCore/qdebug.h:83
    #10 0x000000000040ca53 in PaStyle::Garbo::~Garbo (this=0x619ca8, __in_chrg=<value optimized out>) at ./pa_style.h:23
    #11 0x0000003c82235fd2 in exit () from /lib64/libc.so.6
    #12 0x0000003c8221ec64 in __libc_start_main () from /lib64/libc.so.6
    #13 0x0000000000406b09 in _start ()

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Crash when qDebug in destructor

    And what happens when you comment out this line? Does the destructor execute without a crash?

Similar Threads

  1. Replies: 2
    Last Post: 9th September 2011, 09:57
  2. QSqlQuery crash in destructor
    By seim in forum Qt Programming
    Replies: 5
    Last Post: 22nd January 2010, 22:12
  3. QTableWidget Crash in Destructor
    By mclark in forum Qt Programming
    Replies: 19
    Last Post: 25th July 2008, 14:44
  4. Crash on QString Destructor
    By ToddAtWSU in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2007, 14:28
  5. QList crash in destructor
    By mclark in forum Newbie
    Replies: 7
    Last Post: 6th December 2006, 15:27

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.