Bug #1794
Strange bug: demo-Osaka2015
Description
I observe differing output with the test demo-Osaka2015
when compiled using clang
and with debugging active.
The problem seems not to arise with g++
. Platform is Linux (Ubuntu 23.04).
History
#1 Updated by John Abbott about 1 month ago
My g++
reports version info gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1~22.04)
My clang reports version info Ubuntu clang version 14.0.0-1ubuntu1.1
.
Is this bug reproducible on other platforms?
My current guess is that a random number generator behaves differently... but I've not yet looked at the code!
#2 Updated by John Abbott about 1 month ago
- Status changed from New to In Progress
- % Done changed from 0 to 10
The cause is not too surprising: demo-Osaka2015.cocoa5
uses a random example (on line 72).
Evidently, with debugging active, some random numbers are used internally, and this affects the publicly visible sequence.
BTW I have verified that the problem exists also when compiling with g++
in debug mode. Curiously, the .cocoa5
files contains a comment saying what the random values are... but the comment is not the same as what is actually generated...
Ideally we would replace the randomness by specific "random" numbers.
#3 Updated by Anna Maria Bigatti about 1 month ago
John Abbott wrote:
The cause is not too surprising:
demo-Osaka2015.cocoa5
uses a random example (on line 72).
Evidently, with debugging active, some random numbers are used internally, and this affects the publicly visible sequence.BTW I have verified that the problem exists also when compiling with
g++
in debug mode. Curiously, the.cocoa5
files contains a comment saying what the random values are... but the comment is not the same as what is actually generated...
For some reason (I cannot remember, but I think I knew it when it first happened, recently) the random values I'm getting now differ from the original version of the test (in the comment). I didn't think it depended on clang, so I changed the expected output.
Ideally we would replace the randomness by specific "random" numbers.
OK, I agree, especially if that changes with debugging on/off. Should I do it?
#4 Updated by John Abbott 8 days ago
- Status changed from In Progress to Resolved
- % Done changed from 10 to 70
random
is called harmlessly in exbugs.cocoa5
.
We should check ErrMesg.cocoa5
and test-ApproxSolve.cocoa5
; it is not clear to me that random
is used harmlessly in these files!!