[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    kscience -setup Bug on 64bit platforms
From:       Christian Czezatke <e9025461 () student ! tuwien ! ac ! at>
Date:       1998-07-06 14:18:34
[Download RAW message or body]

Hi!

Due to a small typo in "kscreensaver/science.cpp" as it can be found in
the 980705 snapshot of kdebase (version 0.26.5 beta), 
"kscience.kss -setup" dies with a segmentation fault on 64bit platforms
(like Linux/Alpha) as soon as you touch any of the controls that can be
found in the setup dialog. 

Here is the patch:

--------
--- science.cpp.old	Mon Jul  6 15:59:53 1998
+++ science.cpp	Mon Jul  6 16:01:12 1998
@@ -506,7 +506,7 @@
 	buffer = XSubImage( xRootWin, 0, 0, side, side );
         myAssert( buffer != 0, "can't allocate pixmap" );                             
 
-	offset = (T32bit **) malloc( sizeof( T32bit) * side );
+	offset = (T32bit **) malloc( sizeof(T32bit *) * side );
 	myAssert( offset != 0, "too few memory" );
 
 	switch( mode ) {
--------

Explanation: 

32 bit platforms:
  sizeof(T32bit) --> 4 bytes; sizeof(T32bit *) --> 4 bytes
64 bit platforms:
  sizeof(T32bit) --> 4 bytes; sizeof(T32bit *) --> 8 bytes !!!

So you don't notice anything on a 32bit platform.

     Good luck for the KDE 1.0 release... ;-) 

     Christian

--
--------------------------------------------------------------------
| Christian Czezatke, Student of Computer Science at the Vienna    |
| University Of Technology.                                        |
|------------------------------------------------------------------|
| email: e9025461@student.tuwien.ac.at                             |
--------------------------------------------------------------------

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic