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 21:55:27 UTC
[jira] Created: (STDCXX-315) std::valarray transcendentals use
uninitialized storage
std::valarray transcendentals use uninitialized storage
-------------------------------------------------------
Key: STDCXX-315
URL: https://issues.apache.org/jira/browse/STDCXX-315
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 expected to produce no output. When compiled with the latest trunk it produces output indicating that the valarray transcendental functions use uninitialized storage.
$ cat t.cpp && make t && ./t
#include <cstdio>
#include <valarray>
bool pass = true;
struct S {
const S* const self;
S (): self (this) { }
S (const S &s): self (this) { pass = pass && &s == s.self; }
S (double): self (this) { }
~S () { pass = pass && this == self; }
operator double () const { pass = pass && this == self; return 1.0; }
void operator=(const S &s) const {
pass = pass && &s == s.self && this == self;
}
S operator- () const { pass = pass && this == self; return *this; }
bool operator< (const S &s) const {
pass = pass && &s == s.self && this == self;
return false;
}
};
int main ()
{
const S s;
const std::valarray<S> a (2);
#define TEST(fun, args) \
pass = true; \
fun args; \
if (!pass) \
std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
TEST (abs, (a));
TEST (acos, (a));
TEST (asin, (a));
TEST (atan, (a));
TEST (atan2, (a, a));
TEST (atan2, (a, s));
TEST (atan2, (s, a));
TEST (cos, (a));
TEST (cosh, (a));
TEST (exp, (a));
TEST (log, (a));
TEST (log10, (a));
TEST (pow, (a, a));
TEST (pow, (a, s));
TEST (pow, (s, a));
TEST (sin, (a));
TEST (sinh, (a));
TEST (sqrt, (a));
TEST (tan, (a));
TEST (tanh, (a));
}
gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
std::abs uses uninitialized storage
std::acos uses uninitialized storage
std::asin uses uninitialized storage
std::atan uses uninitialized storage
std::atan2 uses uninitialized storage
std::atan2 uses uninitialized storage
std::atan2 uses uninitialized storage
std::cos uses uninitialized storage
std::cosh uses uninitialized storage
std::exp uses uninitialized storage
std::log uses uninitialized storage
std::log10 uses uninitialized storage
std::pow uses uninitialized storage
std::pow uses uninitialized storage
std::pow uses uninitialized storage
std::sin uses uninitialized storage
std::sinh uses uninitialized storage
std::sqrt uses uninitialized storage
std::tan uses uninitialized storage
std::tanh uses uninitialized storage
--
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] Closed: (STDCXX-315) std::valarray transcendentals use
uninitialized storage
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor closed STDCXX-315.
-------------------------------
Resolution: Fixed
Fix (http://svn.apache.org/viewvc?rev=579408&view=rev) verified in a manual test.
Regression test committed here:http://svn.apache.org/viewvc?rev=579403&view=rev
Closing.
> std::valarray transcendentals use uninitialized storage
> -------------------------------------------------------
>
> Key: STDCXX-315
> URL: https://issues.apache.org/jira/browse/STDCXX-315
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 26. Numerics
> Affects Versions: 4.1.2, 4.1.3, 4.1.4
> Environment: all
> Reporter: Martin Sebor
> Assignee: Martin Sebor
> Priority: Minor
> Fix For: 4.2
>
>
> The program below is expected to produce no output. When compiled with the latest trunk it produces output indicating that the valarray transcendental functions use uninitialized storage.
> $ cat t.cpp && make t && ./t
> #include <cstdio>
> #include <valarray>
> bool pass = true;
> struct S {
> const S* const self;
> S (): self (this) { }
> S (const S &s): self (this) { pass = pass && &s == s.self; }
> S (double): self (this) { }
> ~S () { pass = pass && this == self; }
> operator double () const { pass = pass && this == self; return 1.0; }
> void operator=(const S &s) const {
> pass = pass && &s == s.self && this == self;
> }
> S operator- () const { pass = pass && this == self; return *this; }
> bool operator< (const S &s) const {
> pass = pass && &s == s.self && this == self;
> return false;
> }
> };
> int main ()
> {
> const S s;
> const std::valarray<S> a (2);
> #define TEST(fun, args) \
> pass = true; \
> fun args; \
> if (!pass) \
> std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
> TEST (abs, (a));
> TEST (acos, (a));
> TEST (asin, (a));
> TEST (atan, (a));
> TEST (atan2, (a, a));
> TEST (atan2, (a, s));
> TEST (atan2, (s, a));
> TEST (cos, (a));
> TEST (cosh, (a));
> TEST (exp, (a));
> TEST (log, (a));
> TEST (log10, (a));
> TEST (pow, (a, a));
> TEST (pow, (a, s));
> TEST (pow, (s, a));
> TEST (sin, (a));
> TEST (sinh, (a));
> TEST (sqrt, (a));
> TEST (tan, (a));
> TEST (tanh, (a));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> std::abs uses uninitialized storage
> std::acos uses uninitialized storage
> std::asin uses uninitialized storage
> std::atan uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::cos uses uninitialized storage
> std::cosh uses uninitialized storage
> std::exp uses uninitialized storage
> std::log uses uninitialized storage
> std::log10 uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::sin uses uninitialized storage
> std::sinh uses uninitialized storage
> std::sqrt uses uninitialized storage
> std::tan uses uninitialized storage
> std::tanh uses uninitialized storage
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (STDCXX-315) std::valarray transcendentals use
uninitialized storage
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor updated STDCXX-315:
--------------------------------
Severity: Runtime Error
Priority: Minor (was: Major)
Affects Version/s: 4.1.4
The Rogue Wave 4.1.4 was affected as well.
Lowered Priority to Minor since the standard doesn't specify the behavior of std::valarray for user-defined types.
> std::valarray transcendentals use uninitialized storage
> -------------------------------------------------------
>
> Key: STDCXX-315
> URL: https://issues.apache.org/jira/browse/STDCXX-315
> Project: C++ Standard Library
> Issue Type: Bug
> Components: 26. Numerics
> Affects Versions: 4.1.2, 4.1.3, 4.1.4
> Environment: all
> Reporter: Martin Sebor
> Assignee: Martin Sebor
> Priority: Minor
> Fix For: 4.2
>
>
> The program below is expected to produce no output. When compiled with the latest trunk it produces output indicating that the valarray transcendental functions use uninitialized storage.
> $ cat t.cpp && make t && ./t
> #include <cstdio>
> #include <valarray>
> bool pass = true;
> struct S {
> const S* const self;
> S (): self (this) { }
> S (const S &s): self (this) { pass = pass && &s == s.self; }
> S (double): self (this) { }
> ~S () { pass = pass && this == self; }
> operator double () const { pass = pass && this == self; return 1.0; }
> void operator=(const S &s) const {
> pass = pass && &s == s.self && this == self;
> }
> S operator- () const { pass = pass && this == self; return *this; }
> bool operator< (const S &s) const {
> pass = pass && &s == s.self && this == self;
> return false;
> }
> };
> int main ()
> {
> const S s;
> const std::valarray<S> a (2);
> #define TEST(fun, args) \
> pass = true; \
> fun args; \
> if (!pass) \
> std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
> TEST (abs, (a));
> TEST (acos, (a));
> TEST (asin, (a));
> TEST (atan, (a));
> TEST (atan2, (a, a));
> TEST (atan2, (a, s));
> TEST (atan2, (s, a));
> TEST (cos, (a));
> TEST (cosh, (a));
> TEST (exp, (a));
> TEST (log, (a));
> TEST (log10, (a));
> TEST (pow, (a, a));
> TEST (pow, (a, s));
> TEST (pow, (s, a));
> TEST (sin, (a));
> TEST (sinh, (a));
> TEST (sqrt, (a));
> TEST (tan, (a));
> TEST (tanh, (a));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> std::abs uses uninitialized storage
> std::acos uses uninitialized storage
> std::asin uses uninitialized storage
> std::atan uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::cos uses uninitialized storage
> std::cosh uses uninitialized storage
> std::exp uses uninitialized storage
> std::log uses uninitialized storage
> std::log10 uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::sin uses uninitialized storage
> std::sinh uses uninitialized storage
> std::sqrt uses uninitialized storage
> std::tan uses uninitialized storage
> std::tanh uses uninitialized storage
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (STDCXX-315) std::valarray transcendentals use
uninitialized storage
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor resolved STDCXX-315.
---------------------------------
Resolution: Fixed
Fixed with the referenced change. Needs a test.
> std::valarray transcendentals use uninitialized storage
> -------------------------------------------------------
>
> Key: STDCXX-315
> URL: https://issues.apache.org/jira/browse/STDCXX-315
> 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 expected to produce no output. When compiled with the latest trunk it produces output indicating that the valarray transcendental functions use uninitialized storage.
> $ cat t.cpp && make t && ./t
> #include <cstdio>
> #include <valarray>
> bool pass = true;
> struct S {
> const S* const self;
> S (): self (this) { }
> S (const S &s): self (this) { pass = pass && &s == s.self; }
> S (double): self (this) { }
> ~S () { pass = pass && this == self; }
> operator double () const { pass = pass && this == self; return 1.0; }
> void operator=(const S &s) const {
> pass = pass && &s == s.self && this == self;
> }
> S operator- () const { pass = pass && this == self; return *this; }
> bool operator< (const S &s) const {
> pass = pass && &s == s.self && this == self;
> return false;
> }
> };
> int main ()
> {
> const S s;
> const std::valarray<S> a (2);
> #define TEST(fun, args) \
> pass = true; \
> fun args; \
> if (!pass) \
> std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
> TEST (abs, (a));
> TEST (acos, (a));
> TEST (asin, (a));
> TEST (atan, (a));
> TEST (atan2, (a, a));
> TEST (atan2, (a, s));
> TEST (atan2, (s, a));
> TEST (cos, (a));
> TEST (cosh, (a));
> TEST (exp, (a));
> TEST (log, (a));
> TEST (log10, (a));
> TEST (pow, (a, a));
> TEST (pow, (a, s));
> TEST (pow, (s, a));
> TEST (sin, (a));
> TEST (sinh, (a));
> TEST (sqrt, (a));
> TEST (tan, (a));
> TEST (tanh, (a));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> std::abs uses uninitialized storage
> std::acos uses uninitialized storage
> std::asin uses uninitialized storage
> std::atan uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::cos uses uninitialized storage
> std::cosh uses uninitialized storage
> std::exp uses uninitialized storage
> std::log uses uninitialized storage
> std::log10 uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::sin uses uninitialized storage
> std::sinh uses uninitialized storage
> std::sqrt uses uninitialized storage
> std::tan uses uninitialized storage
> std::tanh uses uninitialized storage
--
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] Reopened: (STDCXX-315) std::valarray transcendentals use
uninitialized storage
Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/STDCXX-315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Sebor reopened STDCXX-315:
---------------------------------
Reopening -- the modified test case below still shows 2 failures:
std::atan2 uses uninitialized storage
std::atan2 uses uninitialized storage
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <new>
#include <valarray>
void* operator new (std::size_t s) throw (std::bad_alloc)
{
return std::memset (std::malloc (s), 0x55, s);
}
bool pass = true;
struct S {
const S* const self;
S (): self (this) { }
S (const S &s): self (this) { pass = pass && &s == s.self; }
S (double): self (this) { }
~S () { pass = pass && this == self; }
operator double () const { pass = pass && this == self; return 1.0; }
void operator=(const S &s) const {
pass = pass && &s == s.self && this == self;
}
S operator- () const { pass = pass && this == self; return *this; }
bool operator< (const S &s) const {
pass = pass && &s == s.self && this == self;
return false;
}
};
int main ()
{
const S s;
const std::valarray<S> a (2);
#define TEST(fun, args) \
pass = true; \
fun args; \
if (!pass) \
std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
TEST (abs, (a));
TEST (acos, (a));
TEST (asin, (a));
TEST (atan, (a));
TEST (atan2, (a, a));
TEST (atan2, (a, s));
TEST (atan2, (s, a));
TEST (cos, (a));
TEST (cosh, (a));
TEST (exp, (a));
TEST (log, (a));
TEST (log10, (a));
TEST (pow, (a, a));
TEST (pow, (a, s));
TEST (pow, (s, a));
TEST (sin, (a));
TEST (sinh, (a));
TEST (sqrt, (a));
TEST (tan, (a));
TEST (tanh, (a));
}
> std::valarray transcendentals use uninitialized storage
> -------------------------------------------------------
>
> Key: STDCXX-315
> URL: https://issues.apache.org/jira/browse/STDCXX-315
> 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 expected to produce no output. When compiled with the latest trunk it produces output indicating that the valarray transcendental functions use uninitialized storage.
> $ cat t.cpp && make t && ./t
> #include <cstdio>
> #include <valarray>
> bool pass = true;
> struct S {
> const S* const self;
> S (): self (this) { }
> S (const S &s): self (this) { pass = pass && &s == s.self; }
> S (double): self (this) { }
> ~S () { pass = pass && this == self; }
> operator double () const { pass = pass && this == self; return 1.0; }
> void operator=(const S &s) const {
> pass = pass && &s == s.self && this == self;
> }
> S operator- () const { pass = pass && this == self; return *this; }
> bool operator< (const S &s) const {
> pass = pass && &s == s.self && this == self;
> return false;
> }
> };
> int main ()
> {
> const S s;
> const std::valarray<S> a (2);
> #define TEST(fun, args) \
> pass = true; \
> fun args; \
> if (!pass) \
> std::fprintf (stderr, "std::%s uses uninitialized storage\n", #fun)
> TEST (abs, (a));
> TEST (acos, (a));
> TEST (asin, (a));
> TEST (atan, (a));
> TEST (atan2, (a, a));
> TEST (atan2, (a, s));
> TEST (atan2, (s, a));
> TEST (cos, (a));
> TEST (cosh, (a));
> TEST (exp, (a));
> TEST (log, (a));
> TEST (log10, (a));
> TEST (pow, (a, a));
> TEST (pow, (a, s));
> TEST (pow, (s, a));
> TEST (sin, (a));
> TEST (sinh, (a));
> TEST (sqrt, (a));
> TEST (tan, (a));
> TEST (tanh, (a));
> }
> gcc -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/gcc-4.1.0-11s/include -I/build/sebor/dev/stdlib/examples/include -pedantic -nostdinc++ -g -W -Wall -Wcast-qual -Winline -Wshadow -Wwrite-strings -Wno-long-long t.cpp
> gcc t.o -o t -L/build/sebor/gcc-4.1.0-11s/lib -lstd11s -lsupc++ -lm
> std::abs uses uninitialized storage
> std::acos uses uninitialized storage
> std::asin uses uninitialized storage
> std::atan uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::atan2 uses uninitialized storage
> std::cos uses uninitialized storage
> std::cosh uses uninitialized storage
> std::exp uses uninitialized storage
> std::log uses uninitialized storage
> std::log10 uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::pow uses uninitialized storage
> std::sin uses uninitialized storage
> std::sinh uses uninitialized storage
> std::sqrt uses uninitialized storage
> std::tan uses uninitialized storage
> std::tanh uses uninitialized storage
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.