-- Bug description --The grand function can fail on 64 bits machines.Run the script below on a 64 bits Linux/Ubuntu machine with Scilab 5.3.0-beta-5:* mt, clcg2, clcg4: work* fsultra, kiss, urand: fail# C [libscirandlib.so+0xbde9] snorm_+0x179-- Scilab error message --michael@michael-desktop:~/Bureau/scilab-5.3.0-beta-5/bin$ ## A fatal error has been detected by the Java Runtime Environment:## SIGSEGV (0xb) at pc=0x00007f54f41b6de9, pid=4782, tid=140003652069136## JRE version: 6.0_18-b07# Java VM: Java HotSpot(TM) 64-Bit Server VM (16.0-b13 mixed mode linux-amd64 )# Problematic frame:# C [libscirandlib.so+0xbde9] snorm_+0x179## An error report file with more information is saved as:# /home/michael/Bureau/scilab-5.3.0-beta-5/bin/hs_err_pid4782.log## If you would like to submit a bug report, please visit:# http://java.sun.com/webapps/bugreport/crash.jsp# The crash happened outside the Java Virtual Machine in native code.# See problematic frame for where to report the bug.#Aborted-- How to reproduce the bug --grand ( "setgen" , "kiss" ); // FAILSr = grand(100,100,"nor",0,1);m = mean(r);//grand ( "setgen" , "urand" ); // FAILSr = grand(100,100,"nor",0,1);m = mean(r);//grand ( "setgen" , "fsultra" ); // FAILSr = grand(100,100,"nor",0,1);m = mean(r);//grand ( "setgen" , "mt" ); // OKr = grand(100,100,"nor",0,1);m = mean(r);//grand ( "setgen" , "clcg2" ); // OKr = grand(100,100,"nor",0,1);m = mean(r);//grand ( "setgen" , "clcg4" ); // OKr = grand(100,100,"nor",0,1);m = mean(r);
Designs
Child items ...
Show closed items
Linked items 0
Link issues together to show that they're related or that one is blocking others.
Learn more.
It may be caused by the use of "long int" and "unsigned long int" in the sources code:
sizeof(unsigned long int) = 4 bytes on 32 bits machines, 8 bytes on 64 bits machines
sizeof(long int) = 4 bytes on 32 bits machines, 8 bytes on 64 bits machines
That is wrong, in the sense that not all 64 bits machines are associated with a long int made of 8 bytes. Here are some results for a Windows 64 bits machine:
short int : 2 bytes
int : 4 bytes
long int : 4 bytes
unsigned int : 4 bytes
unsigned long int : 4 bytes
long long int : 8 bytes
unsigned long long int : 8 bytes
It may be caused by the use of "long int" and "unsigned long int" in the sources code:
sizeof(unsigned long int) = 4 bytes on 32 bits machines, 8 bytes on 64 bits machines
sizeof(long int) = 4 bytes on 32 bits machines, 8 bytes on 64 bits machines
Linux 32 bits (gcc) - long int = 4 bytes
Linux 64 bits (gcc) - long int = 8 bytes
Windows 32 bits (Visual) - long int = 4 bytes
Windows 64 bits (Visual) - long int = 4 bytes
The remaining trouble is : why does the original code uses "long int". I guess that this is not necessary.
The unit tests do not check the output of the uniform random number generators.
There is no example in the help page of grand. The grand function has too many completely separated features: producing the examples would create an extremely lengthy help page, which is already too long.