mersenneforum.org  

Go Back   mersenneforum.org > Factoring Projects > Msieve

Reply
 
Thread Tools
Old 2015-07-31, 20:33   #56
chris2be8
 
chris2be8's Avatar
 
Sep 2009

40368 Posts
Default

You can get the backup from http://kendon.info/chris/m42463_37.backup.zip (it's 835Mb so will take a while to download).
And a core dump from re-running with ulimit -c unlimited in http://kendon.info/chris/m42463_37.dump.zip (also the log from the re-run). This is "only" 225Mb.

Chris
chris2be8 is offline   Reply With Quote
Old 2015-08-04, 19:52   #57
debrouxl
 
debrouxl's Avatar
 
Sep 2009

977 Posts
Default

Just a data point: I fed your dataset (unsorted) to a couple binaries of msieve, respectively built with AddressSanitizer (-fsanitize=address) and UndefinedBehaviourSanitizer (-fsanitize=undefined), with GCC 4.9.2, on Debian jessie amd64.

Neither binary crashes or otherwise complains when running -nc, both binaries build a matrix of the same dimensions and weight:
Code:
matrix is 1326081 x 1326307 (379.9 MB) with weight 93617197 (70.58/col)
I've started a Valgrind run, but that shall be much slower (20x-30x), so I won't have the results tonight.


Unsurprisingly, 1-thread LA on the asan-enabled binary is a bit less than 50% slower than 1-thread LA on the ubsan-enabled binary. Some parts of filtering are less memory-intensive than LA, so the gap between the two is narrower, less than 30%.
debrouxl is offline   Reply With Quote
Old 2015-08-05, 05:57   #58
debrouxl
 
debrouxl's Avatar
 
Sep 2009

977 Posts
Default

When I interrupt LA, whose ETA on Valgrind is > 30x longer than even the asan-enabled binary, I see
Code:
ERROR SUMMARY: 145545 errors from 1 contexts (suppressed: 0 from 0)
However, I launched inside a `screen` session without saving a full log, so no details on that error...
I restarted the process, filtering "only" took 19455s last time.

This run's matrix had the same dimensions and weight as the two other runs.

Last fiddled with by debrouxl on 2015-08-05 at 05:57
debrouxl is offline   Reply With Quote
Old 2015-08-05, 16:06   #59
chris2be8
 
chris2be8's Avatar
 
Sep 2009

207810 Posts
Default

That suggests the bug may be system specific. I ran it on:
Code:
chris@4core ~/ggnfs/trunk/tests/m42463_37 $ uname -a
Linux 4core 3.8.0-19-generic #29-Ubuntu SMP Wed Apr 17 18:16:28 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

