Am 12.12.22 um 00:39 schrieb Dirk Eddelbuettel:

On 11 December 2022 at 17:05, Bernhard Übelacker wrote:
| On Mon, 24 Oct 2022 12:22:13 -0500 Dirk Eddelbuettel <e...@debian.org> wrote:
| > |    diehard_birthdays|   0|       100|     100|0.99449351|  PASSED
| > | ###CUT OUT BY ME###
| > |             sts_runs|   2|    100000|     100|0.93620636|  PASSED
| > | ###AND THEN MANY EMPTY LINES APPEARING EVERY ~30 SEC###
| >
| > Darn. Would you have a moment to maybe jump into the code for sts_runs and
| > see what may be wrong now with its convergence criterion or count or ... ?
| >
| > The upstream code is pretty 'dead' and I am being forced to update the code
| > every now and then for better compliance with update compilers so it could 
be
| > that I swapped in a size_t for another loop variable type and maybe created 
a
| > signed / unsigned bug?
| >
| > Otherwise the only fix may be to take sts_run out of the set for 'all' 
tests.
| >
| > Dirk
|
|
|
| Hello Dirk,
| but is the problem not the test following the passed sts_run, the test 
sts_serial?
|
| I could reproduce it inside a VM with a current bookworm/testing installation.
|
| The blank lines look like produced by output_table_line, output.c:527,
| unfortunately with variable tflag=0, therefore no actual test information is 
printed.
|
| As far as I see the tflag gets overwritten because the neighbour variable 
tsamples
| got 4 bytes of memory reserved in global.c, but unfortunately in
| sts_serial it gets written with a size of 8 bytes, therefore tflag gets a 
value of 0.
| And therefore the following tests do execute but just output the "new line".
|
| In the build log there are a few "warning: useless type name in empty 
declaration".
| This I guess is the result of the semicolon, which makes the compiler see
| the "unsigned int;" and the "tsamples;" separately
| and, I guess, makes tsamples default to integer, therefore just the 4 bytes.
|
|     globals.c:22      #define off_t unsigned int;
|
| Because this define seems kind of dangerous and "unsigned int" would
| still not be right I think it should get removed
| and maybe sys/types.h get included. (See at the bottom)
| A package with this change prints also the tests below sts_run.

Do you have a suggested patch, and with it a 'before' and 'after' run that
fail and pass, respectively?  It's been a while since I looked at this (you
replied to an email from two months ago ...) so I am a little out of context
now.

