stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <>
Subject Re: string methods thread safety
Date Tue, 01 Aug 2006 18:22:26 GMT
Farid Zaripov wrote:
>  > -----Original Message-----
>  > From: Martin Sebor []
>  > Sent: Friday, July 21, 2006 4:00 AM
>  > To:
>  > 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 (
> 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.


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

__rw::__rw_facet::_C_manage: Assertion 'ref + 1U != 0' failed.
# 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

View raw message