chris@4core ~/ggnfs/trunk/tests/m42463_37 $ ll /etc/*release
-rw-r--r-- 1 root root 107 Nov 16  2014 /etc/lsb-release
-rw-r--r-- 1 root root 241 Apr 19  2013 /etc/os-release

chris@4core ~/ggnfs/trunk/tests/m42463_37 $ cat /etc/os-release
NAME="Ubuntu"
VERSION="13.04, Raring Ringtail"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 13.04"
VERSION_ID="13.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"

chris@4core ~/ggnfs/trunk/tests/m42463_37 $ cat /etc/lsb-release
DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=15
DISTRIB_CODENAME=olivia
DISTRIB_DESCRIPTION="Linux Mint 15 Olivia"

chris@4core ~/ggnfs/trunk/tests/m42463_37 $ gcc --version
gcc (Ubuntu/Linaro 4.7.3-1ubuntu1) 4.7.3
Copyright © 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run with:
Code:
cd /home/chris/ggnfs/trunk/tests/m42463_37
ulimit -c unlimited
ulimit -a
nice -n 19  "/home/chris/msieve-svn967/trunk/msieve" -s m42463_37.dat -l m42463_37.log -i m42463_37.ini -v -nf m42463_37.fb -nc
ulimit -S -c 0
ulimit -a
That's in a script that gets called at a suitable point to take a break from other work.

And the msieve binary is:
Code:
chris@4core ~/ggnfs/trunk/tests/m42463_37 $ ll /home/chris/msieve-svn967/trunk/msieve
-rwxrwxr-x 1 chris chris 503198 Jun 26  2014 /home/chris/msieve-svn967/trunk/msieve

chris@4core ~/ggnfs/trunk/tests/m42463_37 $ file /home/chris/msieve-svn967/trunk/msieve
/home/chris/msieve-svn967/trunk/msieve: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=0x58c7530915df559878c2adefecd10baaa6dc5265, not stripped

chris@4core ~/ggnfs/trunk/tests/m42463_37 $ ldd /home/chris/msieve-svn967/trunk/msieve
        linux-vdso.so.1 =>  (0x00007fff4effe000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fe6796cd000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fe6794b6000)
        libgmp.so.10 => /usr/local/lib/libgmp.so.10 (0x00007fe67923f000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fe678f3a000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fe678d1d000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fe678954000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe6798f2000)
I hope some of that helps.

Chris

PS. Have you tried running a msieve binary built without any debugging support to see if it crashes? Reproducing the fault is always a good start when debugging.

Last fiddled with by chris2be8 on 2015-08-05 at 16:10 Reason: Added PS.
chris2be8 is offline   Reply With Quote
Old 2015-08-05, 17:24   #60
debrouxl
 
debrouxl's Avatar
 
Sep 2009

977 Posts
Default

The valgrind-specific output complains about manipulation of uninitialized memory:

Code:
memory use: 98.6 MB
reading ideals above 720000
commencing singleton removal, initial pass
==19390== Syscall param write(buf) points to uninitialised byte(s)
==19390==    at 0x6795620: __write_nocancel (syscall-template.S:81)
==19390==    by 0x6730472: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1253)
==19390==    by 0x672FB32: new_do_write (fileops.c:530)
==19390==    by 0x67312A4: _IO_do_write@@GLIBC_2.2.5 (fileops.c:503)
==19390==    by 0x67309A0: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1324)
==19390==    by 0x6726B0C: fwrite (iofwrite.c:43)
==19390==    by 0x44A161: nfs_write_lp_file (in .../msieve_undefinedsanitizer/msieve)
==19390==    by 0x4495D1: nfs_filter_relations (in .../msieve_undefinedsanitizer/msieve)
==19390==    by 0x42A56E: factor_gnfs (in .../msieve_undefinedsanitizer/msieve)
==19390==    by 0x40708F: msieve_run (in .../msieve_undefinedsanitizer/msieve)
==19390==    by 0x40500D: factor_integer (in .../msieve_undefinedsanitizer/msieve)
==19390==    by 0x404344: main (in .../msieve_undefinedsanitizer/msieve)
==19390==  Address 0x4025006 is not stack'd, malloc'd or (recently) free'd
==19390==  Uninitialised value was created by a stack allocation
==19390==    at 0x449EA7: nfs_write_lp_file (in .../msieve_undefinedsanitizer/msieve)
==19390== 
==19390== Warning: set address range perms: large range [0x4d8cc040, 0x6114c040) (undefined)
==19390== Warning: set address range perms: large range [0x1b8fb028, 0x2f17b058) (noaccess)
memory use: 689.0 MB
==19390== Warning: set address range perms: large range [0x3a04c028, 0x6114c058) (noaccess)
reading all ideals from disk
==19390== Warning: set address range perms: large range [0xa788040, 0x2e0102c4) (undefined)
==19390== Warning: set address range perms: large range [0xa788040, 0x2e010040) (defined)
memory use: 568.5 MB
keeping 22365672 ideals with weight <= 200, target excess is 116358
==19390== Warning: set address range perms: large range [0xa788028, 0x2e0102dc) (noaccess)
commencing in-memory singleton removal
begin with 18750003 relations and 22365672 unique ideals
reduce to 5953192 relations and 5741810 ideals in 23 passes
max relations containing the same ideal: 93
==19390== Warning: set address range perms: large range [0x3a04c028, 0x5d8d3960) (noaccess)
removing 556781 relations and 518578 ideals in 38203 cliques
[...]
==19390== ERROR SUMMARY: 145545 errors from 1 contexts (suppressed: 0 from 0)
Building msieve with clang-3.5 -fsanitize=memory -fsanitize-memory-track-origins -fno-omit-frame-pointer triggers an extremely early abort in the program, even before "Msieve v. 1.53 (SVN 988M)" is displayed, in a direct subroutine of main():
Code:
==15597== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7fbfd7781ed9 (.../msieve_memorysanitizer/msieve+0xc5ed9)
    #0 0x7fbfd77571ba in main ??:?
    #1 0x7fbfd6133b44 in __libc_start_main /build/glibc-Ir_s5K/glibc-2.19/csu/libc-start.c:287
    #2 0x7fbfd7755c2c in _start ??:?

  Uninitialized value was created by an allocation of 'b' in the stack frame of function 'get_cache_sizes'
    #0 0x7fbfd7781190 in get_cache_sizes ??:?

SUMMARY: MemorySanitizer: use-of-uninitialized-value ??:0 ??
Exiting
That one is spurious wrt. the current investigation, though quite possibly sound.

EDIT: it's easy to get past that error and several other similar ones, but I hit a wall of bricks with gmp_sprintf (and if I comment that call, gmp_sscanf soon thereafter). strlen somehow barfs on the null-terminating character.

Last fiddled with by debrouxl on 2015-08-05 at 18:19
debrouxl is offline   Reply With Quote
Old 2015-08-05, 20:07   #61
debrouxl
 
debrouxl's Avatar
 
Sep 2009

977 Posts
Default

I can get the msan-enabled version to proceed further, by setting a custom memory alloc function which calls calloc() instead of malloc(), and then play whack-a-mole on the various reported uninitialized values. One of the surprising trouble-makers is mpz_cmp_ui().
Some of the hunks, in non-performance-critical paths (e.g. aprcl or cpuid), may make sense for upstream msieve ?

When the code base is patched with the diff at the end of the message, the msan-enabled version goes to the LA phase:
Code:
matrix is 1326129 x 1326307 (400.7 MB) with weight 117854396 (88.86/col)
sparse part has weight 90462298 (68.21/col)
saving the first 48 matrix rows for later
matrix includes 64 packed rows
matrix is 1326081 x 1326307 (379.9 MB) with weight 93617197 (70.58/col)
sparse part has weight 86322130 (65.08/col)
using block size 8192 and superblock size 786432 for processor cache size 8192 kB
==4989== WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x7f434f43f165 (.../msieve_memorysanitizer/msieve+0x16d165)
    #0 0x7f434f42ed1b in block_lanczos ??:?
    #1 0x7f434f406512 in nfs_solve_linear_system ??:?
    #2 0x7f434f3a6f20 in factor_gnfs ??:?
    #3 0x7f434f372512 in msieve_run_core common/driver.c:?
    #4 0x7f434f370ad2 in msieve_run ??:?
    #5 0x7f434f36cdc2 in factor_integer ??:?
    #6 0x7f434f36efc8 in main ??:?
    #7 0x7f434dd49b44 in __libc_start_main /build/glibc-Ir_s5K/glibc-2.19/csu/libc-start.c:287
    #8 0x7f434f36c0dc in _start ??:?

  Uninitialized value was created by an allocation of 'size' in the stack frame of function 'get_cache_sizes'
    #0 0x7f434f387f60 in get_cache_sizes ??:?

SUMMARY: MemorySanitizer: use-of-uninitialized-value ??:0 ??
IOW, no more manipulation of uninitialized memory reported during filtering. Maybe one of the changes is fixing / hiding the problem previously reported by Valgrind ?


Here's a slightly cleaned up version of my local diff, I hope it applies.
Compiling with -O1 and adding noinline attributes reduces inlining, and helps pinpointing the appropriate variables.
Code:
Index: Makefile
===================================================================
--- Makefile    (révision 988)
+++ Makefile    (copie de travail)
@@ -17,9 +17,9 @@
 
 # gcc with basic optimization (-march flag could
 # get overridden by architecture-specific builds)
-CC = gcc
+CC = clang
 WARN_FLAGS = -Wall -W
-OPT_FLAGS = -O3 -fomit-frame-pointer -march=native \
+OPT_FLAGS = -O1 -fno-omit-frame-pointer -march=native -fsanitize=memory -fsanitize-memory-track-origins -fPIE -pie \
            -D_FILE_OFFSET_BITS=64 -DNDEBUG -D_LARGEFILE64_SOURCE
 
 # use := instead of = so we only run the following once
Index: aprcl/mpz_aprcl32.c
===================================================================
--- aprcl/mpz_aprcl32.c (révision 988)
+++ aprcl/mpz_aprcl32.c (copie de travail)
@@ -1348,14 +1348,14 @@
 void allocate_vars()
 {
   int i = 0;
-  aiJS = malloc(PWmax * sizeof(mpz_t));
-  aiJW = malloc(PWmax * sizeof(mpz_t));
-  aiJX = malloc(PWmax * sizeof(mpz_t));
-  aiJ0 = malloc(PWmax * sizeof(mpz_t));
-  aiJ1 = malloc(PWmax * sizeof(mpz_t));
-  aiJ2 = malloc(PWmax * sizeof(mpz_t));
-  aiJ00 = malloc(PWmax * sizeof(mpz_t));
-  aiJ01 = malloc(PWmax * sizeof(mpz_t));
+  aiJS = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJW = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJX = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJ0 = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJ1 = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJ2 = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJ00 = calloc(PWmax * sizeof(mpz_t), 1);
+  aiJ01 = calloc(PWmax * sizeof(mpz_t), 1);
   for (i = 0 ; i < PWmax; i++)
   {
     mpz_init(aiJS[i]);
Index: common/driver.c
===================================================================
--- common/driver.c     (révision 988)
+++ common/driver.c     (copie de travail)
@@ -43,7 +43,7 @@
        obj->nfs_fbfile_name = MSIEVE_DEFAULT_NFS_FBFILE;
        if (nfs_fbfile_name)
                obj->nfs_fbfile_name = nfs_fbfile_name;
-       obj->mp_sprintf_buf = (char *)xmalloc(32 * MAX_MP_WORDS + 1);
+       obj->mp_sprintf_buf = (char *)xcalloc(32 * MAX_MP_WORDS + 1, 2);
        savefile_init(&obj->savefile, savefile_name);
 
        return obj;
Index: common/smallfact/smallfact.c
===================================================================
--- common/smallfact/smallfact.c        (révision 988)
+++ common/smallfact/smallfact.c        (copie de travail)
@@ -134,6 +134,7 @@
                uint32 limit = 2;
 
                mp_clear(&x);
+               mp_clear(&t);
                x.nwords = 1;
                x.val[0] = get_rand(&obj->seed1, &obj->seed2);
                mp_copy(&x, &y);
Index: common/util.c
===================================================================
--- common/util.c       (révision 988)
+++ common/util.c       (copie de travail)
@@ -233,7 +233,7 @@
           the L1/L2/L3 cache size of any Intel or AMD
           processor made after ~1995 */
 
-       uint32 a, b, c, d;
+       uint32 a = 0, b = 0, c = 0, d = 0;
        uint8 is_intel, is_amd;
 
        CPUID(0, a, b, c, d);
@@ -413,7 +413,7 @@
        enum cpu_type cpu = cpu_generic;
 
 #if defined(HAS_CPUID)
-       uint32 a, b, c, d;
+       uint32 a = 0, b = 0, c = 0, d = 0;
 
        CPUID(0, a, b, c, d);
        if ((b & 0xff) == 'G') {        /* "GenuineIntel" */
Index: demo.c
===================================================================
--- demo.c      (révision 988)
+++ demo.c      (copie de travail)
@@ -15,6 +15,8 @@
 #include <msieve.h>
 #include <signal.h>
 
+#include <gmp.h>
+
 #ifdef HAVE_MPI
 #include <mpi.h>
 #endif
@@ -305,6 +307,11 @@
 }
 #endif
 
+void * new_malloc_mp(size_t size)
+{
+       return calloc(size, 1);
+}
+
 /*--------------------------------------------------------------------*/
 int main(int argc, char **argv) {
 
@@ -348,6 +355,7 @@
        }
 #endif
 
+mp_set_memory_functions(new_malloc_mp, NULL, NULL);
        flags = MSIEVE_FLAG_USE_LOGFILE;
 
        i = 1;
