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 (JIRA)" <ji...@apache.org> on 2007/01/05 23:34:27 UTC
[jira] Created: (STDCXX-316) std::valarray::cshift uses
uninitialized storage
std::valarray::cshift uses uninitialized storage
------------------------------------------------
Key: STDCXX-316
URL: https://issues.apache.org/jira/browse/STDCXX-316
Project: C++ Standard Library
Issue Type: Bug
Components: 26. Numerics
Affects Versions: 4.1.2, 4.1.3
Environment: all
Reporter: Martin Sebor
Assigned To: Martin Sebor
Fix For: 4.2
The program below is designed to detect memory corruption (such as the use of uninitialized storage) in valarray. When compiled with the latest trunk it aborts at runtime.
$ cat t.cpp && nice gmake t && ./t
#include <cassert>
#include <valarray>
struct S {
const S* const self;
S (): self (this) { }
S (const S &s): self (this) { assert (&s == s.self); }
~S () { assert (this == self); }
void operator= (const S &s) { assert (this == self && &s == s.self); }
};
int main ()
{
const std::valarray<S> a (2);
a.cshift (1);
}
aCC -c -I/nfs/devco/sebor/dev/stdlib/include/ansi -I/usr/include -D_RWSTDDEBUG -mt -D_RWSTD_USE_CONFIG -I/nfs/devco/sebor/dev/stdlib/include -I/build/sebor/aCC-3.70-15S/include -I/nfs/devco/sebor/dev/stdlib/examples/include -Aa +nostl -g +d +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849 t.cpp
aCC t.o -o t -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings -mt +DD64 -L/build/sebor/aCC-3.70-15S/lib -lstd15S -lm
Assertion failed: this == self && &s == s.self, file t.cpp, line 10
ABORT instruction (core dumped)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] Resolved: (STDCXX-316) std::valarray::cshift uses
uninitialized storage
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-316?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor resolved STDCXX-316.
---------------------------------
Resolution: Fixed
Fixed by the referenced patch. Test suite still needs to be updated.
> std::valarray::cshift uses uninitialized storage
> ------------------------------------------------
>
> Key: STDCXX-316
> URL: https://issues.apache.org/jira/browse/STDCXX-316
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 26. Numerics
> Affects Versions: 4.1.3, 4.1.2
> Environment: all
> Reporter: Martin Sebor
> Assigned To: Martin Sebor
> Fix For: 4.2
>
>
> The program below is designed to detect memory corruption (such as the use of uninitialized storage) in valarray. When compiled with the latest trunk it aborts at runtime.
> $ cat t.cpp && nice gmake t && ./t
> #include <cassert>
> #include <valarray>
> struct S {
> const S* const self;
> S (): self (this) { }
> S (const S &s): self (this) { assert (&s == s.self); }
> ~S () { assert (this == self); }
> void operator= (const S &s) { assert (this == self && &s == s.self); }
> };
> int main ()
> {
> const std::valarray<S> a (2);
> a.cshift (1);
> }
> aCC -c -I/nfs/devco/sebor/dev/stdlib/include/ansi -I/usr/include -D_RWSTDDEBUG -mt -D_RWSTD_USE_CONFIG -I/nfs/devco/sebor/dev/stdlib/include -I/build/sebor/aCC-3.70-15S/include -I/nfs/devco/sebor/dev/stdlib/examples/include -Aa +nostl -g +d +DD64 +w +W392 +W655 +W684 +W818 +W819 +W849 t.cpp
> aCC t.o -o t -Aa +nostl -Wl,+s -Wl,+vnocompatwarnings -mt +DD64 -L/build/sebor/aCC-3.70-15S/lib -lstd15S -lm
> Assertion failed: this == self && &s == s.self, file t.cpp, line 10
> ABORT instruction (core dumped)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira