|
Home About Us A-Z Index Search * Contact Us Register Login Press ShopThe Open Brand -- Problem Reporting and Interpretations System |
Problem Report 1346 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 1346.
Report 1346 Actions
Problem Report Number 1346 Submitter's Classification Test Suite problem State Resolved Resolution Test Suite Deficiency (TSD) Problem Resolution ID TSD.X.0628 Raised 1970-01-01 08:00 Updated 2003-03-13 08:00 Published 1997-06-16 08:00 Product Standard Internationalised System Calls and Libraries Extended (UNIX 95) Certification Program The Open Brand certification program Test Suite VSU version 4.1.1 Test Identification base/setcontext 1 Problem Summary TSD4U.00189 This test may fail because the stack allocated is not large enough for the calls being made. Problem Text
There appears to be a test suite deficiency in vsu, with setcontext test
#1.
The failure mode and cause are virtually identical to the problem in
swapcontext test #1 (TSD4U.00185).
The problem is that the amount of memory allocated for stack2
(MINSIGSTKSZ + 100 or a total of 612 bytes) is not sufficient to
accommodate all of the stack space needed by the functions that are
being called after setcontext(). In particular, the program exceeds
its stack space when tet_infoline() calls sprintf(), in turn
calling _idoprnt(). It's within _idoprnt() that the stack gets
overrun; this eventually causes a SIGSEGV when getenv() tries to access
the data pointed at by the "environ" variable, which has been overwritten
due to the stack overrun.
Modifying the code to allocate MINSIGSTKSZ+1000 bytes for stack2 allowed
the test to pass.
Here is the relevant code from tset/CAPIbase/fsetcontex/fsetcontex1.c -
tet_infoline("PREP: Allocate stack space for second context");
if((stack2 = malloc(MINSIGSTKSZ+100)) == NULL) {
uwerrno("malloc for stack2");
context_reentered=1;
return;
}
ucp.uc_stack.ss_sp = stack2;
ucp.uc_stack.ss_size = MINSIGSTKSZ+100;
ucp.uc_stack.ss_flags = 0;
tet_infoline("PREP: Set second context's link to first context");
ucp.uc_link = &ucp_base;
tet_infoline("PREP: Allocate stack space for first context");
if((stack1 = malloc(MINSIGSTKSZ+100)) == NULL) {
uwerrno("malloc for stack1");
context_reentered=1;
return;
}
ucp_base.uc_stack.ss_sp = stack1;
ucp_base.uc_stack.ss_size = MINSIGSTKSZ+100;
ucp_base.uc_stack.ss_flags = 0;
tet_infoline("PREP: Call makecontext to modify second context");
errno = 0;
makecontext(&ucp, function, 8, 1, 2, 3, 4, 5, 6, 7, 8);
if(errno != 0) {
uwerrno("makecontext");
context_reentered=1;
return;
}
tet_infoline("TEST: Call setcontext with modified second
context");
didsetcontext++;
setcontext(&ucp);
tet_infoline("ERROR: Execution continued after setcontext()
call");
tet_result(TET_FAIL);
context_reentered=1;
return;
Test Output
TEST CASE: setcontext
TEST PURPOSE #1
A successful call to int setcontext(ucontext_t *ucp)
when ucp is created with makecontext() shall continue
program execution with the function passed to
makecontext() and when that function returns the
process shall continue as if after a call to
setcontext() with the ucp argument that was input to
makecontext().
PREP: Set atexit for premature exits
PREP: Save first context
PREP: Save second context
PREP: Allocate stack space for second context
PREP: Set second context's link to first context
PREP: Allocate stack space for first context
PREP: Call makecontext to modify second context
TEST: Call setcontext with modified second context
TEST: Parameters passed to function after setcontext
INFO: Exiting function
TEST: First context reentered after function
ERROR: TEST TERMINATED DUE TO SIGSEGV SIGNAL (11)
1 FAILReview 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 version(s) 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 1346
- List All PRs
- Search Reports
- Email the System Administrator
- View the The Open Brand Interpretations Database User Manual
Contact the Certification Authority