stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <se...@roguewave.com>
Subject Re: string methods thread safety
Date Tue, 01 Aug 2006 18:22:26 GMT
Farid Zaripov wrote:
>  > -----Original Message-----
>  > From: Martin Sebor [mailto:sebor@roguewave.com]
>  > Sent: Friday, July 21, 2006 4:00 AM
>  > To: stdcxx-dev@incubator.apache.org
>  > Subject: RE: string methods thread safety
>  >
>  > Could you please post your proposed ChangeLog entry for all
>  > nontrivial changes? It will make it easier for me to
>  > understand what's going on.
>  > Thanks! :)
>  >
> 
>   The test exercising string thread safety (21.string.mt.cpp).
> The test file and 21.string.*.diff are attached.

It looks like there's a problem with the thread safety of locale.
I'm getting failures (aborts) in operator>>() on ppc -- see below
-- and either deadlock or spinlock on Solaris. The aborts seem to
be reported multiple times so that's something that needs to be
handled but it's not necessarily a showstopper. The deadlock is
a problem and I think we should have a solution for it before
committing the test. I suppose we don't really need to exercise
the I/O functions in this test (since doing so really exercises
the locale and not so much string) so that would take care of
this specific problem. But We will also need a general solution
for this type of a problem in case there's a deadlock in string.

In addition, it would be nice to be able to control which members
get tested via the same command line interface as in all the other
string tests (rather than via the --overload_id=<int> option). I
suspect that will involve changes to 21.strings.h.

As for the string test itself, I suspect there might be a problem
with calling c_str() or begin() on the string object(s) created
in the test function. Since each of the calls disables reference
counting the function doesn't exercise the case when reference
counting is enabled. Also, I think we should to do a little bit
more than just invoke the tested function -- we should assert
that the result (and probably also the argument) is valid. We
should use RW_ASSERT() (as opposed to rw_assert()) for this.

Martin


# INFO (S1) (3 lines):
# TEXT: exercising the std::operator>>(std::istream&, std::string&)
# CLAUSE: lib.string

/amd/devco/sebor/dev/stdlib/src/facet.cpp:532: 
__rw::__rw_facet::_C_manage: Assertion 'ref + 1U != 0' failed.
./21_mt[0x100db70c]
./21_mt[0x100db808]
./21_mt[0x100eda10]
./21_mt[0x1010574c]
./21_mt[0x1010d9f4]
./21_mt[0x10034044]
./21_mt[0x10076748]
./21_mt[0x100958b4]
/lib64/tls/libpthread.so.0[0x80002839f0]
/lib64/tls/libc.so.6[0x800014d95c]
# ERROR (S8) (5 lines):
# TEXT: the process (pid=14811) exited with signal 6 (SIGABRT)
# CLAUSE: lib.string
# FILE: process.cpp
# LINE: 317

# ASSERTION (S7) (3 lines):
# TEXT: the test of std::operator>>(std::istream&, std::string&) failed
# CLAUSE: lib.string

Mime
View raw message