Results 1 to 2 of 2

Thread: Got a weird error while executing my programs

  1. #1
    Join Date
    Nov 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Got a weird error while executing my programs

    I'm a college student (so yeah i'm newb) and i have an error that i've never encountered.

    Qt Code:
    1. Qt has caught an exception thrown from an event handler. Throwing
    2. exceptions from an event handler is not supported in Qt. You must
    3. reimplement QApplication::notify() and catch all exceptions there.
    4.  
    5. terminate called after throwing an instance of 'std::bad_alloc'
    6. what(): std::bad_alloc
    7.  
    8. Program received signal SIGABRT, Aborted.
    9. 0x00007ffff5f8bd05 in raise () from /lib/x86_64-linux-gnu/libc.so.6
    To copy to clipboard, switch view to plain text mode 

    The stacktrace from gdb return me :
    Qt Code:
    1. #0 0x00007ffff5f8bd05 in raise () from /lib/x86_64-linux-gnu/libc.so.6
    2. #1 0x00007ffff5f8fab6 in abort () from /lib/x86_64-linux-gnu/libc.so.6
    3. #2 0x00007ffff68426dd in __gnu_cxx::__verbose_terminate_handler() ()
    4. from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    5. #3 0x00007ffff6840926 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    6. #4 0x00007ffff6840953 in std::terminate() ()
    7. from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    8. #5 0x00007ffff6840aa6 in __cxa_rethrow ()
    9. from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    10. #6 0x00007ffff6e05bb2 in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /usr/lib/libQtCore.so.4
    11. #7 0x00007ffff6e09ecb in QCoreApplication::exec() ()
    12. from /usr/lib/libQtCore.so.4
    13. #8 0x0000000000404d09 in main ()
    To copy to clipboard, switch view to plain text mode 

    here's the whole class: http://pastie.org/2921209

    Here's some info I found when trying:
    When I comment the line #26 setCentralWidget(widTurtle);

    the programme will just execute fine.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,546
    Thanks
    13
    Thanked 1,578 Times in 1,507 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Got a weird error while executing my programs

    std::bad_alloc is thrown by the new operator when insufficient memory is available or there was some other issue with memory.

    If you build a debug version of your code, and run the program in the debugger you should be able to inspect the value of all your member variables etc. I cannot see an obvious issue with the Qt UI construction. Have you tried with the Turtle stuff commented out?

Similar Threads

  1. Runtime error while executing a project
    By bajoelkid12 in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2011, 04:45
  2. Error while executing the exe release file
    By harmodrew in forum Newbie
    Replies: 7
    Last Post: 21st September 2010, 10:21
  3. Replies: 2
    Last Post: 11th August 2010, 10:13
  4. Error while executing a application - Gtk WARNING
    By augusbas in forum Qt Programming
    Replies: 1
    Last Post: 12th June 2010, 12:25
  5. Error executing SELECT query with QSQLITE
    By garfield85 in forum Qt Programming
    Replies: 6
    Last Post: 25th May 2009, 18:05

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.