Index: gnfs/filter/duplicate.c
===================================================================
--- gnfs/filter/duplicate.c     (révision 988)
+++ gnfs/filter/duplicate.c     (copie de travail)
@@ -260,8 +260,8 @@
        uint8 *hashtable;
        uint32 blob[2];
        uint32 log2_hashtable1_size;
-       double rel_size = estimate_rel_size(savefile);
        mpz_t scratch;
+       double rel_size;
 
        uint8 *free_relation_bits;
        uint32 *free_relations;
@@ -275,7 +275,9 @@
        uint32 array_size;
        relation_t tmp_rel;
 
+       mpz_init(scratch);
        tmp_rel.factors = tmp_factors;
+       rel_size = estimate_rel_size(savefile);
 
        logprintf(obj, "commencing duplicate removal, pass 1\n");
 
@@ -337,7 +339,6 @@
        num_collisions = 0;
        num_skipped_b = 0;
        num_composite = 0;
-       mpz_init(scratch);
        savefile_read_line(buf, sizeof(buf), savefile);
        while (!savefile_eof(savefile)) {
 
Index: gnfs/gnfs.c
===================================================================
--- gnfs/gnfs.c (révision 988)
+++ gnfs/gnfs.c (copie de travail)
@@ -268,6 +268,7 @@
        savefile_t *savefile = &obj->savefile;
        uint32 update = 1;
 
+       memset(buf, 0, sizeof(buf));
        /* open the savefile; if the file already
           exists and the first line contains n,
           then we are restarting from a previous factorization */
@@ -294,6 +295,7 @@
                   up savefiles you wanted! */
 
                savefile_open(savefile, SAVEFILE_WRITE);
+               memset(buf, 0, sizeof(buf));
                gmp_sprintf(buf, "N %Zd\n", n);
                savefile_write_line(savefile, buf);
                savefile_flush(savefile);
Index: gnfs/poly/poly.c
===================================================================
--- gnfs/poly/poly.c    (révision 988)
+++ gnfs/poly/poly.c    (copie de travail)
@@ -24,14 +24,18 @@
        FILE *fp;
        char buf[BIGNUM_BUF_SIZE];
        mpz_t read_n;
-       mpz_t val, rpow;
+       mpz_t val, rpow, val2;
        int32 status = 0;
 
+       mpz_init(read_n);
+       mpz_init(val);
+       mpz_init(val2);
+       mpz_init(rpow);
+
        fp = fopen(obj->nfs_fbfile_name, "r");
        if (fp == NULL)
                return -1;
 
-       buf[0] = 0;
        fgets(buf, (int)sizeof(buf), fp);
        if (buf[0] != 'N') {
                fclose(fp);
@@ -42,10 +46,6 @@
        /* check that the polynomial is for the 
           right number */
 
-       mpz_init(read_n);
-       mpz_init(val);
-       mpz_init(rpow);
-
        gmp_sscanf(buf + 2, "%Zd", read_n);
        if (mpz_cmp(read_n, n) != 0) {
                fclose(fp);
@@ -146,7 +146,8 @@
           factors that are not reflected in the polynomials */
 
        mpz_mod(val, val, n);
-       if (mpz_cmp_ui(val, 0) != 0) {
+mpz_set_ui(val2, 0);
+       if (mpz_cmp(val, val2) != 0) {
                logprintf(obj, "error: NFS input does not match polynomials\n");
                logprintf(obj, "check that input doesn't have small factors\n");
                exit(-1);
@@ -154,6 +155,7 @@
 
 finished:
        mpz_clear(read_n);
+       mpz_clear(val2);
        mpz_clear(val);
        mpz_clear(rpow);
        return 0;
Index: gnfs/poly/polyutil.c
===================================================================
--- gnfs/poly/polyutil.c        (révision 988)
+++ gnfs/poly/polyutil.c        (copie de travail)
@@ -35,10 +35,10 @@
 }
 
 /*------------------------------------------------------------------*/
-static void poly_select_copy(poly_select_t *dest,
+/*static*/ __attribute__((noinline)) void poly_select_copy(poly_select_t *dest,
                  poly_select_t *src) {
 
-       uint32 i;
+       uint32 i = 0;
 
        dest->size_score = src->size_score;
        dest->root_score = src->root_score;
@@ -87,7 +87,7 @@
 }
 
 /*------------------------------------------------------------------*/
-void analyze_poly(poly_config_t *config, poly_select_t *poly) {
+/*static*/ __attribute__((noinline)) void analyze_poly(poly_config_t *config, poly_select_t *poly) {
 
        /* analyze a polynomial for sieving goodness
          
@@ -97,7 +97,7 @@
           directly comparable to that of any other polynomials 
           given to this routine */
 
-       uint32 i;
+       uint32 i = 0;
        double root_score_r, root_score_a;
        ddpoly_t ddr, dda;
        mpz_poly_t *rpoly = &poly->rpoly;
Index: gnfs/poly/size_score.c
===================================================================
--- gnfs/poly/size_score.c      (révision 988)
+++ gnfs/poly/size_score.c      (copie de travail)
@@ -387,6 +387,13 @@
        double *xrow, *yrow;
        double res;
 
+for (i = 0; i <= MAX_POLY_DEGREE; i++) {
+for (j = 0; j <= MAX_POLY_DEGREE; j++) {
+xbinom[i][j] = 0.0;
+ybinom[i][j] = 0.0;
+}
+}
+
        xbinom[1][0] = xh;
        xbinom[1][1] = x0;
        for (i = 2; i <= deg; i++) {
Index: gnfs/relation.c
===================================================================
--- gnfs/relation.c     (révision 988)
+++ gnfs/relation.c     (copie de travail)
@@ -96,7 +96,12 @@
        uint32 num_factors_a;
        uint32 array_size = 0;
        uint8 *factors = r->factors;
+mpz_t zero, one;
 
+mpz_init(zero);
+mpz_init(one);
+mpz_set_ui(zero, 0);
+mpz_set_ui(one, 1);
        /* read the relation coordinates */
 
        a = strtoll(buf, &next_field, 10);
@@ -163,9 +168,9 @@
        /* handle a rational factor of -1 */
 
        eval_poly(polyval, a, b, rpoly);
-       if (mpz_cmp_ui(polyval, 0) == 0)
+       if (mpz_cmp(polyval, zero) == 0)
                return -6;
-       if (mpz_cmp_ui(polyval, 0) < 0) {
+       if (mpz_cmp(polyval, zero) < 0) {
                array_size = compress_p(factors, 0, array_size);
                num_factors_r++;
                mpz_abs(polyval, polyval);
@@ -203,7 +208,7 @@
        /* if there are rational factors still to be accounted
           for, assume they are small and find them by trial division */
 
-       for (i = p = 0; mpz_cmp_ui(polyval, 1) != 0 && 
+       for (i = p = 0; mpz_cmp(polyval, one) != 0 && 
                                p < RELATION_TF_BOUND; i++) {
 
                p += prime_delta[i];
@@ -215,13 +220,13 @@
                }
        }
 
-       if (mpz_cmp_ui(polyval, 1) != 0)
+       if (mpz_cmp(polyval, one) != 0)
                return -11;
 
        /* read the algebraic factors */
 
        eval_poly(polyval, a, b, apoly);
-       if (mpz_cmp_ui(polyval, 0) == 0)
+       if (mpz_cmp(polyval, zero) == 0)
                return -12;
        mpz_abs(polyval, polyval);
 
@@ -249,7 +254,7 @@
        /* if there are algebraic factors still to be accounted
           for, assume they are small and find them by trial division */
 
-       for (i = p = 0; mpz_cmp_ui(polyval, 1) != 0 && 
+       for (i = p = 0; mpz_cmp(polyval, one) != 0 && 
                                        p < RELATION_TF_BOUND; i++) {
 
                p += prime_delta[i];
@@ -261,7 +266,7 @@
                }
        }
 
-       if (mpz_cmp_ui(polyval, 1) != 0)
+       if (mpz_cmp(polyval, one) != 0)
                return -15;
 
        r->num_factors_r = num_factors_r;
Index: include/gmp_xface.h
===================================================================
--- include/gmp_xface.h (révision 988)
+++ include/gmp_xface.h (copie de travail)
@@ -38,7 +38,7 @@
 /*--------------------------------------------------------------------*/
 static INLINE void gmp2mp(mpz_t src, mp_t *dest) {
 
-       size_t count;
+       size_t count = 0;
 
        mp_clear(dest);
        mpz_export(dest->val, &count, -1, sizeof(uint32),
I suppose I should now rebuild the patched without msan, and execute that with valgrind. We'll see whether the uninitialized memory manipulation is still reported.
debrouxl is offline   Reply With Quote
Old 2015-08-06, 06:10   #62
debrouxl
 
debrouxl's Avatar
 
Sep 2009

977 Posts
Default

Meh. 11 GB of free RAM is not enough for Valgrind to cope with the aforementioned execution :'(

This probably concludes my investigations. At least, they have turned up a reproducible warning with 145545 occurrences in nfs_write_lp_file.
debrouxl is offline   Reply With Quote
Old 2015-08-19, 16:14   #63
jyb
 
jyb's Avatar
 
Aug 2005
Seattle, WA

110110110102 Posts
Default Incomplete factoring with SVN 984?

Apologies if this has been covered elsewhere; I couldn't find a prior report.

Lately when msieve finishes the square root phase of a factorization (and by "lately" I believe I mean since I started using v984), it is only printing one of the factors. Furthermore, if the cofactor is composite, msieve is not attempting to use any more dependencies, it's just quitting without finishing the factorization. Has this already been addressed with more recent versions? Is it a known issue?

Thanks.
jyb is offline   Reply With Quote
Old 2015-08-19, 18:10   #64
jasonp
Tribal Bullet
 
jasonp's Avatar
 
Oct 2004

DD516 Posts
Default

Could you post a square root log that illustrates what's going on?
jasonp is offline   Reply With Quote
Old 2015-08-19, 20:52   #65
jyb
 
jyb's Avatar
 
Aug 2005
Seattle, WA

2×877 Posts
Default

Quote:
Originally Posted by jasonp View Post
Could you post a square root log that illustrates what's going on?
Sure, here are a couple of such logs. The first is especially interesting, since msieve quit even though the cofactor was composite.
Attached Files
File Type: txt 8+7,257.log.txt (12.8 KB, 162 views)
File Type: txt 8-5,257.log.txt (13.4 KB, 166 views)

Last fiddled with by jyb on 2015-08-19 at 20:53
jyb is offline   Reply With Quote
Old 2015-08-20, 00:37   #66
Anyone
 
Aug 2015

22·5 Posts
Default

From where ?I can get msieve 1.53 source code and binaries ?
Anyone is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Msieve 1.50 feedback firejuggler Msieve 99 2013-02-17 11:53
Msieve v1.48 feedback Jeff Gilchrist Msieve 48 2011-06-10 18:18
Msieve 1.43 feedback Jeff Gilchrist Msieve 47 2009-11-24 15:53
Msieve 1.42 feedback Andi47 Msieve 167 2009-10-18 19:37
Msieve 1.41 Feedback Batalov Msieve 130 2009-06-09 16:01

All times are UTC. The time now is 01:07.


Sat Jul 17 01:07:14 UTC 2021 up 49 days, 22:54, 1 user, load averages: 1.79, 1.84, 1.59

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.