You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by Martin Sebor <se...@roguewave.com> on 2006/06/06 17:19:17 UTC

Re: testing exception safety of string member templates ([Fwd: failure notice])

Hey Anton, this bounced yesterday. Please see the attachment
to read the whole email.

Martin

-------- Original Message --------
Subject: failure notice
Date: 6 Jun 2006 02:02:03 -0000
From: MAILER-DAEMON@apache.org
To: sebor@roguewave.com

Hi. This is the qmail-send program at apache.org.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<st...@incubator.apache.org>:
ezmlm-reject: fatal: Sorry, I don't accept messages larger than 100000 
bytes (#5.2.3)

--- Below this line is a copy of the message.

Return-Path: <se...@roguewave.com>
Received: (qmail 99667 invoked by uid 99); 6 Jun 2006 02:02:02 -0000
Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)
     by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 19:02:02 
-0700
X-ASF-Spam-Status: No, hits=0.0 required=10.0
	tests=
X-Spam-Check-By: apache.org
Received-SPF: neutral (asf.osuosl.org: local policy)
Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160)
     by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 19:01:58 
-0700
Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59])
	by moroha.quovadx.com (8.13.4/8.13.4) with ESMTP id k5620nXE003142
	for <st...@incubator.apache.org>; Tue, 6 Jun 2006 02:00:49 GMT
Received: from [10.70.3.113] ([10.70.3.113]) by 
qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830);
	 Mon, 5 Jun 2006 20:01:48 -0600
Message-ID: <44...@roguewave.com>
Date: Mon, 05 Jun 2006 20:01:34 -0600
From: Martin Sebor <se...@roguewave.com>
Organization: Rogue Wave Software
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) 
Gecko/20050920
X-Accept-Language: en-us, en
MIME-Version: 1.0
To: stdcxx-dev@incubator.apache.org
Subject: Re: testing exception safety of string member templates (was: Re:
  lib.string.capacity test update)
References: <44...@moscow.vdiweb.com>
In-Reply-To: <44...@moscow.vdiweb.com>
Content-Type: multipart/mixed;
  boundary="------------010306050401010901050007"
X-OriginalArrivalTime: 06 Jun 2006 02:01:48.0696 (UTC) 
FILETIME=[2BACC180:01C6890D]
X-Virus-Checked: Checked by ClamAV on apache.org

This is a multi-part message in MIME format.
--------------010306050401010901050007
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Anton Pevtsov wrote:
[...]
> Unfortunately, the gcc 4.0 fails to compile the changes you made. It
> looks like the compiler could not choose which overload (with
> String::pointer or String::iterator) to call when charT is simple char.
> This results in the error "<function> cannot be overloaded".

Right, I forgot that string::iterator and string::pointer are
the same type when debugging is disabled. Sorry about that.

> I've played with it and finally decided to make the begin method virtual
> and create three new template classes based on the ReplaceRangeOverload
> template, one per each pair of const and non-const iterators. The file
> with these changes is attached. May be there is some other (less
> complicated) way to help the gcc to resolve the ambiguity with iterator
> types. If so, I thnik we should switch to it, but verify that all
> compilers accept it before.

I think simply #ifdef'ing out one of the conflicting overloads when
_RWSTDDEBUG is not #defined will be easier.

> 
> Also I noticed that both versions produce 600 asserts on Windows. I'll
> investigate their cause.

I see failing assertions on Linux as well (see the attachment). At
least some of the ones you are seeing will probably caused by
http://issues.apache.org/jira/browse/STDCXX-170 but there may be
others as well.

Oher than failing assertions there is also a usability issue with
the tests exercising the range overloads: they can't be controlled
at the same level of granularity as the ordinary functions can using
the usual command line options. In fact, the usability issue would
also be behind some of the failed assertions if we were to enable
the tests exercising reverse_iterators because the result of the
replacement invoked with a reverse_iterator is different from the
result obtained with a regular forward iterator.

StringIds::ArgId defines one constant for each concrete type of
a function argument *except* for the range template. There we simply
have a range, regardless of whether the range is denoted by a couple
of pointers, string::iterators, or some other kind of iterators. That
doesn't allow us to cleanly distinguish one from the other. And it's
not a problem for any kinds of iterators that we use to exercise the
templates with *except* for reverse iterators.

I changed 21.strings.h and added an IteratorId member enum to StringIds
and a member of that type to the StringFunc struct. I've also started
adding code to 21.strings.cpp to handle this member
and21.string.replace.cpp to take advantage of it. All the changes are
incomplete and cannot be committed yet but they are attached so you can
see where I am. I plan to finish the whole thing tomorrow. Let me know
if you have any comments or suggestions.

Martin

Re: testing exception safety of string member templates ([Fwd: failure notice])

Posted by Martin Sebor <se...@roguewave.com>.
Martin Sebor wrote:
> Hey Anton, this bounced yesterday. Please see the attachment
> to read the whole email.

Crud. It looks like the attachment didn't make it. Let me try
again.

