incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Black <abl...@roguewave.com>
Subject Re: Testsuite self-test failure on NetBSD 3.0
Date Mon, 27 Feb 2006 17:18:48 GMT
When I build and run the testcase as follows, the assertion fails, 
seeming to confirm the hypothesis.

--Andrew Black

td143.testdrive.hp.com> cat > testcase.cpp
  #include <cassert>
  #include <sys/types.h>

  namespace __rw {
      ssize_t __rw_memattr (const void*, size_t, int);
  }

  int main () {
      assert (-1 == __rw::__rw_memattr ((void*)1, 1, -1));
  }
td143.testdrive.hp.com> gcc -c -I/house/ablackrw/stdcxx/include/ansi 
-D_RWSTDDEBUG    -D_RWSTD_USE_CONFIG -I/tmp/ablackrw/stdcxx-11d/include 
-I/house/ablackrw/stdcxx/include -pedantic -nostdinc++ -g  -W -Wall 
-Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long 
-Wcast-align testcase.cpp
td143.testdrive.hp.com> gcc testcase.o -o testcase 
-L/tmp/ablackrw/stdcxx-11d/lib -lstd11d  -lsupc++ -lm
td143.testdrive.hp.com> ./testcase
assertion "-1 == __rw::__rw_memattr ((void*)1, 1, -1)" failed: file 
"testcase.cpp", line 9, function "int main()"
Abort trap (core dumped)


Martin Sebor wrote:

> Andrew Black wrote:
>
>> Greetings all.
>>
>> While running the different executables in the stdcxx test suite, I 
>> encountered a segfault executing the printf selftest.  The following 
>> is the backtrace.
>
>
> This might be caused by __rw::__rw_memattr() not detecting that
> (char*)1 is not a valid pointer to a character string. A simple
> test case to confirm this hypothesis would go something like
> this:
>
>   #include <cassert>
>   #include <sys/types.h>
>
>   namespace __rw {
>       ssize_t __rw_memattr (const void*, size_t, int);
>   }
>
>   int main () {
>       assert (-1 == __rw::__rw_memattr ((void*)1, 1, -1));
>   }
>
> Martin



Mime
View raw message