Review Request 121481: gdb: defend against use-after-free of breakpoint structures

Milian Wolff mail at milianw.de
Tue Dec 16 11:43:56 UTC 2014



> On Dec. 14, 2014, 12:13 p.m., Milian Wolff wrote:
> > debuggers/gdb/breakpointcontroller.cpp, line 120
> > <https://git.reviewboard.kde.org/r/121481/diff/1/?file=332968#file332968line120>
> >
> >     bkpt was special, and is not, anymore - intentional change? maybe just do
> >     
> >         if (r.hasField("bkpt")) {
> >           controller->update...
> >         } else {
> >           for (auto kind : {"wpt", ...}) {
> >              ...
> >           }
> >         }
> 
> Nicolai Hähnle wrote:
>     bkpt is still special in that update() is only called for bkpt but not for the others. The new code is indeed different in that controller->m_ids now gets assigned in the InsertedHandler also for bkpt; however, note that assigning controller->m_ids to the same value is the first thing that update() does anyway.
>     
>     At the same time, we do need the id for all breakpoint types now in order to be able to send the deletion command. So you either get the redundant assignment of m_ids (which I'm hesistant to remove in update() because that method gets called elsewhere as well; I _think_ it can be removed, but I'm not 100% sure) or you have to duplicate the breakpoint id extraction code. I chose the redundant assignment of m_ids.

ok thanks for the clarification.


- Milian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/121481/#review71962
-----------------------------------------------------------


On Dec. 13, 2014, 8:14 p.m., Nicolai Hähnle wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/121481/
> -----------------------------------------------------------
> 
> (Updated Dec. 13, 2014, 8:14 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevelop
> 
> 
> Description
> -------
> 
> This should prevent the crash observed in https://paste.kde.org/p0vezsuve
> Since I am unable to reproduce that crash, it is unclear whether the scenario
> that lead to the crash is handled completely correctly now.
> 
> 
> Diffs
> -----
> 
>   debuggers/gdb/breakpointcontroller.h e5338f4f497ee0997de637db80c071b565bc9322 
>   debuggers/gdb/breakpointcontroller.cpp a85b441e9622a1b00069e2419d41e1d1d4b20800 
> 
> Diff: https://git.reviewboard.kde.org/r/121481/diff/
> 
> 
> Testing
> -------
> 
> unit tests pass
> 
> 
> Thanks,
> 
> Nicolai Hähnle
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20141216/b9f844b9/attachment-0001.html>


More information about the KDevelop-devel mailing list