|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1801 Details
Show help | Quick Search | Submit a Test Suite Support Request | Click here to view your privileges
This page provides all information on Problem Report 1801.
Report 1801 Actions
Problem Report Number 1801 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0878 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1998-04-15 08:00 Product Standard Window System Application Interface V2 Certification Program The Open Brand certification program Test Suite VSW version 5.0.0 Test Identification XtC/XtAppAddConverter 2 Problem Summary TSD4W.00148 This test may fail as the to_in_out" argument to XtConvertAndStore() is not initialized. Problem Text
We believe this failure is due to a fault in the test suite, and request
that a waiver be granted. The pointer "to_in_out.addr" in the test
purpose below is never initialized but "to_in_out" is passed to the
function XtConvertAndStore() where "to_in_out.addr" is referenced.
Since "to_in_out.addr" contains an invalid address the function
XtConvertAndStore() fails. Immediately afterwards the value
"*to_in_out.addr" is passed to the function check_char().
Since "to_in_out.addr" contains an invalid address then
"*to_in_out.addr" causes a SIGSEGV.
Section "9.6.5" of the "X Toolkit Intrinsics - C Language Interface"
states:
"The 'to_in_out' argument specifies the size and location into which
the converted value will be stored and is passed directly to the
converter. If the location is specified as NULL, it will be replaced
with a pointer to private storage and the size will be returned in
the descriptor. The caller is expected to copy this private storage
immediately and must not modify it in any way. If a non-NULL location
is specified, the caller must allocate sufficient storage to hold the
converted value and must also specify the size of that storage in the
descriptor."
The test suite failed to set the location (i.e. to_in_out.addr) to
NULL or specify a valid address.
If "to_in_out.addr" is initialized to NULL then the test passes.
---------------------------------------------------------
FILE: X11/Xresource.h
typedef struct {
unsigned int size;
XPointer addr; <-- "addr" is a pointer.
} XrmValue, *XrmValuePtr;
---------------------------------------------------------
FILE: $TET_ROOT/vsw5/tset/XtC/tapadconv/Test.c
static void t002(){
Display *display_good;
XrmValue from;
XrmValue to_in_out; <-- "to_in_out" declared here.
XtCacheRef cache_ref_return;
int status;
pid_t pid2;
pid_t pid;
report_purpose(2);
report_assertion("Assertion XtAppAddConverter-2.(A)");
report_assertion("When more than one converter is registered for
the same
");
report_assertion("from_type and to_type by multiple calls to void");
report_assertion("XtAppAddConverter(app_context, from_type, to_type,");
report_assertion("converter, convert_args, num_args) the most recently");
report_assertion("registered converter shall override the
previous ones."
);
avs_alloc_sem();
FORK(pid);
initconfig();
FORK(pid2);
avs_set_event(1, 0);
avs_set_event(2, 0);
avs_xt_hier("Tapadconv1", "XtAppAddConverter");
tet_infoline("PREP: Create windows for widgets and map them");
XtRealizeWidget(topLevel);
tet_infoline("TEST: Register resource converter XtCVT_Proc2");
XtAppAddConverter(app_ctext,
XtRString,
XavsRChar,
XtCVT_Proc2,
(XtConvertArgList)NULL,
(Cardinal)0);
tet_infoline("TEST: Register XtCVT_Proc for same conversion");
XtAppAddConverter(app_ctext,
XtRString,
XavsRChar,
XtCVT_Proc,
(XtConvertArgList)NULL,
(Cardinal)0);
tet_infoline("TEST: Invoke conversion");
from.addr = (XtPointer) "Hello"
from.size = sizeof(unsigned char);
/*
* RETURN VALUE NOT CHECKED.
*/
XtConvertAndStore(
topLevel,
XtRString,
&from,
XavsRChar,
&to_in_out); <-- "to_in_out" passed here.
tet_infoline("TEST: Converted results");
/*
* THE SIGSEGV OCCURS HERE BECAUSE WE ARE TRYING TO ACCESS
* "*to_in_out.addr" WHICH DOES NOT CONTAIN A VALID ADDRESS.
*/
check_char('H', *(char *)to_in_out.addr, "conversion result");
.
.
.
}
-------------------------------------------------------
FILE: Xt/Convert.c
Boolean XtConvertAndStore(object, from_type_str, from, to_type_str, to)
Widget object;
String from_type_str;
XrmValuePtr from;
String to_type_str;
XrmValuePtr to;
{
.
.
.
Boolean local = False;
do {
/*
* THIS STATEMENT EVALUATES TO FALSE BECAUSE "to->addr"
CONTAINS
* GARBAGE SINCE IT WAS NEVER INITIALIZED.
*/
if (!to->addr) {
if (!local_valueP)
local_valueP = _XtHeapAlloc(&globalHeap,
local_valueS);
to->addr = local_valueP;
to->size = local_valueS;
local = True;
}
if (!_XtConvert(object, from_type, from, to_type, to, &ref))
{
/*
* THIS STATEMENT EVALUATES TO FALSE BECAUSE "local" IS
* STILL "False".
*/
if (local && (to->size > local_valueS)) {
to->addr =
local_valueP = _XtHeapAlloc(&globalHeap,
to->size);
local_valueS = to->size;
continue;
} else {
/*
* THIS STATEMENT EVALUATES TO FALSE BECAUSE "local"
* IS STILL "False".
*/
if (local) {
to->addr = NULL;
to->size = 0;
}
UNLOCK_PROCESS;
UNLOCK_APP(app);
return False;
}
}
}
.
.
.
}Test Output
520|2941 2 9570 1 1|VSW5TESTSUITE PURPOSE 2
520|2941 2 9570 1 2|Assertion XtAppAddConverter-2.(A)
520|2941 2 9570 1 3|When more than one converter is registered for the
same
520|2941 2 9570 1 4|from_type and to_type by multiple calls to void
520|2941 2 9570 1 5|XtAppAddConverter(app_context, from_type, to_type,
520|2941 2 9570 1 6|converter, convert_args, num_args) the most recently
520|2941 2 9570 1 7|registered converter shall override the previous
ones.
520|2941 2 9594 1 1|PREP: Initialize toolkit, Open display and Create
topLevel
root widget
520|2941 2 9594 1 2|PREP: Create windows for widgets and map them
520|2941 2 9594 1 3|TEST: Register resource converter XtCVT_Proc2
520|2941 2 9594 1 4|TEST: Register XtCVT_Proc for same conversion
520|2941 2 9594 1 5|TEST: Invoke conversion
520|2941 2 9594 1 6|TEST: Converted results
520|2941 2 9594 1 7|unexpected signal 11 (SIGSEGV) received
520|2941 2 9604 2 1|TEST: Procedure XtCVT_Proc2 was not invoked
520|2941 2 9604 2 2|TEST: Procedure XtCVT_Proc was invoked
220|2941 2 2 16:16:24|UNRESOLVEDReview Information
Review Type TSMA Review Start Date null Completed null Status Complete Review Recommendation No Resolution Given Review Response
We agree this is a Test Suite Deficiency in the test suite versions listed.
Review Type SA Review Start Date null Completed null Status Complete Review Resolution Test Suite Deficiency (TSD) Review Conclusion
This is an agreed Test Suite Deficiency.
Problem Reporting System Options:
- View Report 1801
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority