home clear 64x64
en blue 200x116 de orange 200x116 info letter User
suche 36x36
Latest versionsfixlist
11.1.0.7 FixList
10.5.0.9 FixList
10.1.0.6 FixList
9.8.0.5 FixList
9.7.0.11 FixList
9.5.0.10 FixList
9.1.0.12 FixList
Have problems? - contact us.
Register for free anmeldung-x26
Contact form kontakt-x26

DB2 - Problem description

Problem IC70308 Status: Closed

CALLING API THAT USES SQLB_TBSPQRY_DATA RESULTS IN MEMORY CORRUPTION IN 9.7

product:
DB2 FOR LUW / DB2FORLUW / 970 - DB2
Problem description:
Calling an API that uses the SQLB_TBSPQRY_DATA structure, for 
example sqlbftpq(), results in memory corruption in the 
application's address space. This problem only happens for 
applications compiled on DB2 UDB releases older than 9.7. The 
reason for this behaviour is the fact that on 9.7, 
SQLB_TBSPQRY_DATA is four bytes longer than what it 
used to be before 9.7. 
 
Excerpt from struct SQLB_TBSPQRY_DATA before 9.7: 
0x00000000000000B0    char                lifeLSN[6] 
0x00000000000000B6    char                pad[2] 
 
Excerpt from struct SQLB_TBSPQRY_DATA in 9.7: 
0x00000000000000B0    sqluint64           lifeLSN 
 
In other words, in the pre-97versions lifeLSN used to be a six 
byte character followed by a two byte padding. In 9.7 lifeLSN 
has become an sqluint64 whose total size is eight bytes. 
 
Despite the equal byte length, the new sqluint64 requires 
a 4 byte internal alignment which is implicitly added by the 
C compiler, hence the overall size of the 
SQLB_TBSPQRY_DATA structure is four bytes larger.
Problem Summary:
**************************************************************** 
* USERS AFFECTED:                                              * 
* All users on DB2 v9.7 Fix Pack 3 and below                   * 
**************************************************************** 
* PROBLEM DESCRIPTION:                                         * 
* Calling an API that uses the SQLB_TBSPQRY_DATA structure,    * 
* for                                                          * 
* example sqlbftpq(), results in memory corruption in the      * 
*                                                              * 
* application's address space. This problem only happens for   * 
*                                                              * 
* applications compiled on DB2 UDB releases older than 9.7.    * 
* The                                                          * 
* reason for this behaviour is the fact that on 9.7,           * 
*                                                              * 
* SQLB_TBSPQRY_DATA is four bytes longer than what it          * 
*                                                              * 
* used to be before 9.7.                                       * 
*                                                              * 
*                                                              * 
*                                                              * 
* Excerpt from struct SQLB_TBSPQRY_DATA before 9.7:            * 
*                                                              * 
* 0x00000000000000B0    char                lifeLSN[6]         * 
*                                                              * 
* 0x00000000000000B6    char                pad[2]             * 
*                                                              * 
*                                                              * 
*                                                              * 
* Excerpt from struct SQLB_TBSPQRY_DATA in 9.7:                * 
*                                                              * 
* 0x00000000000000B0    sqluint64          lifeLSN             * 
*                                                              * 
*                                                              * 
*                                                              * 
* In other words, in the pre-97versions lifeLSN used to be a   * 
* six                                                          * 
* byte character followed by a two byte padding. In 9.7        * 
* lifeLSN                                                      * 
* has become an sqluint64 whose total size is eight bytes.     * 
*                                                              * 
*                                                              * 
*                                                              * 
* Despite the equal byte length, the new sqluint64 requires    * 
*                                                              * 
* a 4 byte internal alignment which is implicitly added by the * 
*                                                              * 
* C compiler, hence the overall size of the                    * 
*                                                              * 
* SQLB_TBSPQRY_DATA structure is four bytes larger.            * 
**************************************************************** 
* RECOMMENDATION:                                              * 
* Upgrade to DB2 V9.7 Fix Pack 4                               * 
****************************************************************
Local Fix:
Recompile the old applications on DB2 UDB 9.7.
available fix packs:
DB2 Version 9.7 Fix Pack 4 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 5 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 6 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 7 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 8 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9 for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 9a for Linux, UNIX, and Windows
DB2 Version 9.7 Fix Pack 10 for Linux, UNIX, and Windows

Solution
Problem firest fixed in DB2 V9.7 Fix Pack 4
Workaround
not known / see Local fix
Timestamps
Date  - problem reported    :
Date  - problem closed      :
Date  - last modified       :
30.07.2010
02.05.2011
02.05.2011
Problem solved at the following versions (IBM BugInfos)
9.7.FP4
Problem solved according to the fixlist(s) of the following version(s)
9.7.0.4 FixList