Issue Details (XML | Word | Printable)

Key: STDCXX-849
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Martin Sebor
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

[EDG eccp/Linux] SIGSEGV in rw_test()

Created: 09/Apr/08 09:25 PM   Updated: 01/Jun/08 01:02 AM
Return to search
Component/s: Test Driver
Affects Version/s: 4.2.0
Fix Version/s: 4.2.1

Time Tracking:
Original Estimate: 4h
Original Estimate - 4h
Remaining Estimate: 0.02h
Time Spent - 1h
Time Spent: 1h
Time Spent - 1h Time Not Required

Environment: EDG eccp 3.9/Linux/x86_64

Severity: Runtime Error
Resolution Date: 09/Apr/08 10:28 PM


 Description  « Hide
The vast majority of tests compiled with EDG eccp on Linux crash with SIGSEGV. The program below is a reduced test case reproducing the problem:
$ cat t.cpp && make t && gdb -q t
#include <driver.h>

static int run_test (int, char*[]) { return 0; }

int main (int argc, char *argv[])
{
    return rw_test (argc, argv, __FILE__, "", "", run_test, 0, (void*)0);
}

eccp -c -I/home/sebor/stdcxx/include/ansi -D_RWSTDDEBUG    -I/home/sebor/stdcxx/include -I/build/sebor/stdcxx-eccp-3.9-11s/include -I/home/sebor/stdcxx/tests/include  -A -x --template_directory=/build/sebor/stdcxx-eccp-3.9-11s/lib -g   --display_error_number --remarks --diag_suppress 193,236,340,401,261,479,487,678,679,815   t.cpp
eccp t.o -o t -L/build/sebor/stdcxx-eccp-3.9-11s/rwtest -lrwtest11s --template_directory=/build/sebor/stdcxx-eccp-3.9-11s/lib    -L/build/sebor/stdcxx-eccp-3.9-11s/lib  -lstd11s  -lm 
Using host libthread_db library "/lib64/libthread_db.so.1".
(gdb) run
Starting program: /build/sebor/stdcxx-eccp-3.9-11s/tests/t 

Program received signal SIGSEGV, Segmentation fault.
0x00902709 in vfprintf () from /lib/libc.so.6
Missing separate debuginfos, use: debuginfo-install gcc.i386 glibc.i686
(gdb) where
#0  0x00902709 in vfprintf () from /lib/libc.so.6
#1  0x0090b972 in fprintf () from /lib/libc.so.6
#2  0x08064bfe in _ZN4__rw16__rw_assert_failEPKcS1_iS1_ (
    __4279_31_expr=0x809e0b6 "0 != rw_stdout", 
    __4280_31_file=0x809dd84 "/home/sebor/stdcxx/tests/src/driver.cpp", 
    __4280_41_line=932, 
    __4280_59_func=0x809dfc0 "int rw_vtest(int, char **, const char *, const char *, const char *, int (*)(int, char **), const char *, void *)")
    at /home/sebor/stdcxx/src/assert.cpp:94
#3  0x08052c36 in _Z8rw_vtestiPPcPKcS2_S2_PFiiS0_ES2_Pv (__10834_15_argc=1, 
    __10834_28_argv=0xfff75464, __10835_23_file_name=0x809d64d "t.cpp", 
    __10836_23_clause=0x809d64c "", __10837_23_comment=0x809d64c "", 
    __10838_17_fun=0x8051f64 <_Z8run_testiPPc>, __10839_23_optstr=0x0, 
    __10840_23_va=0xfff753bc "") at /home/sebor/stdcxx/tests/src/driver.cpp:932
#4  0x0805340b in _Z7rw_testiPPcPKcS2_S2_PFiiS0_ES2_z (__11038_14_argc=1, 
    __11038_27_argv=0xfff75464, __11039_22_fname=0x809d64d "t.cpp", 
    __11040_22_clause=0x809d64c "", __11041_22_comment=0x809d64c "", 
    __11042_16_testfun=0x8051f64 <_Z8run_testiPPc>, __11043_22_optstr=0x0)
    at /home/sebor/stdcxx/tests/src/driver.cpp:1137
#5  0x08051fc0 in main (__3399_15_argc=1, __3399_27_argv=0xfff75464) at t.cpp:7


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor added a comment - 09/Apr/08 09:38 PM
Here's what's on line 919 of driver.cpp and beyond:
919 	_TEST_EXPORT int
920 	rw_vtest (int argc, char **argv,
921 	          const char *file_name,
922 	          const char *clause,
923 	          const char *comment,
924 	          int (*fun)(int, char**),
925 	          const char *optstr,
926 	          va_list     va)
927 	{
928 	    CHECK_INIT (false, "rw_vtest()");
929 	
930 	    // set the default test output to stdout
931 	    RW_ASSERT (0 == _rw_ftestout);
932 	    RW_ASSERT (0 != rw_stdout);

Martin Sebor added a comment - 09/Apr/08 10:28 PM
We were initializing stdout with itself in file.cpp...
Fix committed in r646568.

Farid Zaripov added a comment - 17/Apr/08 10:03 AM

Martin Sebor added a comment - 01/Jun/08 01:02 AM
Verified on 4.2.x, 4.3.x, and trunk.