Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Infinite loop when closing window
Forum Updated to NodeBB v4.3 + New Features

Infinite loop when closing window

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 444 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    clydemcqueen
    wrote on last edited by
    #1

    Hi, I built and ran the videoplayer example. I'm using the code exactly as written. I'm have Qt5.12.8 on Ubuntu 20.04. My build environment is CLion with the OSRF ament macros; here's the CMake file I'm using:

    cmake_minimum_required(VERSION 3.5)
    project(videoplayer)
    
    set(CMAKE_AUTOMOC ON)
    set(CMAKE_AUTOUIC ON)
    set(CMAKE_AUTORCC ON)
    
    find_package(ament_cmake REQUIRED)
    find_package(Qt5Widgets REQUIRED)
    find_package(Qt5Multimedia REQUIRED)
    find_package(Qt5MultimediaWidgets REQUIRED)
    
    add_executable(
      videoplayer
      main.cpp
      videoplayer.cpp
    )
    
    ament_target_dependencies(
      videoplayer
      Qt5Widgets
      Qt5Multimedia
      Qt5MultimediaWidgets
    )
    
    ament_package()
    

    This compiles and runs just fine. If I run from the command line and hit Ctrl-C, then app closes cleanly. But when I close the window by clicking on the windows-close box I get a seg fault. Valgrind tells me that the stack can't grow, which makes me suspect an infinite loop:

    ==168367== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
    ==168367== 
    ==168367== Process terminating with default action of signal 11 (SIGSEGV)
    ==168367==  Access not within mapped region at address 0x1FFE801FF8
    ==168367== Stack overflow in thread #1: can't grow stack to 0x1ffe801000
    ==168367==    at 0x4C89C7D: QWidget::setAttribute(Qt::WidgetAttribute, bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.12.8)
    

    In CLion's debug window I do in fact see an infinite loop:

    <repeated>
    QWidget::create(unsigned long long, bool, bool) 0x00007f5f20b35f83
    QWidgetPrivate::createWinId() 0x00007f5f20b36295
    QWidget::create(unsigned long long, bool, bool) 0x00007f5f20b35f83
    QWidgetPrivate::createWinId() 0x00007f5f20b36295
    QWidget::create(unsigned long long, bool, bool) 0x00007f5f20b35f83
    QWidgetPrivate::createWinId() 0x00007f5f20b36295
    QWidget::create(unsigned long long, bool, bool) 0x00007f5f20b35f83
    QWidgetPrivate::createWinId() 0x00007f5f20b36295
    QWidget::create(unsigned long long, bool, bool) 0x00007f5f20b35f83
    QWidgetPrivate::createWinId() 0x00007f5f20b36295
    QWidgetPrivate::createWinId() 0x00007f5f20b362c8
    QWidget::winId() const 0x00007f5f20b36313
    QGstreamerVideoWidgetControl::eventFilter(QObject*, QEvent*) 0x00007f5f18206d50
    QCoreApplicationPrivate::sendThroughObjectEventFilters(QObject*, QEvent*) 0x00007f5f1ffcf64b
    QApplicationPrivate::notify_helper(QObject*, QEvent*) 0x00007f5f20b00a55
    QApplication::notify(QObject*, QEvent*) 0x00007f5f20b0a0f0
    QCoreApplication::notifyInternal2(QObject*, QEvent*) 0x00007f5f1ffcf93a
    QWidgetPrivate::setWinId(unsigned long long) 0x00007f5f20b33612
    QWidget::destroy(bool, bool) 0x00007f5f20b37572
    QWidget::~QWidget() 0x00007f5f20b3ec45
    QGstreamerVideoWidgetControl::~QGstreamerVideoWidgetControl() 0x00007f5f1820708e
    QGstreamerVideoWidgetControl::~QGstreamerVideoWidgetControl() 0x00007f5f182070ed
    QObjectPrivate::deleteChildren() 0x00007f5f1fff901e
    QObject::~QObject() 0x00007f5f200035ef
    <unknown> 0x00007f5f18c46efb
    <unknown> 0x00007f5f208d5963
    QMediaPlayer::~QMediaPlayer() 0x00007f5f2091706d
    QMediaPlayer::~QMediaPlayer() 0x00007f5f2091709d
    QObjectPrivate::deleteChildren() 0x00007f5f1fff901e
    QWidget::~QWidget() 0x00007f5f20b3ec29
    VideoPlayer::~VideoPlayer videoplayer.cpp:53
    main main.cpp:24
    __libc_start_main 0x00007f5f1f9820b3
    _start 0x000055876228dc8e
    

    Any ideas?

    Thanks in advance,
    /Clyde

    1 Reply Last reply
    0
    • jeremy_kJ Offline
      jeremy_kJ Offline
      jeremy_k
      wrote on last edited by
      #2

      @clydemcqueen said in Infinite loop when closing window:

      It looks like you have encountered https://bugreports.qt.io/browse/QTBUG-87325

      Asking a question about code? http://eel.is/iso-c++/testcase/

      C 1 Reply Last reply
      1
      • jeremy_kJ jeremy_k

        @clydemcqueen said in Infinite loop when closing window:

        It looks like you have encountered https://bugreports.qt.io/browse/QTBUG-87325

        C Offline
        C Offline
        clydemcqueen
        wrote on last edited by
        #3

        @jeremy_k Yes, looks like it. Thanks.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved