This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Analysis of solaris2 27_io/istream_extractor_arith.cc failures


The libstdc++-v3 results for solaris2.7 for our three branches (3.2,
3.3 and 3.4) all show errors for 27_io/istream_extractor_arith.cc.
E.g. http://gcc.gnu.org/ml/gcc-testresults/2002-12/msg01074.html

I found this posting which attributes it to a bug in sun's libc sscanf
implementation: http://gcc.gnu.org/ml/gcc-bugs/2002-05/msg01008.html

Indeed, I've been able to reproduce the problem with this simple C program:

	
	#include <stdio.h>
	#define SHORT "1234567890123456789012345678901234567890"
	#define MED SHORT SHORT SHORT SHORT SHORT SHORT SHORT SHORT SHORT SHORT
	#define LONG MED MED MED MED MED MED MED MED MED MED
	#define STRING LONG MED MED MED SHORT SHORT SHORT SHORT SHORT SHORT 
	int main()
	{
	  long double ld;
	
	  sscanf (STRING, "%Lf", &ld);
	  fprintf (stderr, "<%Lf>\n", ld);
	  
	  return 0;
	}

	%gcc -O -g -W -Wall foo.c
	%./a.out
	Segmentation fault


Since this is a vendor libc bug and not something gcc can fix, I'd
like to xfail the test.  However because of the convention in
libstdc++-v3 of putting multiple tests in a single file, I don't want
to xfail the whole thing because we still want to ensure that all of
the other tests pass, or know that they (separately) fail.  Therefore
I'd like to chop out the particular code (test12) into a new file and
xfail just that test.  I quickly tried commenting out test12() and
luckily the rest of the tests in there pass.

The posting above claims that the bug is sparc specific, i.e. not
x86/solaris.  I don't have x86-solaris to test that but for now I'll
only xfail the sparc*-*-solaris2* target.  If it turns up on x86 we
can easily change the cpu from sparc* to *.

Patch to follow after some testing.  Any suggestions for the name of
the new split out file?  Using istream_extractor_arith2 didn't seem
very descriptive.

		Thanks,
		--Kaveh
--
Kaveh R. Ghazi			ghazi@caip.rutgers.edu


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]