United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6725821 Compiler warnings in medialib code
JDK-6725821 : Compiler warnings in medialib code

Details
Type:
Bug
Submit Date:
2008-07-15
Status:
Closed
Updated Date:
2011-05-18
Project Name:
JDK
Resolved Date:
2011-05-18
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:

Related Reports
Relates:

Sub Tasks

Description
From jdk7 build logs:

"../../../../src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c", line 1045: warning: pointer arithmetic overflow detected
"../../../../src/share/native/sun/awt/medialib/mlib_ImageLookUp_64.c", line 564: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 172: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 223: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 224: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 274: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 275: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 276: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 277: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 466: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 467: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32S16Func.c", line 468: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 173: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 225: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 226: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 277: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 278: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 279: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 280: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 470: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 471: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpS32U16Func.c", line 472: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 148: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 149: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 223: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 224: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 271: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 272: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 273: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 382: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 383: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 384: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 428: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 429: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 430: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 431: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 482: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 483: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 484: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 485: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 546: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 547: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 548: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 549: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 609: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 610: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 611: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 612: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 670: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 671: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 672: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 84: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32S16Func.c", line 85: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 148: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 149: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 223: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 224: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 271: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 272: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 273: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 382: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 383: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 384: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 428: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 429: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 430: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 431: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 482: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 483: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 484: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 485: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 546: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 547: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 548: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 549: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 609: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 610: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 611: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 612: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 670: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 671: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 672: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 84: warning: pointer arithmetic overflow detected
"../../../../src/solaris/native/sun/awt/medialib/mlib_v_ImageLookUpSIS32U16Func.c", line 85: warning: pointer arithmetic overflow detected

                                    

Comments
EVALUATION

We can use variables instead of literals in order to avoid these warnings.

 This fix eliminates compiler (SS12) warnings in the medilaib on 32bit solaris.
 Note that this just cheats the compiler but makes no actual change in the code
 logic (although the code in question is really doubtful).

 The warnings are causes by huge (close to INT_MAX) offsets in lookup tables,
 which are used in routines related to processing images with signed data types
 (namely signed int32). In order to be able to use negative samples as a index
 in lookup table, medialib code shifts zero index to -INT_MIN position.
 Note that this shift presumes that we are able to allocate a lookup table of
 appropriate size (UINT_MAX), what seems to be impossible on 32bit platform.
 There is no any check for lookup table boundaries, that makes this code even
 more suspicious.

 Note although, that due to gluecode limitations, this code can not be reached:
 we never produce medialib images with data type mlib_s32. Real fix for this
 problem could be a total gluecode reworking (in order to be able to utilize
 all capabilities of medilib) and elimination of unused part of the library.
 However, such change is much more risky.

 Small additional change in makefile just eliminates following warning from
 linker on windows platform:

LINK : warning LNK4044: unrecognized option '/ldl'; ignored
                                     
2010-10-15
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/java2d_data/7/6725821.0

http://hg.openjdk.java.net/jdk7/2d/jdk/rev/4a50631c9910
                                     
2010-10-15



Hardware and Software, Engineered to Work Together