JDK-4784730 : JCK1.4a-runtime api/java_awt/interactive/ScrollbarTests.html#ScrollbarTests fail
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.4.2
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: linux,solaris_8,solaris_9,windows_2000
  • CPU: x86,sparc
  • Submitted: 2002-11-26
  • Updated: 2017-05-16
  • Resolved: 2003-10-31
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availabitlity Release.

To download the current JDK release, click here.
Other
5.0 betaFixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description

Name: icR10030			Date: 11/26/2002


Filed By       : J2SE-SQA [###@###.###
JDK            : JDK1.4.2-b08, JDK1.4.1, JDK1.4.0
JCK            : JCK1.4a-runtime
Platform[s]    : Windows 2000 Pro, Solaris 9 (sparc) (CDE), Solaris 8 (x86), Linux
switch/Mode    : -Xbatch -Xdebug -Xfuture, -server -Xmixed -Xfuture, plugin
JCK test owner : http://javaweb.eng/jck/usr/owners.jto
Falling test[s]:
          api/java_awt/interactive/ScrollbarTests.html#ScrollbarTests [ScrollbarTest0003, ScrollbarTest0004, ScrollbarTest0005, ScrollbarTest0006]

JCK1.4a-runtime api/java_awt/interactive/ScrollbarTests.html#ScrollbarTests test fails on JDK1.4.2-b08
If min/max value of scroll bar is min/max int value the scroll bar does not work as expected.
For example the testcase ScrollbarTest0003 hangs on Linux Redhat 7.3/GNOME.
The bug is reproducible on JDK1.4.2, JDK1.4.1, JDK1.4.0

Test source location:
=====================
/java/re/jck/1.4a/promoted/fcs/binaries/JCK-runtime-14a/tests/api/java_awt/interactive/ScrollbarTests.java

jtr file location:
==================
/net/jtgb4u4c/export/sail16/results/mantis/b08/jck14a/sparc/sol9_sparcatch_smp_novo48/workDir/api-interactive/java_awt/interactive/ScrollbarTests_ScrollbarTests.jtr

How to reproduce:
=================
1. Run the following script (you may need to change its variables)
2. Set scroll bar minimum value -2147483648
3. Press "SET" button.
4. The testcase hangs.

--- script start ---
#!/bin/bash

JCK="/net/linux-15/export/home/java/jck1.4a/JCK-runtime-14a"
JDK="/net/linux-15/export/home/java/jdk1.4.2/linux"
switches="-client -Xfuture"
CLASSPATH="$JCK/classes:$JCK/lib/javatest.jar"

$JDK/bin/java $switches -cp $CLASSPATH javasoft.sqe.tests.api.java.awt.interactive.Scrollbar.ScrollbarTests -TestCaseID ScrollbarTest0003 ScrollbarTest0004 ScrollbarTest0005 ScrollbarTest0006

--- script end ---

Test output:
============
...
...
Warning:
      Name: scrollbar
      Class: XmScrollBar
      The specified slider size is less than 1.

Warning:
      Name: scrollbar
      Class: XmScrollBar
      The specified slider size is less than 1.
...
...

Specific machine info:
======================
Hostname: linux-10
OS: Solaris 8 (x86)
Hostname: linux-2
OS: Windows 2000 Pro
Hostname: novo48
OS: Solaris 9 (sparc) (CDE)



======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: tiger-beta FIXED IN: tiger-beta INTEGRATED IN: tiger-beta VERIFIED IN: tiger-beta
2004-06-14

EVALUATION The source code at this location: /java/re/jck/1.4a/promoted/fcs/binaries/JCK-runtime-14a/tests/api/java_awt/interactive/ScrollbarTests.java does not contain the internal logic of the test. It seems to be setup code only. For example, I couldn't see where the method ScrollbarTest0002() is called. Please provide the full path to the source code that contains the logic of the test. I could not find any file at this location: /net/jtgb4u4c.eng/export/sail15/results/mantis/b08/jck14a/sparc/sol9_sparc_client_batch_debug_novo48/java_awt/interactive/ScrollbarTests_ScrollbarTests.jtr Please provide the correct path to the jtr file. ###@###.### 2002-11-26 looked at motif sources in /net/meatball/cde_builds/UISCE-mws/cdesrc/lib/Xm The message: "The specified slider size is less than 1." is in Messages.c as XmMsgScrollBar_0001 which ScrollBar.c defines as MESSAGE2 So it is probably around line 837 in Initialize() if (new_w->scrollBar.slider_size < 1) { new_w->scrollBar.slider_size = 1; XmeWarning( (Widget) new_w, MESSAGE2); } or more likely around line 1956 in ValidateInputs (which is called from SetValues) since we are already initialized and we are infinite looping. if (new_w->scrollBar.sliding_mode != XmTHERMOMETER) { if (new_w->scrollBar.slider_size < 1) { if ((new_w->scrollBar.maximum - new_w->scrollBar.minimum) < current->scrollBar.slider_size) new_w->scrollBar.slider_size = new_w->scrollBar.maximum - new_w->scrollBar.minimum; else new_w->scrollBar.slider_size = current->scrollBar.slider_size; XmeWarning( (Widget) new_w, MESSAGE2); returnFlag = FALSE; } Obviously, the loop is line 2165 while (!ValidateInputs(current, request, new_w)) /*EMPTY*/; but I don't know why slider_size would be less than 1 My guess: max - min can't be more than Integer.MAX_VALUE perhaps the value of this difference is wrapping, causing us problems. I bet it's around line 1960 - probably an integer overflow in ScrollBarP.h minimum, maximum, value, and slider_size are all integers. When I added 51 to Integer.MIN_VALUE, it worked fine (with max of 50). When I added only 50, infinite loop. Should try on windows to see what happens. Probably ought to follow the swing model, and make sure that the "extent" (maxMinusMin) is <= Integer.MAX_VALUE (and > 0) http://support.microsoft.com/default.aspx?scid=kb;en-us;104311 Microsoft only allows 32 bits for scroll pos http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwui/html/msdn_scroll32.asp see 4679721 for info on MSDN for scrollbars ###@###.### 2002-12-04 We need to change the spec to say that the maximum scrollbar range cannot be greater than Integer.MAX_VALUE. Native widgets don't support greater values, and in general, no other widget set (including swing) does either. We just didn't spec this out well when the Scrollbar class was first written. I'll commit this to Tiger. ###@###.### 2002-12-05 We should revamp the spec and implementation - something like Swing has - in order to prevent ranges greater than Integer.MAX_VALUE. When we do this, we need to clean up areas such as setMinimum, which erroneously says * <p>Note that setting the minimum value to <code>Integer.MIN_VALUE</code> * will result in the new minimum value to be set to * <code>Integer.MIN_VALUE - 1</code>. It was intended to say MAX_VALUE, not MIN_VALUE. However, we'll need to apply some rules and explain them. E.g. minimum may not be larger than Integer.MAX_VALUE - visibleAmount. ###@###.### 2003-04-13
2003-04-13