You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@stdcxx.apache.org by "Farid Zaripov (JIRA)" <ji...@apache.org> on 2008/04/29 20:13:56 UTC
[jira] Created: (STDCXX-901) [MSVC] 26.class.gslice test fails
[MSVC] 26.class.gslice test fails
---------------------------------
Key: STDCXX-901
URL: https://issues.apache.org/jira/browse/STDCXX-901
Project: C++ Standard Library
Issue Type: Bug
Components: Tests
Affects Versions: 4.2.0, 4.2.1
Environment: MSVC
Reporter: Farid Zaripov
Priority: Minor
Fix For: 4.2.2
The 26.class.gslice test fails with the 162 assertions:
{noformat}
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
...
{noformat}
I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-901) 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Travis Vitek updated STDCXX-901:
--------------------------------
Attachment: stdcxx-901.patch
{noformat}
2008-06-03 Travis Vitek <vi...@roguewave.com>
STDCXX-901
* include/valarray (gslice_array<>::operator=): Check to see
if slice is empty before attempting to iterate over it. Check
that slice is reset only after getting the first index.
(gslice_array<>::operator*=): Ditto.
(gslice_array<>::operator/=): Ditto.
(gslice_array<>::operator+=): Ditto.
(gslice_array<>::operator-=): Ditto.
(gslice_array<>::operator%=): Ditto.
(gslice_array<>::operator^=): Ditto.
(gslice_array<>::operator&=): Ditto.
(gslice_array<>::operator|=): Ditto.
(gslice_array<>::operator<<=): Ditto.
(gslice_array<>::operator>>=): Ditto.
(valarray<>::ctor): Ditto.
(valarray<>::operator=): Ditto.
(gslice::ind_numb): Correctly calculate number of indexes
given an array of lengths.
* tests/numerics/26.gslice.array.cassign.cpp: New test for
gslice computed assignment operators.
{noformat}
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
> Attachments: stdcxx-901.patch
>
> Time Spent: 6h
> Remaining Estimate: 0h
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
RE: [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by Travis Vitek <Tr...@roguewave.com>.
Martin Sebor wrote:
>
>Travis Vitek wrote:
>>
>>
>>> Martin Sebor commented on STDCXX-901:
>>> -------------------------------------
>>>
>>> This is from the binary incompatible rewrite of {{valarray}}
>>> that I've been mentioning for eons (I should finally commit it
>>> on trunk). If it fixes this bug it might spark an idea for a
>>> compatible fix...
>>>
>>
>> [...]
>>
>> int main ()
>> {
>> // + length
>> // | +- stride
>> // | |
>> // v v
>> test ("1@10", 0, "", "");
>> test ("1@10", 0, "0", "0");
>> test ("1@10", 0, "1", "1");
>> test ("1@10", 0, "1", "2");
>> test ("1@10", 0, "1", "3");
>>
>> test ("1@10", 0, "2", "1");
>> test ("1@10", 0, "2", "2");
>> test ("1@10", 0, "3", "3");
>> test ("1@10", 0, "2", "3");
>>
>> test ("1@10", 0, "5", "1");
>> test ("1@10", 1, "5", "1");
>> test ("1@10", 1, "5,2", "1,2");
>>
>> test ("1@10", 0, "0,0,0", "1,2,3");
>>
>> return 0;
>> }
>>
>[...]
>> The STLPort and RW implementations both get stuck in an
>> infinite loop on
>> the second testcase, so I'm pretty sure that they're broken. I can't
>> find anything in the standard that says this would be unspecified or
>> undefined behavior and I don't see anything that calls this out as a
>> special case. This leads me to believe that this is a bug in both
>> implementations and I should take it into consideration when applying
>> any fix.
>
>I agree. There's more than one way to refer to the same slice.
>Unless it's computationally expensive to avoid, none of them
>should enter an infinite loop or any other kind of undefined
>behavior.
In that case, then I think your new gslice code [shown earlier in this
thread] has issues with the same case. The following snip will calculate
the wrong value for the number of indexes if an element of the length
array is zero. This is the problematic code...
for (size_t i = 0; i != length; ++i) {
nelems *= _C_length [i];
}
I believe the easy fix would be...
for (size_t i = 0; i != length; ++i) {
if (_C_length [i])
nelems *= _C_length [i];
}
Then, of course you would need to fix the loop that calculates the
values in the _C_inxs array to handle the special case
while (inx && cache [inx - 1] == _C_length [inx - 1] - 1)
--inx;
The following should work.
for (/**/; inx; --inx)
{
if ( _C_length [__n - 1]
&& cache [__n - 1] != _C_length [__n - 1] - 1)
break;
}
Travis
>
>Martin
>
Re: [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by Martin Sebor <se...@roguewave.com>.
Travis Vitek wrote:
>
>
>> Martin Sebor commented on STDCXX-901:
>> -------------------------------------
>>
>> This is from the binary incompatible rewrite of {{valarray}}
>> that I've been mentioning for eons (I should finally commit it
>> on trunk). If it fixes this bug it might spark an idea for a
>> compatible fix...
>>
>
> Martin,
>
> I'm struggling with what appears to a discrepancy between the standard
> and the two implementations I'm testing with.
You mean a bug? ;-)
> According to
> lib.gslice.cons, a default constructed slice specifies no elements.
> Section lib.class.gslice describes gslices that do have lengths and
> strides. The example it gives is shown here
>
[...]
> Assume for a moment that we have the following gslice...
>
> start = 0
> length = { 0 }
> stride = { 0 }
>
> So the indices specified by this slice should be
>
> k = 0 + () * 0
Or just k = 0 because the sum is zero.
>
> i0, i1, k
> (0, (), 0) // = 0 + () * 0
>
> So this slice should be a view of 0th element in a given array.
That's my reading too.
>
> I wrote a quick testcase to make sure that I was understanding this
> gslice stuff correctly. It creates a valarray and a slice from strings,
> then assigns 0 to the resulting gslice_array. This zeros out all
> elements specified by the slice. Here is the set of testcases...
>
> int main ()
> {
> // + length
> // | +- stride
> // | |
> // v v
> test ("1@10", 0, "", "");
> test ("1@10", 0, "0", "0");
> test ("1@10", 0, "1", "1");
> test ("1@10", 0, "1", "2");
> test ("1@10", 0, "1", "3");
>
> test ("1@10", 0, "2", "1");
> test ("1@10", 0, "2", "2");
> test ("1@10", 0, "3", "3");
> test ("1@10", 0, "2", "3");
>
> test ("1@10", 0, "5", "1");
> test ("1@10", 1, "5", "1");
> test ("1@10", 1, "5,2", "1,2");
>
> test ("1@10", 0, "0,0,0", "1,2,3");
>
> return 0;
> }
>
[...]
> The STLPort and RW implementations both get stuck in an infinite loop on
> the second testcase, so I'm pretty sure that they're broken. I can't
> find anything in the standard that says this would be unspecified or
> undefined behavior and I don't see anything that calls this out as a
> special case. This leads me to believe that this is a bug in both
> implementations and I should take it into consideration when applying
> any fix.
I agree. There's more than one way to refer to the same slice.
Unless it's computationally expensive to avoid, none of them
should enter an infinite loop or any other kind of undefined
behavior.
Martin
RE: [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by Travis Vitek <Tr...@roguewave.com>.
>Martin Sebor commented on STDCXX-901:
>-------------------------------------
>
>This is from the binary incompatible rewrite of {{valarray}}
>that I've been mentioning for eons (I should finally commit it
>on trunk). If it fixes this bug it might spark an idea for a
>compatible fix...
>
Martin,
I'm struggling with what appears to a discrepancy between the standard
and the two implementations I'm testing with. According to
lib.gslice.cons, a default constructed slice specifies no elements.
Section lib.class.gslice describes gslices that do have lengths and
strides. The example it gives is shown here
start = 3
length = { 2, 4, 3 }
stride = { 19, 4, 1 }
k = 3 + (0,1) * 19 + (0,1,2,3) * 4 + (0,1,2) * 1
i0, i1, i2, k
(0, 0, 0, 3 ) // = 3 + (0) * 19 + (0) * 4 + (0) * 1
(0, 0, 1, 4 ) // = 3 + (0) * 19 + (0) * 4 + (1) * 1
(0, 0, 2, 5 ) // = 3 + (0) * 19 + (0) * 4 + (2) * 1
(0, 1, 0, 7 ) // = 3 + (0) * 19 + (1) * 4 + (0) * 1
(0, 1, 1, 8 ) // = 3 + (0) * 19 + (1) * 4 + (1) * 1
(0, 1, 2, 9 ) // = 3 + (0) * 19 + (1) * 4 + (2) * 1
(0, 2, 0, 11) // = 3 + (0) * 19 + (2) * 4 + (0) * 1
(0, 2, 1, 12) // = 3 + (0) * 19 + (2) * 4 + (1) * 1
(0, 2, 2, 13) // = 3 + (0) * 19 + (2) * 4 + (2) * 1
(0, 3, 0, 15) // = 3 + (0) * 19 + (3) * 4 + (0) * 1
(0, 3, 1, 16) // = 3 + (0) * 19 + (3) * 4 + (1) * 1
(0, 3, 2, 17) // = 3 + (0) * 19 + (3) * 4 + (2) * 1
(1, 0, 0, 22) // = 3 + (1) * 19 + (0) * 4 + (0) * 1
(1, 0, 1, 23) // = 3 + (1) * 19 + (0) * 4 + (1) * 1
...
(1, 3, 2, 36) // = 3 + (1) * 19 + (3) * 4 + (2) * 1
Assume for a moment that we have the following gslice...
start = 0
length = { 0 }
stride = { 0 }
So the indices specified by this slice should be
k = 0 + () * 0
i0, i1, k
(0, (), 0) // = 0 + () * 0
So this slice should be a view of 0th element in a given array.
I wrote a quick testcase to make sure that I was understanding this
gslice stuff correctly. It creates a valarray and a slice from strings,
then assigns 0 to the resulting gslice_array. This zeros out all
elements specified by the slice. Here is the set of testcases...
int main ()
{
// + length
// | +- stride
// | |
// v v
test ("1@10", 0, "", "");
test ("1@10", 0, "0", "0");
test ("1@10", 0, "1", "1");
test ("1@10", 0, "1", "2");
test ("1@10", 0, "1", "3");
test ("1@10", 0, "2", "1");
test ("1@10", 0, "2", "2");
test ("1@10", 0, "3", "3");
test ("1@10", 0, "2", "3");
test ("1@10", 0, "5", "1");
test ("1@10", 1, "5", "1");
test ("1@10", 1, "5,2", "1,2");
test ("1@10", 0, "0,0,0", "1,2,3");
return 0;
}
And here is the output I get with the Dinkum and gnu implementations...
{1,1,1,1,1,1,1,1,1,1}[0,{},{}] = 0
=> = {1,1,1,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{0},{0}] = 0
=> {1,1,1,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{1},{1}] = 0
=> {0,1,1,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{1},{2}] = 0
=> {0,1,1,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{1},{3}] = 0
=> {0,1,1,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{2},{1}] = 0
=> {0,0,1,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{2},{2}] = 0
=> {0,1,0,1,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{3},{3}] = 0
=> {0,1,1,0,1,1,0,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{2},{3}] = 0
=> {0,1,1,0,1,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{5},{1}] = 0
=> {0,0,0,0,0,1,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[1,{5},{1}] = 0
=> {1,0,0,0,0,0,1,1,1,1}
{1,1,1,1,1,1,1,1,1,1}[1,{5,2},{1,2}] = 0
=> {1,0,0,0,0,0,0,0,1,1}
{1,1,1,1,1,1,1,1,1,1}[0,{0,0,0},{1,2,3}] = 0
=> {1,1,1,1,1,1,1,1,1,1}
The STLPort and RW implementations both get stuck in an infinite loop on
the second testcase, so I'm pretty sure that they're broken. I can't
find anything in the standard that says this would be unspecified or
undefined behavior and I don't see anything that calls this out as a
special case. This leads me to believe that this is a bug in both
implementations and I should take it into consideration when applying
any fix.
Travis
RE: [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by Travis Vitek <Tr...@roguewave.com>.
Sorry for top posting, but this webmail app won't prefix existing lines. Argh!
I've pulled the patch from stdcxx-901 as I've come up with a much more obvious and clean solution. I'll post an updated patch in the morning.
Travis
-----Original Message-----
From: Travis Vitek [mailto:Travis.Vitek@roguewave.com]
Sent: Tue 6/3/2008 6:54 PM
To: dev@stdcxx.apache.org
Subject: RE: [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Okay, I have a fix. It isn't as pretty as I'd like it to be, but it is
forward and backward binary compatible. I'm attaching the patch to the
issue, which you can find by clicking the link below. Please review when
you have a chance.
http://issues.apache.org/jira/secure/attachment/12383346/stdcxx-901.patc
h
Note that I left some commented references to a new inline method
gslice::is_empty(). If I submit the fix to 4.2.x I plan to remove these
lines. When the fix goes to 4.3.x I'd like to use the clean solution
which allows me to eliminate the friendship and direct member access. I
also realize that the test is currently incomplete. I will obviously be
working to finish up the test before submitting the patch.
Travis
RE: [jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by Travis Vitek <Tr...@roguewave.com>.
Okay, I have a fix. It isn't as pretty as I'd like it to be, but it is
forward and backward binary compatible. I'm attaching the patch to the
issue, which you can find by clicking the link below. Please review when
you have a chance.
http://issues.apache.org/jira/secure/attachment/12383346/stdcxx-901.patc
h
Note that I left some commented references to a new inline method
gslice::is_empty(). If I submit the fix to 4.2.x I plan to remove these
lines. When the fix goes to 4.3.x I'd like to use the clean solution
which allows me to eliminate the friendship and direct member access. I
also realize that the test is currently incomplete. I will obviously be
working to finish up the test before submitting the patch.
Travis
[jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601804#action_12601804 ]
Martin Sebor commented on STDCXX-901:
-------------------------------------
This is from the binary incompatible rewrite of {{valarray}} that I've been mentioning for eons (I should finally commit it on trunk). If it fixes this bug it might spark an idea for a compatible fix...
{noformat}
// 26.3.6 - generalized slice of a valarray
class _RWSTD_EXPORT gslice
{
public:
// 26.3.6.1
gslice (): _C_imp (0) { /* no-op */ }
gslice (_RWSTD_SIZE_T,
const valarray<_RWSTD_SIZE_T>&,
const valarray<_RWSTD_SIZE_T>&);
gslice (const gslice&);
~gslice ();
gslice& operator= (const gslice&);
// 26.3.6.2
_RWSTD_SIZE_T start () const {
return _C_imp ? _C_imp->_C_start : 0;
}
valarray<_RWSTD_SIZE_T> size () const {
return _C_imp ? _C_imp->_C_length : valarray<_RWSTD_SIZE_T>();
}
valarray<_RWSTD_SIZE_T> stride () const {
return _C_imp ? _C_imp->_C_stride : valarray<_RWSTD_SIZE_T>();
}
const _RWSTD_SIZE_T _C_size () const {
return _C_imp ? _C_imp->_C_inxs.size () : 0;
}
const valarray<_RWSTD_SIZE_T>& _C_indices () const {
_RWSTD_ASSERT (0 != _C_imp);
return _C_imp->_C_inxs;
}
private:
// referenced counted gslice implementation for efficiency
struct _Imp {
_Imp (_RWSTD_SIZE_T,
const valarray<_RWSTD_SIZE_T>&,
const valarray<_RWSTD_SIZE_T>&);
valarray<_RWSTD_SIZE_T> _C_length; // set of lengths (sizes equal)
valarray<_RWSTD_SIZE_T> _C_stride; // set of strides (sizes equal)
valarray<_RWSTD_SIZE_T> _C_inxs; // cached array of indices
_RWSTD_SIZE_T _C_start; // starting offset
_RWSTD_SIZE_T _C_refs; // reference count
private:
_Imp (const _Imp&); // not copyable
void operator=(const _Imp&); // not assignable
};
_Imp *_C_imp; // reference-counted implementation or 0
};
gslice::_Imp::
_Imp (size_t beg,
const valarray<size_t>& len,
const valarray<size_t>& str)
: _C_length (len),
_C_stride (str),
_C_inxs (/* initialized below */),
_C_start (beg),
_C_refs (0)
{
_RWSTD_ASSERT (_C_length.size () == _C_stride.size ());
// compute the number of indices represented by this slice
// and store it for later so that the expensive computation
// need only be done at most once
const size_t length = _C_length.size ();
if (0 == length)
return;
size_t nelems = 1;
for (size_t i = 0; i != length; ++i) {
nelems *= _C_length [i];
}
_C_inxs.resize (nelems);
size_t small_cache [256];
const size_t cache_size = sizeof small_cache / sizeof *small_cache;
size_t* const cache =
length < cache_size ? small_cache : new size_t [length];
memset (cache, 0, length * sizeof *cache);
_C_inxs [0] = _C_start;
for (size_t i = 1; i < nelems; ++i) {
size_t inx = length;
while (inx && cache [inx - 1] == _C_length [inx - 1] - 1)
--inx;
_RWSTD_ASSERT (0 != inx);
++cache [inx - 1];
if (inx < length)
memset (cache + inx, 0, (length - inx) * sizeof *cache);
_C_inxs [i] = _C_start;
for (size_t j = 0; j != inx; ++j)
_C_inxs [i] += cache [j] * _C_stride [j];
}
if (cache != small_cache)
delete[] cache;
}
gslice::
gslice (size_t beg,
const valarray<size_t>& len,
const valarray<size_t>& str)
: _C_imp (new _Imp (beg, len, str))
{
// no-op
}
gslice::
gslice (const gslice &rhs)
: _C_imp (rhs._C_imp)
{
if (_C_imp)
_RWSTD_ATOMIC_PREINCREMENT (_C_imp->_C_refs, false);
}
gslice::
~gslice ()
{
if (_C_imp && 0 == _RWSTD_ATOMIC_PREDECREMENT (_C_imp->_C_refs, false))
delete _C_imp;
}
gslice& gslice::
operator= (const gslice &rhs)
{
if (_C_imp && 0 == _RWSTD_ATOMIC_PREDECREMENT (_C_imp->_C_refs, false))
delete _C_imp;
if (rhs._C_imp)
_RWSTD_ATOMIC_PREINCREMENT (_C_imp->_C_refs, false);
return *this;
}
{noformat}
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
> Time Spent: 6h
> Remaining Estimate: 0h
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (STDCXX-901) [MSVC] 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Travis Vitek reassigned STDCXX-901:
-----------------------------------
Assignee: Travis Vitek
> [MSVC] 26.class.gslice test fails
> ---------------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12601802#action_12601802 ]
Travis Vitek commented on STDCXX-901:
-------------------------------------
It looks like this is a problem with gslice. Here is the relevant code.
{noformat}
template <class _TypeT>
valarray<_TypeT>::valarray(const gslice_array<_TypeT>& sl_ar)
{
gslice __sl(sl_ar._C_get_slice());
_RW::__rw_array <_TypeT> __tmp =
_RW::__rw_array <_TypeT>(_TypeT (), __sl.ind_numb());
_RWSTD_SIZE_T __i = __sl.next_ind();
_RWSTD_SIZE_T __cpt = 0;
while (!__sl.is_reseted ())
{
__tmp[__cpt] = (*(sl_ar.get_ref_mem_array()))[__i];
__i = __sl.next_ind();
__cpt++;
}
_C_array.swap (__tmp);
}
{noformat}
The issue is that if you have a gslice with start = 1, step = 1 and stride = 1 the slice {{\_\_sl}} is reset when you call {{next_ind()}} the first time. So we never enter the loop, but we should enter the loop exactly once.
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (STDCXX-901) 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602464#action_12602464 ]
Travis Vitek commented on STDCXX-901:
-------------------------------------
Committed to 4.2.x in [r663373|http://svn.apache.org/viewvc?view=rev&revision=663373].
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
> Time Spent: 10h
> Remaining Estimate: 0h
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (STDCXX-901) 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Travis Vitek resolved STDCXX-901.
---------------------------------
Resolution: Fixed
Verified to pass on 4.2.x.
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
> Time Spent: 10h
> Remaining Estimate: 0h
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-901) [MSVC] 26.class.gslice test fails
Posted by "Farid Zaripov (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Farid Zaripov updated STDCXX-901:
---------------------------------
Description:
The 26.class.gslice test fails with the 162 similar assertions:
{noformat}
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
...
{noformat}
I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
was:
The 26.class.gslice test fails with the 162 assertions:
{noformat}
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 1: expected 1, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 2: expected 2, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
# ASSERTION (S7) (5 lines):
# TEXT: mismatch at 0, index 3: expected 3, got 0
...
{noformat}
I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
> [MSVC] 26.class.gslice test fails
> ---------------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Priority: Minor
> Fix For: 4.2.2
>
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (STDCXX-901) 26.class.gslice test
fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12602140#action_12602140 ]
vitek edited comment on STDCXX-901 at 6/4/08 1:50 AM:
-------------------------------------------------------------
Changelog removed.
was (Author: vitek):
{noformat}
2008-06-03 Travis Vitek <vi...@roguewave.com>
STDCXX-901
* include/valarray (gslice_array<>::operator=): Check to see
if slice is empty before attempting to iterate over it. Check
that slice is reset only after getting the first index.
(gslice_array<>::operator*=): Ditto.
(gslice_array<>::operator/=): Ditto.
(gslice_array<>::operator+=): Ditto.
(gslice_array<>::operator-=): Ditto.
(gslice_array<>::operator%=): Ditto.
(gslice_array<>::operator^=): Ditto.
(gslice_array<>::operator&=): Ditto.
(gslice_array<>::operator|=): Ditto.
(gslice_array<>::operator<<=): Ditto.
(gslice_array<>::operator>>=): Ditto.
(valarray<>::ctor): Ditto.
(valarray<>::operator=): Ditto.
(gslice::ind_numb): Correctly calculate number of indexes
given an array of lengths.
* tests/numerics/26.gslice.array.cassign.cpp: New test for
gslice computed assignment operators.
{noformat}
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
> Time Spent: 8h
> Remaining Estimate: 0h
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-901) 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Travis Vitek updated STDCXX-901:
--------------------------------
Summary: 26.class.gslice test fails (was: [MSVC] 26.class.gslice test fails)
Test fails 162 assertions on all tested platforms.
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-901) 26.class.gslice test fails
Posted by "Travis Vitek (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-901?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Travis Vitek updated STDCXX-901:
--------------------------------
Attachment: (was: stdcxx-901.patch)
> 26.class.gslice test fails
> --------------------------
>
> Key: STDCXX-901
> URL: https://issues.apache.org/jira/browse/STDCXX-901
> Project: C++ Standard Library
> Issue Type: Bug
> Components: Tests
> Affects Versions: 4.2.0, 4.2.1
> Environment: MSVC
> Reporter: Farid Zaripov
> Assignee: Travis Vitek
> Priority: Minor
> Fix For: 4.2.2
>
> Time Spent: 8h
> Remaining Estimate: 0h
>
> The 26.class.gslice test fails with the 162 similar assertions:
> {noformat}
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 1: expected 1, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 2: expected 2, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> # ASSERTION (S7) (5 lines):
> # TEXT: mismatch at 0, index 3: expected 3, got 0
> ...
> {noformat}
> I'm not found the opened issue for gslice, so maybe this is another bug in gslice class or maybe the test itself is incorrect.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.