Review Request: Fix KPixmapCache crash (probably because of pointer aliasing in unions)

Michael Pyne mpyne at purinchu.net
Wed May 27 02:00:26 BST 2009


On Tuesday 26 May 2009 17:39:11 Christoph Feck wrote:
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://reviewboard.kde.org/r/757/#review1211
> -----------------------------------------------------------
>
>
> Can we agree on committing this as an initial fix? The patch only
> eliminates the aliasing, but if this does not fix the problem, I have to
> look elsewhere.
>
> If my patch is wrong I feel the whole class is (it uses reinterpret_cast
> everywhere), and I do not feel like rewriting the whole file, mostly
> because I am not a core expert, and fearing to break it.

If we need a quick fix it is probably better to add -fno-strict-aliasing to the 
CXXFLAGS for kpixmapcache.cpp than to incorrectly remove aliasing.

Basically it is not good enough for the union to have pointers to structs, it 
needs to contain the structs directly.  I'll try to work on a suitable patch 
tonight if noone else does.

Regards,
 - Michael Pyne
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090526/25050339/attachment.sig>


More information about the kde-core-devel mailing list