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

Michael Pyne mpyne at purinchu.net
Mon May 25 01:37:48 BST 2009


On Sunday 24 May 2009 20:09:23 Christoph Feck wrote:
> Attempts to fix KPixmapCrash, pardon, KPixmapCache. This is my first
> submission to reviewboard to learn how it works (and I already learned that
> you have to retype the Description???).
>
> According to the comments in the (previous) code, there are problems using
> the pointers in the union, so I removed them, and replaced them with a
> single pointer and casts at the appropriate places.
>
>
> This addresses bug 182026.
>     https://bugs.kde.org/show_bug.cgi?id=182026

Well I lost my KWallet and thence my super-secure review board password.  
Luckily for me there is absolutely no way I can find to reset my password so 
I'll resort to good-old-fashioned mailing lists.

I wrote the code in question, including the immortal comment "This probably 
breaks some C++ aliasing rule :-("

Turns out I was right =D

I had actually after writing the comment got myself under the impression that 
the char* memory in the union made type-punning OK but apparently that doesn't 
allow you to actually ever dereference the pointer and expect it to work.  
Weird.

I say ship it

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/20090524/e06fa933/attachment.sig>


More information about the kde-core-devel mailing list