Valgrind hangs when generating supression for Qt5 menus

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Valgrind hangs when generating supression for Qt5 menus

Nathan Bahr
Hi,

I made a simple Qt5 application with a single menu item and valgrind is configured to print suppression code.

If I open and close a menu, valgrind holds onto the QMenu object and prompts to print supression code. This causes the whole setup to hang where I cannot interact with the application or command line interface. I can force-quit the application, which exits out of the command line. The application does not hang if gen-suppressions=no.

Is there any way to set valgrind to automatically generate suppression code instead of prompting? Or to make it from the following trace?

==19392== Syscall param writev(vector[...]) points to uninitialised byte(s)
==19392==    at 0x624E40D: ??? (syscall-template.S:84)
==19392==    by 0x9204F28: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==19392==    by 0x920531C: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==19392==    by 0x9205A76: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==19392==    by 0x9205C43: xcb_flush (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==19392==    by 0x40FACB3: QXcbWindow::hide() (in /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.5.1)
==19392==    by 0x6614B17: QWindow::setVisible(bool) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.5.1)
==19392==    by 0x51E8816: QWidgetPrivate::hide_sys() (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1)
==19392==    by 0x51EFE73: QWidgetPrivate::hide_helper() (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1)
==19392==    by 0x51F47FF: QWidget::setVisible(bool) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1)
==19392==    by 0x533E78B: QMenuBar::mousePressEvent(QMouseEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1)
==19392==    by 0x51F540E: QWidget::event(QEvent*) (in /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.5.1)
==19392==  Address 0xd4c5721 is 4,545 bytes inside a block of size 21,152 alloc'd
==19392==    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==19392==    by 0x92048DB: xcb_connect_to_fd (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==19392==    by 0x9208610: xcb_connect_to_display_with_auth_info (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
==19392==    by 0x7003809: _XConnectXCB (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19392==    by 0x6FF4391: XOpenDisplay (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==19392==    by 0x40E770E: QXcbConnection::QXcbConnection(QXcbNativeInterface*, bool, unsigned int, char const*) (in /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.5.1)
==19392==    by 0x40EABAC: QXcbIntegration::QXcbIntegration(QStringList const&, int&, char**) (in /usr/lib/x86_64-linux-gnu/libQt5XcbQpa.so.5.5.1)
==19392==    by 0x40293AC: ??? (in /usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so)
==19392==    by 0x65FAD91: QPlatformIntegrationFactory::create(QString const&, QStringList const&, int&, char**, QString const&) (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.5.1)
==19392==    by 0x6606FC3: QGuiApplicationPrivate::createPlatformIntegration() (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.5.1)
==19392==    by 0x6607ECC: QGuiApplicationPrivate::createEventDispatcher() (in /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.5.1)
==19392==    by 0x596E7E5: QCoreApplication::init() (in /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.5.1)

Thanks

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind hangs when generating supression for Qt5 menus

David Faure
On vendredi 14 juillet 2017 21:10:50 CEST Nathan Bahr wrote:

> Hi,
>
> I made a simple Qt5 application with a single menu item and valgrind is
> configured to print suppression code.
>
> If I open and close a menu, valgrind holds onto the QMenu object and
> prompts to print supression code. This causes the whole setup to hang where
> I cannot interact with the application or command line interface. I can
> force-quit the application, which exits out of the command line. The
> application does not hang if gen-suppressions=no.

This is probably due to QMenu grabbing keyboard/mouse on X11?
You can disable this by passing -nograb to the application.

> Is there any way to set valgrind to automatically generate suppression code
> instead of prompting?

Yes, --gen-suppressions=all

--
David Faure, [hidden email], http://www.davidfaure.fr
Working on KDE Frameworks 5


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind hangs when generating supression for Qt5 menus

Paul Floyd
In reply to this post by Nathan Bahr

On 14 Jul 2017, at 21:10, Nathan Bahr wrote:

> Hi,
>
> I made a simple Qt5 application with a single menu item and valgrind is configured to print suppression code.
>
> If I open and close a menu, valgrind holds onto the QMenu object and prompts to print supression code. This causes the whole setup to hang where I cannot interact with the application or command line interface. I can force-quit the application, which exits out of the command line. The application does not hang if gen-suppressions=no.
>
> Is there any way to set valgrind to automatically generate suppression code instead of prompting? Or to make it from the following trace?

Hi

You can use the option

    --gen-suppressions=no|yes|all    print suppressions for errors? [no]

This will generate a suppression block after the usual stacktrace, something like this:

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: reachable
   fun:malloc
   fun:main
}

If you do reuse the generated suppressions then you will need to generate some sort of unique name.

A+
Paul
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Valgrind hangs when generating supression for Qt5 menus

Nathan Bahr
Thank you for the feedback. Setting -gen-suppressions to all helped resolve the issues.

On Fri, Jul 14, 2017 at 12:22 PM, Paul Floyd <[hidden email]> wrote:

On 14 Jul 2017, at 21:10, Nathan Bahr wrote:

> Hi,
>
> I made a simple Qt5 application with a single menu item and valgrind is configured to print suppression code.
>
> If I open and close a menu, valgrind holds onto the QMenu object and prompts to print supression code. This causes the whole setup to hang where I cannot interact with the application or command line interface. I can force-quit the application, which exits out of the command line. The application does not hang if gen-suppressions=no.
>
> Is there any way to set valgrind to automatically generate suppression code instead of prompting? Or to make it from the following trace?

Hi

You can use the option

    --gen-suppressions=no|yes|all    print suppressions for errors? [no]

This will generate a suppression block after the usual stacktrace, something like this:

{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: reachable
   fun:malloc
   fun:main
}

If you do reuse the generated suppressions then you will need to generate some sort of unique name.

A+
Paul
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-users
Loading...