public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/63332] New: problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
@ 2014-09-22 13:35 richard at netbsd dot org
  2014-09-22 13:37 ` [Bug testsuite/63332] " richard at netbsd dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: richard at netbsd dot org @ 2014-09-22 13:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

            Bug ID: 63332
           Summary: problem with VERIFY in
                    ext/random/k_distribution/operators/serialize.cc
                    execution test
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: testsuite
          Assignee: unassigned at gcc dot gnu.org
          Reporter: richard at netbsd dot org

Created attachment 33531
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33531&action=edit
testsuite module updated with couts showing issue is with VERIFY

Working with gcc49 on SunOS 5.11 i386 (Omnios) and pkgsrc (32-bit trunk)
I came across the following failure:

FAIL: ext/random/k_distribution/operators/serialize.cc execution test

scratching my head a bit, I added some outputs and found that the problem is
with VERIFY and not with the functions being tested.

here is my output with the attached (modified) serialize.cc:
$ ./a.out
u: 2.00000000000000000e+00 1.50000000000000000e+00 3.00000000000000000e+00
2.00000000000000000e+00 5.00000000000000000e-01 0.00000000000000000e+00
1.00000000000000000e+00 1 -1.08681804426135680e+00 3.00000000000000000e+00
5.00000000000000000e-01 0.00000000000000000e+00 1.00000000000000000e+00 1
1.89131873404367808e-01
v: 2.00000000000000000e+00 1.50000000000000000e+00 3.00000000000000000e+00
2.00000000000000000e+00 5.00000000000000000e-01 0.00000000000000000e+00
1.00000000000000000e+00 1 -1.08681804426135680e+00 3.00000000000000000e+00
5.00000000000000000e-01 0.00000000000000000e+00 1.00000000000000000e+00 1
1.89131873404367808e-01
Assertion failed: u == v, file serialize.cc, line 48, function test01
Abort (core dumped)


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug testsuite/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
@ 2014-09-22 13:37 ` richard at netbsd dot org
  2014-09-25 10:06 ` redi at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: richard at netbsd dot org @ 2014-09-22 13:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #1 from Richard PALO <richard at netbsd dot org> ---
BTW, I'm curious if the problem is related to float rounding in I/O, as in
FAIL: ext/random/hypergeometric_distribution/operators/values.cc execution test


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug testsuite/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
  2014-09-22 13:37 ` [Bug testsuite/63332] " richard at netbsd dot org
@ 2014-09-25 10:06 ` redi at gcc dot gnu.org
  2014-09-25 10:14 ` [Bug libstdc++/63332] " redi at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-09-25 10:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, there must be some difference that isn't visible in the serialized output,
which would imply the values fail to do a proper round trip, so we're not
writing them with enough precision.

Maybe we should use hexfloat output for serializing distributions, not decimal.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
  2014-09-22 13:37 ` [Bug testsuite/63332] " richard at netbsd dot org
  2014-09-25 10:06 ` redi at gcc dot gnu.org
@ 2014-09-25 10:14 ` redi at gcc dot gnu.org
  2014-09-25 15:30 ` richard at netbsd dot org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-09-25 10:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|testsuite                   |libstdc++
            Version|unknown                     |4.9.0

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
The issue is not with VERIFY, which is just an assertion and so all it has to
do is check for true or false.

The assertion fails because distribution's operator== is saying the
distributions are not equal, so either the operator== is buggy (but that would
probably fail on all platforms) or the issue is in the serialization or
deserialization.

Could you please add -fno-access-control to the "dg-options" flags at the top
of the file and replace the VERIFY check with the following:

std::cout << (u._M_param._M_lambda == v._M_param._M_lambda) << '\n';
std::cout << (u._M_param._M_mu == v._M_param._M_mu) << '\n';
std::cout << (u._M_param._M_nu == v._M_param._M_nu) << '\n';
std::cout << (u._M_gd1 == v._M_gd1) << '\n';
std::cout << (u._M_gd2 == v._M_gd2) << '\n';


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (2 preceding siblings ...)
  2014-09-25 10:14 ` [Bug libstdc++/63332] " redi at gcc dot gnu.org
@ 2014-09-25 15:30 ` richard at netbsd dot org
  2014-09-25 16:04 ` richard at netbsd dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: richard at netbsd dot org @ 2014-09-25 15:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #4 from Richard PALO <richard at netbsd dot org> ---
>>Could you please add -fno-access-control to the "dg-options" flags at the top
>>of the file and replace the VERIFY check with the following:

>>std::cout << (u._M_param._M_lambda == v._M_param._M_lambda) << '\n';
>>std::cout << (u._M_param._M_mu == v._M_param._M_mu) << '\n';
>>std::cout << (u._M_param._M_nu == v._M_param._M_nu) << '\n';
>>std::cout << (u._M_gd1 == v._M_gd1) << '\n';
>>std::cout << (u._M_gd2 == v._M_gd2) << '\n';

Hi, seems I needed to add an #include <iostream>
but anyway, the output is:
1
1
1
1
0


BTW, I did this manually as I'm not very proficient with `runtest`, isn't there
a shortcut to somehow run only this test?


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (3 preceding siblings ...)
  2014-09-25 15:30 ` richard at netbsd dot org
@ 2014-09-25 16:04 ` richard at netbsd dot org
  2014-09-25 16:08 ` richard at netbsd dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: richard at netbsd dot org @ 2014-09-25 16:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #5 from Richard PALO <richard at netbsd dot org> ---
By the way, in gdb, here are the complete u and v variables after
serialisation:

gdb) p u
$1 = {_M_param = {_M_lambda = 2, _M_mu = 1.5, _M_nu = 3}, _M_gd1 = {
    _M_param = {_M_alpha = 2, _M_beta = 0.5, _M_malpha = 2, 
      _M_a2 = 0.25819888974716108}, _M_nd = {_M_param = {_M_mean = 0, 
        _M_stddev = 1}, _M_saved = -1.0868180442613568, 
      _M_saved_available = true}}, _M_gd2 = {_M_param = {_M_alpha = 3, 
      _M_beta = 0.5, _M_malpha = 3, _M_a2 = 0.20412414523193152}, _M_nd = {
      _M_param = {_M_mean = 0, _M_stddev = 1}, _M_saved = 0.18913187340436784, 
      _M_saved_available = true}}}
(gdb) p v
$2 = {_M_param = {_M_lambda = 2, _M_mu = 1.5, _M_nu = 3}, _M_gd1 = {
    _M_param = {_M_alpha = 2, _M_beta = 0.5, _M_malpha = 2, 
      _M_a2 = 0.25819888974716108}, _M_nd = {_M_param = {_M_mean = 0, 
        _M_stddev = 1}, _M_saved = -1.0868180442613568, 
      _M_saved_available = true}}, _M_gd2 = {_M_param = {_M_alpha = 3, 
      _M_beta = 0.5, _M_malpha = 3, _M_a2 = 0.20412414523193152}, _M_nd = {
      _M_param = {_M_mean = 0, _M_stddev = 1}, _M_saved = 0.1891318734043678, 
      _M_saved_available = true}}}

I notice _M_saved in v is truncated by 1 (the trailing '4')...
that is, 16 and not 17 digits after the decimal are copied.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (4 preceding siblings ...)
  2014-09-25 16:04 ` richard at netbsd dot org
@ 2014-09-25 16:08 ` richard at netbsd dot org
  2014-09-25 16:18 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: richard at netbsd dot org @ 2014-09-25 16:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #6 from Richard PALO <richard at netbsd dot org> ---
