Report 1868 Actions
Problem Report Number |
1868 |
Submitter's Classification |
Test Suite problem |
State |
Resolved |
Resolution |
Rejected (REJ) |
Problem Resolution ID |
REJ.X.0555 |
Raised |
2001-10-02 08:00 |
Updated |
2003-03-13 08:00 |
Published |
null |
Product Standard |
Window System Application Interface V2 |
Certification Program |
The Open Brand certification program |
Test Suite |
VSW version 5.1.2 |
Test Identification |
Xlib5/XGetWindowProperty 4, 5 |
Problem Summary |
PG4W.00106 This IR claims that 32-bit data should not be passed to XChangeProperty() in a long array on systems with 64-bit long. |
Problem Text |
All affected test cases are;
Xlib5/XChangeProperty 1 Xlib5/XChangeProperty 2 Xlib5/XChangeProperty 3 Xlib5/XChangeProperty 4 Xlib5/XChangeProperty 5 Xlib5/XChangeProperty 6 Xlib5/XGetWindowProperty 4 Xlib5/XGetWindowProperty 5 Xlib5/XRotateWindowProperties 1 Xlib5/XRotateWindowProperties 2 Xlib5/XRotateWindowProperties 3 Xlib5/XRotateWindowProperties 4 Xlib5/XRotateWindowProperties 5 Xlib14/XmbSetWMProperties 2 Xlib15/XGetIconSizes 1 Xlib15/XGetRGBColormaps 1 Xlib15/XGetTransientForHint 1 Xlib15/XGetWMColormapWindows 1 Xlib15/XGetWMHints 1 Xlib15/XGetWMNormalHints 1 Xlib15/XGetWMProtocols 1 Xlib15/XGetWMSizeHints 1 Xlib15/XSetIconSizes 1 Xlib15/XSetRGBColormaps 1 Xlib15/XSetTransientForHint 1 Xlib15/XSetWMColormapWindows 1 Xlib15/XSetWMHints 1 Xlib15/XSetWMNormalHints 1 Xlib15/XSetWMProperties 4 Xlib15/XSetWMProperties 5 Xlib15/XSetWMProtocols 1 Xlib15/XSetWMSizeHints 1 Xt13/XtSetWMColormapWindows 1
For a 64bit OS, where long is 64bits, passing long data with 32bit format to XChangeProperty shouldn't work. The testcases pass long type data to XChangeProperty, with format as 32.
A bug in our XChangeProperty actually allowed this to be ok, and all the above tests were passing. XChangeProperty was passing (int *) data to _XCard32 instead of (long *). The bug caused some 64bit programs to crash. A bugfix has just been implemented into XChangeProperty for this, but the test cases above now fail. All of these functions use XChangeProperty.
In /tset/Xlib5/gtwdwprprt/Test.c, changing unsigned long idata[4]; to unsigned int idata[4];
the test will pass. There is also a note in gtwdwprprt.m .... "Unsigned longs _must_ be 32 bits, or this won't work..." So what is supposed to happen with 64bits ?
VSM4 tests fail too. Separate waiver request to be submitted.
|
Test Output |
Sample Journal Output; 10|802 /tset/Xlib5/gtwdwprprt/Test 19:33:54|TC Start, scenario ref 540-0 . . 520|802 4 00014782 1 1|VSW5TESTSUITE PURPOSE 4 520|802 4 00014782 1 2|Assertion XGetWindowProperty-4.(A) 520|802 4 00014782 1 3|When the specified property exists for the specified wind ow 520|802 4 00014782 1 4|w, req_type is set to the type of the property or 520|802 4 00014782 1 5|AnyPropertyType, and delete is set to False, then a call 520|802 4 00014782 1 6|to XGetWindowProperty returns the actual property type to 520|802 4 00014782 1 7|actual_type_return, the actual property format to 520|802 4 00014782 1 8|actual_format_return, the number of trailing unread bytes 520|802 4 00014782 1 9|in the property in bytes_after_return, the number of 520|802 4 00014782 1 10|8/16/32 bit items in nitems_return, the data is placed i n 520|802 4 00014782 1 11|prop_return, where the data is sourced from four times 520|802 4 00014782 1 12|long_offset bytes into the property, and is the minimum of 520|802 4 00014782 1 13|the remaining bytes left in the property and four times 520|802 4 00014782 1 14|long_length bytes long, and the property is not deleted. 520|802 4 00014782 1 15|METH: Create a window with testable properties. 520|802 4 00014782 1 16|METH: For req_type is the required type and AnyPropertyT ype: 520|802 4 00014782 1 17|METH: Call XGetWindowProperty to obtain the property i nformation of a STRING property, 520|802 4 00014782 1 18|METH: with delete False. 520|802 4 00014782 1 18|METH: with delete False. 520|802 4 00014782 1 19|METH: Verify that the returned values were correct. 520|802 4 00014782 1 20|METH: Verify that no PropertyNotify events were genera ted. 520|802 4 00014782 1 21|METH: Call XGetWindowProperty to obtain the property i nformation of an INTEGER property, 520|802 4 00014782 1 22|METH: with delete False. 520|802 4 00014782 1 23|METH: Verify that the returned values were correct. 520|802 4 00014782 1 24|METH: Verify that no PropertyNotify events were genera ted. 520|802 4 00014782 1 25|REPORT: XGetWindowProperty returned an unexpected prop_r eturn 520|802 4 00014782 1 26|REPORT: Expected prop_return: 1 520|802 4 00014782 1 27|REPORT: Returned prop_return: 0 520|802 4 00014782 1 28|REPORT: XGetWindowProperty returned an unexpected prop_r eturn 520|802 4 00014782 1 29|REPORT: Expected prop_return: 1 520|802 4 00014782 1 30|REPORT: Returned prop_return: 0 220|802 4 1 19:34:00|FAIL 410|802 4 1 19:34:00|IC End 400|802 5 1 19:34:00|IC Start 200|802 5 19:34:00|TP Start 520|802 5 00014782 1 1|VSW5TESTSUITE PURPOSE 5 520|802 5 00014782 1 2|Assertion XGetWindowProperty-5.(A) 520|802 5 00014782 1 3|When the specified property exists for the specified wind ow 520|802 5 00014782 1 4|w, req_type is set to the type of the property or 520|802 5 00014782 1 5|AnyPropertyType, and delete is set to True, and on a call 520|802 5 00014782 1 6|to XGetWindowProperty the number of unread bytes in the 520|802 5 00014782 1 7|property returned to bytes_after_return is non-zero, then 520|802 5 00014782 1 8|the actual property type is returned to actual_type_retur n, 520|802 5 00014782 1 9|the actual property format to actual_format_return, the 520|802 5 00014782 1 10|number of trailing unread bytes in the property in 520|802 5 00014782 1 11|bytes_after_return, the number of 8/16/32 bit items in 520|802 5 00014782 1 12|nitems_return, the data is placed in prop_return, where 520|802 5 00014782 1 13|the data is sourced from four times long_offset bytes in to 520|802 5 00014782 1 14|the property, and is the minimum of the remaining bytes 520|802 5 00014782 1 15|left in the property and four times long_length bytes lo ng, 520|802 5 00014782 1 16|and the property is not deleted. 520|802 5 00014782 1 17|METH: Create a window with testable properties. 520|802 5 00014782 1 18|METH: For req_type is the required type and AnyPropertyT ype:
520|802 5 00014782 1 19|METH: Call XGetWindowProperty to obtain the property i nformation of a STRING property, 520|802 5 00014782 1 20|METH: with delete True. 520|802 5 00014782 1 21|METH: Verify that the returned values were correct. 520|802 5 00014782 1 22|METH: Verify that no PropertyNotify events were genera ted. 520|802 5 00014782 1 23|METH: Call XGetWindowProperty to obtain the property i nformation of an INTEGER property, 520|802 5 00014782 1 24|METH: with delete True. 520|802 5 00014782 1 25|METH: Verify that the returned values were correct. 520|802 5 00014782 1 26|METH: Verify that no PropertyNotify events were genera ted. 520|802 5 00014782 1 27|REPORT: XGetWindowProperty returned an unexpected prop_r eturn 520|802 5 00014782 1 28|REPORT: Expected prop_return: 1 520|802 5 00014782 1 29|REPORT: Returned prop_return: 0 520|802 5 00014782 1 30|REPORT: XGetWindowProperty returned an unexpected prop_r eturn 520|802 5 00014782 1 31|REPORT: Expected prop_return: 1 520|802 5 00014782 1 32|REPORT: Returned prop_return: 0 220|802 5 1 19:34:00|FAIL 410|802 5 1 19:34:00|IC End
10|781 /tset/Xlib5/chngprprty/Test 19:32:29|TC Start, scenario ref 526-0 15|781 3.1-lite 13|TCM Start 400|781 1 1 19:32:34|IC Start 200|781 1 19:32:34|TP Start 520|781 1 00014437 1 1|VSW5TESTSUITE PURPOSE 1 520|781 1 00014437 1 2|Assertion XChangeProperty-1.(A) 520|781 1 00014437 1 3|A call to XChangeProperty alters the property for the 520|781 1 00014437 1 4|specified window w and generates a PropertyNotify event o n 520|781 1 00014437 1 5|that window. 520|781 1 00014437 1 6|METH: Create a window without properties and with Propert yChangeMask events selected. 520|781 1 00014437 1 7|METH: Call XChangeProperty to replace a property value. 520|781 1 00014437 1 8|METH: Verify that a PropertyNotify event occurred. 520|781 1 00014437 1 9|METH: Verify that the property was updated as expected. 520|781 1 00014437 1 10|REPORT: XChangeProperty did not assign the property valu e 520|781 1 00014437 1 11|REPORT: as expected 520|781 1 00014437 1 12|REPORT: Expected value: 2 520|781 1 00014437 1 13|REPORT: Returned value: 0 220|781 1 1 19:32:34|FAIL
|
Review Information
Review Type |
TSMA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Recommendation |
No Resolution Given |
Review Response |
The current test code is correct. Even if long is 64-bit, data passed to XChangeProperty() with format 32 must be contained in an array of longs. The text stating this seems to be missing from the X11R5 Xlib specification but has been reinstated in the X11R6 version of the spec:
"If the specified format is 8, the property data must be a char array. If the specified format is 16, the property data must be a short array. If the specified format is 32, the property data must be a long array."
(I checked draft 8 of the spec, but I assume the text is still there in the final version. It is also in the man page at http://www.x.org/consortium/R6doc/man/X11/XGetWindowProperty).
Note also that the tests pass on other systems with 64-bit longs.
The comment in gtwdwprprt.m is presumably a hang-over from the days before X11 was ported to the first 64-bit systems, when it was unclear whether the calling convention for XChangeProperty() and XGetWindowProperty() would be changed. The comment will be corrected in the next VSW release.
It is recommended that this request is refused.
|
Review Type |
SA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
The Open Group observes that the X11R6 specification clarifies the behavior here for this interface addressing 64 bit systems, supporting the consultants response. However since the normative specification for the Product Standard is X11R5 we would request an expert group review of this issue.
|
Review Type |
Expert Group Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
No Resolution Given |
Review Conclusion |
The X.Org Standards review group has discussed this. With little or no debate, the group agreed that the consultant is correct, and that this request should be refused.
While it could be seen as confusing, "XChangeProperty" should be passed an array of "long's" when format is 32 (even though a long may be 64 bits).
|
Review Type |
SA Review |
Start Date |
null |
Completed |
null |
Status |
Complete |
Review Resolution |
Rejected (REJ) |
Review Conclusion |
This request is refused.
|
Problem Reporting System Options:
|