On 13 May 2017 at 17:24, Bernhard Übelacker wrote:
| Hello,
| just tried to reproduce the crash I came to following stack:
| 
| 
| gdb -q --args dieharder -g 207 -a
| 
| Program received signal SIGSEGV, Segmentation fault.
| gsl_rng_get (r=0x0) at ../gsl/gsl_rng.h:161
| 161       return (r->type->get) (r->state);
| (gdb) bt
| #0  gsl_rng_get (r=0x0) at ../gsl/gsl_rng.h:161
| #1  0x00007ffff7b5dcc6 in XOR_get (vstate=0x633030) at rng_XOR.c:42
| #2  0x00007ffff7b59ed0 in rgb_timing (test=test@entry=0x635ac0, 
timing=timing@entry=0x7fffffffdb90) at rgb_timing.c:38
| #3  0x0000000000405889 in time_rng () at time_rng.c:38
| #4  0x000000000040252f in select_rng (gennum=<optimized out>, 
genname=genname@entry=0x60a7c0 <generator_name> "", initial_seed=<optimized 
out>) at choose_rng.c:252
| #5  0x000000000040262a in choose_rng () at choose_rng.c:60
| #6  0x0000000000402141 in main (argc=4, argv=0x7fffffffdcf8) at dieharder.c:71
| 
| 
| gsl_rng_get/XOR_get:42 relies here to have state->grngs[1] initialized.
| 
| 
| I tried to follow it and got to gsl_rng_set/XOR_set in
| function rgb_timing that should put the seed to the generator.
| Unfortunately gvcount is here just 1, leaving just grngs[0] set.
| 
| 
|  state->grngs[0] = gsl_rng_alloc(dh_rng_types[14]);
|  ...
|  for(i=1;i<gvcount;i++){
|  ...
|    state->grngs[i] = gsl_rng_alloc(dh_rng_types[gnumbs[i]]);
| 
| 
| Further reading down leads to this comment saying we need at least one
| additional -g parameter:
| 
| rng_XOR.c:
| /*
|  * This is a special XOR generator that takes a list of GSL
|  * wrapped rngs and XOR's their uint output together to produce
|  * each new random number.  Note that it SKIPS THE FIRST ONE which
|  * MUST be the XOR rng itself.  So there have to be at least two -g X
|  * stanzas on the command line to use XOR, and if there aren't three
|  * or more it doesn't "do" anything but use the second one.
|  */
| 
| 
| So this command "dieharder -g 207 -a" is probably not expected
| to work and "just" fails to produce an error message.
| 
| 
| Kind regards,
| Bernhard
| 
| 
| BTW: Kind of the same problem could be observed when using such
| a command line: "dieharder -g 207 -g 207 -a".
| This crashes later after exhausting the whole stack.

*Really* nice work, and I concur from a quick glance. Opened a ticket in my
 'upstream' RDieHarder github repo.

Dirk

-- 
http://dirk.eddelbuettel.com | @eddelbuettel | e...@debian.org

Reply via email to