sorry, I meant to say M_gd2._M_saved


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (5 preceding siblings ...)
  2014-09-25 16:08 ` richard at netbsd dot org
@ 2014-09-25 16:18 ` redi at gcc dot gnu.org
  2014-11-16  7:05 ` richard at netbsd dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-09-25 16:18 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Aha, so that's the culprit. I really think we should be outputting in an exact
format, not via conversion to/from decimal.

> BTW, I did this manually as I'm not very proficient with `runtest`, isn't
> there a shortcut to somehow run only this test?

Yep, in the $target/libstdc++-v3 build dir:

make check
RUNTESTFLAGS=conformance.exp=ext/random/k_distribution/operators/serialize.cc

You can also use shell wildcards e.g. RUNTESTFLAGS=conformance.exp=ext/*


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (6 preceding siblings ...)
  2014-09-25 16:18 ` redi at gcc dot gnu.org
@ 2014-11-16  7:05 ` richard at netbsd dot org
  2014-11-16 14:35 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: richard at netbsd dot org @ 2014-11-16  7:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #8 from Richard PALO <richard at netbsd dot org> ---
As far as the test as it currently is written, I now get:
>PASS: ext/random/k_distribution/operators/serialize.cc (test for excess errors)
>PASS: ext/random/k_distribution/operators/serialize.cc execution test
after the illumos platform fix : https://www.illumos.org/issues/5224

So this can probably be closed.  Thanks


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (7 preceding siblings ...)
  2014-11-16  7:05 ` richard at netbsd dot org
@ 2014-11-16 14:35 ` redi at gcc dot gnu.org
  2020-10-08 14:05 ` redi at gcc dot gnu.org
  2020-10-11 11:04 ` ro at CeBiTec dot Uni-Bielefeld.DE
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2014-11-16 14:35 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Thanks for the update. I still wonder if it would be better to write the
floating point values out using hexadecimal notation.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (8 preceding siblings ...)
  2014-11-16 14:35 ` redi at gcc dot gnu.org
@ 2020-10-08 14:05 ` redi at gcc dot gnu.org
  2020-10-11 11:04 ` ro at CeBiTec dot Uni-Bielefeld.DE
  10 siblings, 0 replies; 12+ messages in thread
From: redi at gcc dot gnu.org @ 2020-10-08 14:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |i386-pc-solaris2.11
                 CC|                            |ro at gcc dot gnu.org
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2020-10-08

--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Looks like this is still failing for solaris 11:
https://gcc.gnu.org/pipermail/gcc-testresults/2020-October/610818.html

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug libstdc++/63332] problem with VERIFY in  ext/random/k_distribution/operators/serialize.cc execution test
  2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
                   ` (9 preceding siblings ...)
  2020-10-08 14:05 ` redi at gcc dot gnu.org
@ 2020-10-11 11:04 ` ro at CeBiTec dot Uni-Bielefeld.DE
  10 siblings, 0 replies; 12+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2020-10-11 11:04 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63332

--- Comment #11 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
> --- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> Looks like this is still failing for solaris 11:
> https://gcc.gnu.org/pipermail/gcc-testresults/2020-October/610818.html

True.  However, the fact that the test only FAILs on Solaris 11.4/x86,
but not on 11.3 nor on sparc, makes me wonder if this might not be
another instances of PR fortran/94324.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-10-11 11:04 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-22 13:35 [Bug testsuite/63332] New: problem with VERIFY in ext/random/k_distribution/operators/serialize.cc execution test richard at netbsd dot org
2014-09-22 13:37 ` [Bug testsuite/63332] " richard at netbsd dot org
2014-09-25 10:06 ` redi at gcc dot gnu.org
2014-09-25 10:14 ` [Bug libstdc++/63332] " redi at gcc dot gnu.org
2014-09-25 15:30 ` richard at netbsd dot org
2014-09-25 16:04 ` richard at netbsd dot org
2014-09-25 16:08 ` richard at netbsd dot org
2014-09-25 16:18 ` redi at gcc dot gnu.org
2014-11-16  7:05 ` richard at netbsd dot org
2014-11-16 14:35 ` redi at gcc dot gnu.org
2020-10-08 14:05 ` redi at gcc dot gnu.org
2020-10-11 11:04 ` ro at CeBiTec dot Uni-Bielefeld.DE

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).