> 
> Martin
> 
> -------- Original Message --------
> Subject: failure notice
> Date: 6 Jun 2006 02:02:03 -0000
> From: MAILER-DAEMON@apache.org
> To: sebor@roguewave.com
> 
> Hi. This is the qmail-send program at apache.org.
> I'm afraid I wasn't able to deliver your message to the following 
> addresses.
> This is a permanent error; I've given up. Sorry it didn't work out.
> 
> <st...@incubator.apache.org>:
> ezmlm-reject: fatal: Sorry, I don't accept messages larger than 100000 
> bytes (#5.2.3)
> 
> --- Below this line is a copy of the message.
> 
> Return-Path: <se...@roguewave.com>
> Received: (qmail 99667 invoked by uid 99); 6 Jun 2006 02:02:02 -0000
> Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49)
>     by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 19:02:02 
> -0700
> X-ASF-Spam-Status: No, hits=0.0 required=10.0
>     tests=
> X-Spam-Check-By: apache.org
> Received-SPF: neutral (asf.osuosl.org: local policy)
> Received: from [208.30.140.160] (HELO moroha.quovadx.com) (208.30.140.160)
>     by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Jun 2006 19:01:58 
> -0700
> Received: from qxvcexch01.ad.quovadx.com ([192.168.170.59])
>     by moroha.quovadx.com (8.13.4/8.13.4) with ESMTP id k5620nXE003142
>     for <st...@incubator.apache.org>; Tue, 6 Jun 2006 02:00:49 GMT
> Received: from [10.70.3.113] ([10.70.3.113]) by 
> qxvcexch01.ad.quovadx.com with Microsoft SMTPSVC(6.0.3790.1830);
>      Mon, 5 Jun 2006 20:01:48 -0600
> Message-ID: <44...@roguewave.com>
> Date: Mon, 05 Jun 2006 20:01:34 -0600
> From: Martin Sebor <se...@roguewave.com>
> Organization: Rogue Wave Software
> User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) 
> Gecko/20050920
> X-Accept-Language: en-us, en
> MIME-Version: 1.0
> To: stdcxx-dev@incubator.apache.org
> Subject: Re: testing exception safety of string member templates (was: Re:
>  lib.string.capacity test update)
> References: <44...@moscow.vdiweb.com>
> In-Reply-To: <44...@moscow.vdiweb.com>
> Content-Type: multipart/mixed;
>  boundary="------------010306050401010901050007"
> X-OriginalArrivalTime: 06 Jun 2006 02:01:48.0696 (UTC) 
> FILETIME=[2BACC180:01C6890D]
> X-Virus-Checked: Checked by ClamAV on apache.org
> 
> This is a multi-part message in MIME format.
> --------------010306050401010901050007
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Transfer-Encoding: 7bit
> 
> Anton Pevtsov wrote:
> [...]
> 
>> Unfortunately, the gcc 4.0 fails to compile the changes you made. It
>> looks like the compiler could not choose which overload (with
>> String::pointer or String::iterator) to call when charT is simple char.
>> This results in the error "<function> cannot be overloaded".
> 
> 
> Right, I forgot that string::iterator and string::pointer are
> the same type when debugging is disabled. Sorry about that.
> 
>> I've played with it and finally decided to make the begin method virtual
>> and create three new template classes based on the ReplaceRangeOverload
>> template, one per each pair of const and non-const iterators. The file
>> with these changes is attached. May be there is some other (less
>> complicated) way to help the gcc to resolve the ambiguity with iterator
>> types. If so, I thnik we should switch to it, but verify that all
>> compilers accept it before.
> 
> 
> I think simply #ifdef'ing out one of the conflicting overloads when
> _RWSTDDEBUG is not #defined will be easier.
> 
>>
>> Also I noticed that both versions produce 600 asserts on Windows. I'll
>> investigate their cause.
> 
> 
> I see failing assertions on Linux as well (see the attachment). At
> least some of the ones you are seeing will probably caused by
> http://issues.apache.org/jira/browse/STDCXX-170 but there may be
> others as well.
> 
> Oher than failing assertions there is also a usability issue with
> the tests exercising the range overloads: they can't be controlled
> at the same level of granularity as the ordinary functions can using
> the usual command line options. In fact, the usability issue would
> also be behind some of the failed assertions if we were to enable
> the tests exercising reverse_iterators because the result of the
> replacement invoked with a reverse_iterator is different from the
> result obtained with a regular forward iterator.
> 
> StringIds::ArgId defines one constant for each concrete type of
> a function argument *except* for the range template. There we simply
> have a range, regardless of whether the range is denoted by a couple
> of pointers, string::iterators, or some other kind of iterators. That
> doesn't allow us to cleanly distinguish one from the other. And it's
> not a problem for any kinds of iterators that we use to exercise the
> templates with *except* for reverse iterators.
> 
> I changed 21.strings.h and added an IteratorId member enum to StringIds
> and a member of that type to the StringFunc struct. I've also started
> adding code to 21.strings.cpp to handle this member
> and21.string.replace.cpp to take advantage of it. All the changes are
> incomplete and cannot be committed yet but they are attached so you can
> see where I am. I plan to finish the whole thing tomorrow. Let me know
> if you have any comments or suggestions.
> 
> Martin