News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

MouseSap: silence Valgrind

Started by tomjnx, January 05, 2013, 06:40:46 PM

Previous topic - Next topic

tomjnx

This trivial patch reduces the number of Valgrind "conditional jump depends on uninitialized value" warnings:

diff --git a/src/plugins/contrib/MouseSap/MouseSap.cpp b/src/plugins/contrib/MouseSap/MouseSap.cpp
index e611f18..dbf3a74 100644
--- a/src/plugins/contrib/MouseSap/MouseSap.cpp
+++ b/src/plugins/contrib/MouseSap/MouseSap.cpp
@@ -64,6 +64,7 @@ MouseSap* MouseSap::pMouseSap;

// ----------------------------------------------------------------------------
MouseSap::MouseSap()
+     : m_pMyLog(0), m_bEditorsAttached(false), m_bMouseSapEnabled(false), m_pMMSapEvents(0)
// ----------------------------------------------------------------------------
{
       //ctor

oBFusCATed

As far as I can see the patch is broken, also please use nullptr instead of 0 for pointers.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

tomjnx

Quote from: oBFusCATed on January 05, 2013, 06:42:30 PM
As far as I can see the patch is broken, also please use nullptr instead of 0 for pointers.

Ok, fixed. Also, this patch is probably too trivial to apply it using patch 8-)

diff --git a/src/plugins/contrib/MouseSap/MouseSap.cpp b/src/plugins/contrib/MouseSap/MouseSap.cpp
index e611f18..77bde4d 100644
--- a/src/plugins/contrib/MouseSap/MouseSap.cpp
+++ b/src/plugins/contrib/MouseSap/MouseSap.cpp
@@ -64,6 +64,7 @@ MouseSap* MouseSap::pMouseSap;

// ----------------------------------------------------------------------------
MouseSap::MouseSap()
+     : m_pMyLog(nullptr), m_bEditorsAttached(false), m_bMouseSapEnabled(false), m_pMMSapEvents(nullptr)
// ----------------------------------------------------------------------------
{
        //ctor

oBFusCATed

In SVN...

BTW: How long does it take to ryn cb under valgrind?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

tomjnx

Quote from: oBFusCATed on January 05, 2013, 07:05:54 PM
BTW: How long does it take to ryn cb under valgrind?

Thanks a lot!

It takes approximately 90 seconds from invocation to display the main window on an:
Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz
(with core plugins installed only)

Afterwards, editing is noticeably slower, but bearable for bug hunting...

oBFusCATed

Is this with optimized or debug builds?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

tomjnx

With
-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4  -m64 -mtune=generic
on Linux