Is there another way to call fast_map from the command line? I can also try to write a test in libSingular, though that'll take me a bit longer. For the record, this is where the "assume violation at sbuckets.cc:180" comes from:
$ ./sage -gdb
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.4.beta2, Release Date: 2014-08-28 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
GNU gdb (GDB) 7.5.1
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /home/vbraun/Sage/git-develop/local/bin/python...done.
Python was not compiled with debug symbols (or it was stripped). Some functionality may not work (properly).
warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffd000
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
[New Thread 0x7fffeb0d6700 (LWP 13872)]
sage:
Program received signal SIGINT, Interrupt.
0x000000399a8ec513 in select () from /lib64/libc.so.6
(gdb) break dReportError
Breakpoint 1 at 0x7fffccb75245: file dError.c, line 28.
(gdb) cont
Continuing.
sage: sage: R.<x,y,z> = IntegerModRing(4)[]
sage: sage: eq = 2*y^2-2*y
sage: sage: eq(0,2,0)
Breakpoint 1, dReportError (fmt=0x7fffccd93b98 "assume violation at %s:%d condition: %s") at dError.c:28
28 va_start(ap, fmt);
(gdb) up
#1 0x00007fffccb38eb6 in sBucket_Add_p (bucket=0x2c85178, p=0x0, length=1) at sbuckets.cc:180
180 assume(length <= 0 || length == pLength(p));
(gdb) l
175 }
176
177 void sBucket_Add_p(sBucket_pt bucket, poly p, int length)
178 {
179 assume(bucket != NULL);
180 assume(length <= 0 || length == pLength(p));
181
182 if (p == NULL) return;
183 if (length <= 0) length = pLength(p);
184
(gdb) print *bucket
$1 = {
bucket_ring = 0x19bad58,
max_bucket = 0,
buckets = {{
p = 0x0,
length = 0
} <repeats 61 times>}
}
(gdb) print *p
Cannot access memory at address 0x0
(gdb) print length
$2 = 1
(gdb) print pLength(p)
$3 = 0
(gdb) up
#2 0x00007fffccad3761 in maPoly_Substitute (c=0x28148a8, p=0x28148d8, dest_r=0x19bad58)
at fast_maps.cc:443
443 sBucket_Add_p(c->bucket, t, len);
(gdb) l
438 int done=0;
439 while (c!=NULL)
440 {
441 done++;
442 poly t=pp_Mult_nn(p,c->n,dest_r);
443 sBucket_Add_p(c->bucket, t, len);
444 c=c->next;
445 }
446 return done;
447 }
(gdb) up
#3 0x00007fffccad3b3c in maPoly_Eval (root=0x27f6038, src_r=0x1912778, dest_id=0x2736a58,
dest_r=0x19bad58, total_cost=0) at fast_maps.cc:546
546 p->ref -= maPoly_Substitute(p->coeff, p->dest, dest_r);
(gdb) l
541 // no factorization provided, use the classical method:
542 p->dest=maPoly_EvalMon(p->src,src_r,dest_id->m,dest_r);
543 }
544 } /* p->dest==NULL */
545 // substitute the monomial: go through macoeff
546 p->ref -= maPoly_Substitute(p->coeff, p->dest, dest_r);
547 //printf("subst done\n");
548 if (total_cost)
549 {
550 assume(TEST_OPT_PROT);
(gdb) up
#4 0x00007fffccad35cd in fast_map (map_id=0x2aa2078, map_r=0x184f1d8, image_id=0x28acc68,
image_r=0x184f1d8) at fast_maps.cc:394
394 maPoly_Eval(mp, src_r, dest_id, dest_r, length);
(gdb) l
389 maPoly_GetLength(mp, length);
390 Print("%d}", length);
391 }
392
393 // do the actual evaluation
394 maPoly_Eval(mp, src_r, dest_id, dest_r, length);
395 if (TEST_OPT_PROT) Print(".");
396
397 // collect the results back into an ideal
398 ideal res_dest_id = maIdeal_2_Ideal(mideal, dest_r);
(gdb) up
#5 0x00007fffcb9f788b in __pyx_f_4sage_4libs_8singular_10polynomial_singular_polynomial_call (
__pyx_v_ret=0x7fffffffa858, __pyx_v_p=0x269ae98, __pyx_v_r=0x184f1d8, __pyx_v_args=
[<sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular at remote 0x7fffb6a6b1e0>, <sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular at remote 0x7fffb6a6b260>, <sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular at remote 0x7fffb6a6b3e0>],
__pyx_v_get_element=
0x7fffcc3a1280 <__pyx_f_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingular_get_element(PyObject*)>) at build/cythonized/sage/libs/singular/polynomial.cpp:3725
3725 __pyx_v_res_id = fast_map(__pyx_v_from_id, __pyx_v_r, __pyx_v_to_id, __pyx_v_r);
(gdb) l
3720 * rChangeCurrRing(r)
3721 * cdef ideal *res_id = fast_map(from_id, r, to_id, r) # <<<<<<<<<<<<<<
3722 * ret[0] = res_id.m[0]
3723 *
3724 */
3725 __pyx_v_res_id = fast_map(__pyx_v_from_id, __pyx_v_r, __pyx_v_to_id, __pyx_v_r);
3726
3727 /* "sage/libs/singular/polynomial.pyx":158
3728 * rChangeCurrRing(r)
3729 * cdef ideal *res_id = fast_map(from_id, r, to_id, r)