Best, Dirk
| Kind regards,
| Bernhard
|
|
|
|
| $ dieharder -a -g 13
|
|
| $ gdb -q --pid $(pidof dieharder)
| ...
| (gdb) set width 0
| (gdb) set pagination off
| (gdb) directory /home/benutzer/source/dieharder/orig/dieharder-3.31.1.3
| Source directories searched: 
/home/benutzer/source/dieharder/orig/dieharder-3.31.1.3:$cdir:$cwd
| (gdb) b output_table_line
| Breakpoint 1 at 0x561a373b5050: file ./dieharder/output.c, line 350.
| (gdb) cont
| Continuing.
|
| Breakpoint 1, output_table_line (dtest=0x7f886dee6aa0 <diehard_operm5_dtest>, 
test=0x561a38b2e830) at ./dieharder/output.c:350
| 350 350      if(tflag & TDESCRIPTION){
| (gdb) cont
| Continuing.
|
| Breakpoint 1, output_table_line (dtest=0x7f886dee6a60 
<diehard_rank_32x32_dtest>, test=0x561a38b2e830) at ./dieharder/output.c:350
| 350      if(tflag & TDESCRIPTION){
| (gdb) print tflag
| $1 = 12799
| (gdb) print &tflag
| $2 = (unsigned int *) 0x561a373e5d64 <tflag>
| (gdb) watch *(unsigned int *) 0x561a373e5d64
| Hardware watchpoint 2: *(unsigned int *) 0x561a373e5d64
| (gdb) dele 1
| (gdb) cont
| Continuing.
|
| Hardware watchpoint 2: *(unsigned int *) 0x561a373e5d64
|
| Old value = 12799
| New value = 0
| sts_serial (test=0x561a38b2fe30, irun=0) at ./libdieharder/sts_serial.c:117
| 117      MYDEBUG(D_STS_SERIAL){
| (gdb) bt
| #0  sts_serial (test=0x561a38b2fe30, irun=0) at 
./libdieharder/sts_serial.c:117
| #1  0x00007f886de97437 in add_2_test (dtest=0x7f886dee65e0 
<sts_serial_dtest>, test=0x561a38b2fe30, count=100) at 
./libdieharder/std_test.c:230
| #2  0x0000561a373b69fc in execute_test (dtest_num=102) at 
./dieharder/run_test.c:92
| #3  0x0000561a373b65ef in run_all_tests () at ./dieharder/run_all_tests.c:47
| #4  0x0000561a373b3332 in main (argc=4, argv=0x7fffcca27f88) at 
./dieharder/dieharder.c:88
| (gdb) list
| 112       * decently if we could farm out the blocks of bits to be run 
efficiently
| 113       * over a network relative to the time required to generate them.
| 114       */
| 115      nb = 16;        /* Just ignore sts_serial_ntuple for now */
| 116      tsamples = test[0]->tsamples;  /* ditto */
| 117      MYDEBUG(D_STS_SERIAL){
| 118        
printf("#==================================================================\n");
| 119        printf("# Starting sts_serial.\n");
| 120        printf("# sts_serial: Testing ntuple = %u\n",nb);
| 121      }
| (gdb) display/i $pc
| 1: x/i $pc
| => 0x7f886de97c42 <sts_serial+66>:      mov    (%r15),%eax
| (gdb) print &tsamples
| $3 = (off_t *) 0x561a373e5d60 <tsamples>
| (gdb) print sizeof(tsamples)
| $4 = 8
| (gdb) frame 4
| #4  0x0000561a373b3332 in main (argc=4, argv=0x7fffcca27f88) at 
./dieharder/dieharder.c:88
| 88           run_all_tests();
| (gdb) print sizeof(tsamples)
| $6 = 4
|
|
|
|
| $ grep -E "off_t.*tsamples" . -Rn
| ./dieharder/globals.c:29:off_t tsamples;        /* Generally should be "a 
lot".  off_t is u_int64_t. */
| ./dieharder/globals.c:74:off_t tsamples;        /* Generally should be "a 
lot".  off_t is u_int64_t. */
| ./include/dieharder/libdieharder.h:194: extern off_t tsamples;        /* Generally 
should be "a lot".  off_t is u_int64_t. */
|
|
|
|
| 
https://buildd.debian.org/status/fetch.php?pkg=dieharder&arch=amd64&ver=3.31.1.3-1&stamp=1659884648&raw=0
|
| gcc -DHAVE_CONFIG_H -I. -I..  -I ../include -DVERSION=3.31.1 -I /usr/include  -std=c99 
-Wall -pedantic -I/usr/include -Wall -pipe -fexceptions -D_REENTRANT -g -O3 -g -O2 
-ffile-prefix-map=/<<PKGBUILDDIR>>=. -fstack-protector-strong -Wformat 
-Werror=format-security -MT dieharder-globals.o -MD -MP -MF .deps/dieharder-globals.Tpo -c 
-o dieharder-globals.o `test -f 'globals.c' || echo './'`globals.c
| globals.c:29:1: warning: useless type name in empty declaration
|     29 | off_t tsamples;        /* Generally should be "a lot".  off_t is 
u_int64_t. */
|        | ^~~~~
| globals.c:29:7: warning: data definition has no type or storage class
|     29 | off_t tsamples;        /* Generally should be "a lot".  off_t is 
u_int64_t. */
|        |       ^~~~~~~~
| globals.c:29:7: warning: type defaults to ‘int’ in declaration of ‘tsamples’ 
[-Wimplicit-int]
| globals.c:74:1: warning: useless type name in empty declaration
|     74 | off_t tsamples;        /* Generally should be "a lot".  off_t is 
u_int64_t. */
|        | ^~~~~
| globals.c:74:7: warning: data definition has no type or storage class
|     74 | off_t tsamples;        /* Generally should be "a lot".  off_t is 
u_int64_t. */
|        |       ^~~~~~~~
| globals.c:74:7: warning: type defaults to ‘int’ in declaration of ‘tsamples’ 
[-Wimplicit-int]
| globals.c:99:1: warning: useless type name in empty declaration
|     99 | off_t filecount;        /* number of rands in file */
|        | ^~~~~
| globals.c:99:7: warning: data definition has no type or storage class
|     99 | off_t filecount;        /* number of rands in file */
|        |       ^~~~~~~~~
| globals.c:99:7: warning: type defaults to ‘int’ in declaration of ‘filecount’ 
[-Wimplicit-int]
|
|
|
|
| --- dieharder-3.31.1.3.orig/dieharder/globals.c
| +++ dieharder-3.31.1.3/dieharder/globals.c
| @@ -10,6 +10,7 @@
|    */
|
|   #include <sys/time.h>
| +#include <sys/types.h>
|   //#include <R.h>
|   //#include <Rinternals.h>
|
| @@ -19,8 +20,6 @@
|
|   #include <dieharder/Dtest.h>
|
| -#define off_t unsigned int;
| -
|   /* dieharder.h */
|   //SEXP result;         /* kludge: need a global to report back to main() 
and then R */
|   //unsigned int Seed;             /* user selected seed.  Surpresses 
reseeding per sample.*/



Hello Dirk,
above is the suggested patch.
I have shutdown my non-persistent test-VM already, therefore no
before and after run at hand.
But the issue here is that all tests after "sts_run"
don't have any output except just a new line each.
With this patch the tests show output also after the "sts_run" line.
I tested this just for amd64.

Kind regards,
Bernhard

Reply via email to