[prev in list] [next in list] [prev in thread] [next in thread]
List: kwin
Subject: Re: Review Request 107603: some stashed changes I want to share
From: Thomas_Lübking <thomas.luebking () gmail ! com>
Date: 2013-04-15 7:11:03
Message-ID: 20130415071103.366.6952 () vidsolbach ! de
[Download RAW message or body]
[Attachment #2 (multipart/alternative)]
> On April 15, 2013, 6:59 a.m., Martin Gräßlin wrote:
> > kwin/libkwineffects/anidata.cpp, line 79
> > <http://git.reviewboard.kde.org/r/107603/diff/1/?file=97339#file97339line79>
> >
> > @Thomas: is here really an assignment intended.
yupp. though looking at the code from a review, forced_align could be initialized \
like this. the most important thing is to catch the failed conversion in the second \
branch - could be an extra line as wel ;-)
functionally everything's ok, so any refactor should keep the behavior.
- Thomas
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/107603/#review31057
-----------------------------------------------------------
On Dec. 6, 2012, 11:56 a.m., Jaime Torres Amate wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/107603/
> -----------------------------------------------------------
>
> (Updated Dec. 6, 2012, 11:56 a.m.)
>
>
> Review request for kwin.
>
>
> Description
> -------
>
> * Avoid two initializations (one is enough and faster)
> * Delete m_compositor after doing other cleanups. Avoid a valgrind read-error \
> reading a deleted value when doing valgrind --log-file=kwin.log kwin --replace, \
> wait until all the windows get a border... in another konsole \
> launch kwin --replace
> * Initialize a member pointer
> * place the parenthesis in the right position to check if floats.count()<2 after \
> assigning the result to forced_align
>
> Diffs
> -----
>
> kwin/events.cpp 281f9e7
> kwin/kcmkwin/kwindesktop/desktopnameswidget.cpp 34e5e23
> kwin/libkwineffects/anidata.cpp f1a07d4
> kwin/workspace.cpp f80649d
>
> Diff: http://git.reviewboard.kde.org/r/107603/diff/
>
>
> Testing
> -------
>
> The valgrind read-error:
> Before:
> ==19359== Invalid read of size 8
> ==19359== at 0x4EF19AE: KWin::Toplevel::compositing() const (composite.cpp:934)
> ==19359== by 0x4EF2E08: KWin::Toplevel::addWorkspaceRepaint(QRect const&) \
> (composite.cpp:1104) ==19359== by 0x4E96B29: KWin::Client::releaseWindow(bool) \
> (client.cpp:269) ==19359== by 0x4E7F2E8: KWin::Workspace::~Workspace() \
> (workspace.cpp:530) ==19359== by 0x4E7F768: KWin::Workspace::~Workspace() \
> (workspace.cpp:564) ==19359== by 0x4EA9060: KWin::Application::lostSelection() \
> (main.cpp:354) ==19359== by 0xA6C695E: QMetaObject::activate(QObject*, \
> QMetaObject const*, int, void**) (qobject.cpp:3543) ==19359== by 0x993DCA6: \
> KSelectionOwner::filterEvent(_XEvent*) (kmanagerselection.cpp:224) ==19359== by \
> 0x98D60A4: KApplication::x11EventFilter(_XEvent*) (kapplication.cpp:930) ==19359== \
> by 0xAF0B4D3: qt_x11EventFilter(_XEvent*) (qapplication_x11.cpp:435) ==19359== \
> by 0xAF1A412: QApplication::x11ProcessEvent(_XEvent*) (qapplication_x11.cpp:3351) \
> ==19359== by 0xAF42CC6: \
> QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
> (qeventdispatcher_x11.cpp:132) ==19359== Address 0x1e08f5c0 is 224 bytes inside a \
> block of size 232 free'd ==19359== at 0x4C2AA9C: operator delete(void*) (in \
> /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==19359== by 0x4E7F26F: \
> KWin::Workspace::~Workspace() (workspace.cpp:517) ==19359== by 0x4E7F768: \
> KWin::Workspace::~Workspace() (workspace.cpp:564) ==19359== by 0x4EA9060: \
> KWin::Application::lostSelection() (main.cpp:354) ==19359== by 0xA6C695E: \
> QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3543) \
> ==19359== by 0x993DCA6: KSelectionOwner::filterEvent(_XEvent*) \
> (kmanagerselection.cpp:224) ==19359== by 0x98D60A4: \
> KApplication::x11EventFilter(_XEvent*) (kapplication.cpp:930) ==19359== by \
> 0xAF0B4D3: qt_x11EventFilter(_XEvent*) (qapplication_x11.cpp:435) ==19359== by \
> 0xAF1A412: QApplication::x11ProcessEvent(_XEvent*) (qapplication_x11.cpp:3351) \
> ==19359== by 0xAF42CC6: \
> QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
> (qeventdispatcher_x11.cpp:132) ==19359== by 0xA6AD72E: \
> QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
> (qeventloop.cpp:149) ==19359== by 0xA6AD9E7: \
> QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (qeventloop.cpp:204)
> After... gone.
> I've been using the changed kwin almost a month.
>
>
> Thanks,
>
> Jaime Torres Amate
>
>
[Attachment #5 (text/html)]
<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 \
solid;"> <tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="http://git.reviewboard.kde.org/r/107603/">http://git.reviewboard.kde.org/r/107603/</a>
</td>
</tr>
</table>
<br />
<blockquote style="margin-left: 1em; border-left: 2px solid #d0d0d0; padding-left: \
10px;"> <p style="margin-top: 0;">On April 15th, 2013, 6:59 a.m. UTC, <b>Martin \
Gräßlin</b> wrote:</p> <blockquote style="margin-left: 1em; border-left: 2px solid \
#d0d0d0; padding-left: 10px;">
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; \
border-collapse: collapse; margin: 2px padding: 2px;"> <thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; \
font-size: 9pt; padding: 4px 8px; text-align: left;"> <a \
href="http://git.reviewboard.kde.org/r/107603/diff/1/?file=97339#file97339line79" \
style="color: black; font-weight: bold; text-decoration: \
underline;">kwin/libkwineffects/anidata.cpp</a> <span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static \
FPx2 fpx2(const QString &s, AnimationEffect::Attribute a)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">79</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> \
<span class="p"><span class="hl">(</span>(</span><span class="n">forced_align</span> \
<span class="o">=</span> <span class="n">floats</span><span class="p">.</span><span \
class="n">count</span><span class="p">()</span> <span class="o"><</span> <span \
class="mi">2</span><span class="p">))</span></pre></td> <th bgcolor="#e9eaa8" \
style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" \
align="right"><font size="2">79</font></th> <td bgcolor="#fdfebc" width="50%"><pre \
style="font-size: 8pt; line-height: 140%; margin: 0; "> <span class="k">if</span> \
<span class="p">(</span><span class="n">forced_align</span> <span class="o">=</span> \
<span class="p"><span class="hl">(</span></span><span class="n">floats</span><span \
class="p">.</span><span class="n">count</span><span class="p">()</span> <span \
class="o"><</span> <span class="mi">2</span><span class="p">))</span></pre></td> \
</tr>
</tbody>
</table>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: \
-pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">@Thomas: is here really \
an assignment intended.</pre> </blockquote>
</blockquote>
<pre style="margin-left: 1em; white-space: pre-wrap; white-space: -moz-pre-wrap; \
white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">yupp. \
though looking at the code from a review, forced_align could be initialized like \
this. the most important thing is to catch the failed conversion in the second branch \
- could be an extra line as wel ;-)
functionally everything's ok, so any refactor should keep the behavior.</pre>
<br />
<p>- Thomas</p>
<br />
<p>On December 6th, 2012, 11:56 a.m. UTC, Jaime Torres Amate wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" \
style="background-image: \
url('http://git.reviewboard.kde.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); \
background-position: left top; background-repeat: repeat-x; border: 1px black \
solid;"> <tr>
<td>
<div>Review request for kwin.</div>
<div>By Jaime Torres Amate.</div>
<p style="color: grey;"><i>Updated Dec. 6, 2012, 11:56 a.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" \
style="border: 1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">* Avoid two initializations (one is enough and faster)
* Delete m_compositor after doing other cleanups. Avoid a valgrind read-error reading \
a deleted value when doing valgrind --log-file=kwin.log kwin --replace, wait until \
all the windows get a border... in another konsole launch kwin \
--replace
* Initialize a member pointer
* place the parenthesis in the right position to check if floats.count()<2 after \
assigning the result to forced_align</pre> </td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: \
1px solid #b8b5a0"> <tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: \
-moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: \
break-word;">The valgrind read-error: Before:
==19359== Invalid read of size 8
==19359== at 0x4EF19AE: KWin::Toplevel::compositing() const (composite.cpp:934)
==19359== by 0x4EF2E08: KWin::Toplevel::addWorkspaceRepaint(QRect const&) \
(composite.cpp:1104) ==19359== by 0x4E96B29: KWin::Client::releaseWindow(bool) \
(client.cpp:269) ==19359== by 0x4E7F2E8: KWin::Workspace::~Workspace() \
(workspace.cpp:530) ==19359== by 0x4E7F768: KWin::Workspace::~Workspace() \
(workspace.cpp:564) ==19359== by 0x4EA9060: KWin::Application::lostSelection() \
(main.cpp:354) ==19359== by 0xA6C695E: QMetaObject::activate(QObject*, QMetaObject \
const*, int, void**) (qobject.cpp:3543) ==19359== by 0x993DCA6: \
KSelectionOwner::filterEvent(_XEvent*) (kmanagerselection.cpp:224) ==19359== by \
0x98D60A4: KApplication::x11EventFilter(_XEvent*) (kapplication.cpp:930) ==19359== \
by 0xAF0B4D3: qt_x11EventFilter(_XEvent*) (qapplication_x11.cpp:435) ==19359== by \
0xAF1A412: QApplication::x11ProcessEvent(_XEvent*) (qapplication_x11.cpp:3351) \
==19359== by 0xAF42CC6: \
QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
(qeventdispatcher_x11.cpp:132) ==19359== Address 0x1e08f5c0 is 224 bytes inside a \
block of size 232 free'd ==19359== at 0x4C2AA9C: operator delete(void*) (in \
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so) ==19359== by 0x4E7F26F: \
KWin::Workspace::~Workspace() (workspace.cpp:517) ==19359== by 0x4E7F768: \
KWin::Workspace::~Workspace() (workspace.cpp:564) ==19359== by 0x4EA9060: \
KWin::Application::lostSelection() (main.cpp:354) ==19359== by 0xA6C695E: \
QMetaObject::activate(QObject*, QMetaObject const*, int, void**) (qobject.cpp:3543) \
==19359== by 0x993DCA6: KSelectionOwner::filterEvent(_XEvent*) \
(kmanagerselection.cpp:224) ==19359== by 0x98D60A4: \
KApplication::x11EventFilter(_XEvent*) (kapplication.cpp:930) ==19359== by \
0xAF0B4D3: qt_x11EventFilter(_XEvent*) (qapplication_x11.cpp:435) ==19359== by \
0xAF1A412: QApplication::x11ProcessEvent(_XEvent*) (qapplication_x11.cpp:3351) \
==19359== by 0xAF42CC6: \
QEventDispatcherX11::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
(qeventdispatcher_x11.cpp:132) ==19359== by 0xA6AD72E: \
QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) \
(qeventloop.cpp:149) ==19359== by 0xA6AD9E7: \
QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) (qeventloop.cpp:204)
After... gone.
I've been using the changed kwin almost a month.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>kwin/events.cpp <span style="color: grey">(281f9e7)</span></li>
<li>kwin/kcmkwin/kwindesktop/desktopnameswidget.cpp <span style="color: \
grey">(34e5e23)</span></li>
<li>kwin/libkwineffects/anidata.cpp <span style="color: grey">(f1a07d4)</span></li>
<li>kwin/workspace.cpp <span style="color: grey">(f80649d)</span></li>
</ul>
<p><a href="http://git.reviewboard.kde.org/r/107603/diff/" style="margin-left: \
3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>
_______________________________________________
kwin mailing list
kwin@kde.org
https://mail.kde.org/mailman/listinfo/kwin
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic