Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Random failure in matrix_gap.pyx #33072

Open
vbraun opened this issue Dec 23, 2021 · 5 comments
Open

Random failure in matrix_gap.pyx #33072

vbraun opened this issue Dec 23, 2021 · 5 comments

Comments

@vbraun
Copy link
Member

vbraun commented Dec 23, 2021

**********************************************************************
File "src/sage/matrix/matrix_gap.pyx", line 64, in sage.matrix.matrix_gap.Matrix_gap
Failed example:
    for ring in [ZZ, QQ, UniversalCyclotomicField(), GF(2), GF(3)]:
        M = MatrixSpace(ring, 2, implementation='gap')
        TestSuite(M).run(skip=['_test_construction'])
        M = MatrixSpace(ring, 2, 3, implementation='gap')
        TestSuite(M).run(skip=['_test_construction'])
Expected nothing
Got:
    Failure in _test_prod:
    Traceback (most recent call last):
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/misc/sage_unittest.py", line 297, in run
        test_method(tester=tester)
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/categories/monoids.py", line 189, in _test_prod
        tester.assertEqual(self.prod([]), self.one())
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/unittest/case.py", line 837, in assertEqual
        assertion_func(first, second, msg=msg)
      File "/var/lib/buildbot/slave/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/unittest/case.py", line 830, in _baseAssertEqual
        raise self.failureException(msg)
    AssertionError: [1 0]
    [0 1] != [1 0]
    [0 1]
    ------------------------------------------------------------
    The following tests failed: _test_prod
**********************************************************************
1 item had failures:
   1 of  19 in sage.matrix.matrix_gap.Matrix_gap
    [116 tests, 1 failure, 3.57 s]
**********************************************************************

Component: linear algebra

Issue created by migration from https://trac.sagemath.org/ticket/33072

@vbraun vbraun added this to the sage-9.5 milestone Dec 23, 2021
@orlitzky
Copy link
Contributor

orlitzky commented Jan 7, 2022

comment:1

Please don't forget the random seed when these happen, it can save a lot of time.

@kliem
Copy link
Contributor

kliem commented Jan 10, 2022

comment:2

I'm not sure this is related to random seeds. However, identity_matrix for gap seems to be seriously broken.

The following leads to all kind of trouble:

sage: for ring in [ZZ, QQ, UniversalCyclotomicField(), GF(2), GF(3)]:
....:     M = MatrixSpace(ring, 2, implementation='gap')
....:     print(ring)
....:     for i in range(10000):    
....:         assert M.one().list() == [1, 0, 0, 1]

E.g.:

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-2-ff6e1a1e7099> in <module>
      3     print(ring)
      4     for i in range(Integer(10000)):
----> 5         assert M.one().list() == [Integer(1), Integer(0), Integer(0), Integer(1)]
      6 

~/Applications/sage/local/lib/python3.8/site-packages/sage/matrix/matrix0.pyx in sage.matrix.matrix0.Matrix.list (build/cythonized/sage/matrix/matrix0.c:4410)()
    158             [      y       x 2*x + y]
    159         """
--> 160         return list(self._list())
    161 
    162     def _list(self):

~/Applications/sage/local/lib/python3.8/site-packages/sage/matrix/matrix0.pyx in sage.matrix.matrix0.Matrix._list (build/cythonized/sage/matrix/matrix0.c:4563)()
    210         for i from 0 <= i < self._nrows:
    211             for j from 0 <= j < self._ncols:
--> 212                 x.append(self.get_unsafe(i, j))
    213         return x
    214 

~/Applications/sage/local/lib/python3.8/site-packages/sage/matrix/matrix_gap.pyx in sage.matrix.matrix_gap.Matrix_gap.get_unsafe (build/cythonized/sage/matrix/matrix_gap.c:4112)()
    184 
    185     cdef get_unsafe(self, Py_ssize_t i, Py_ssize_t j):
--> 186         return self._base_ring(self._libgap[i,j])
    187 
    188     cdef set_unsafe(self, Py_ssize_t i, Py_ssize_t j, object x):

~/Applications/sage/local/lib/python3.8/site-packages/sage/libs/gap/element.pyx in sage.libs.gap.element.GapElement_List.__getitem__ (build/cythonized/sage/libs/gap/element.c:21301)()
   2815                     raise ValueError('too many indices')
   2816                 if j < 0 or j >= LEN_LIST(obj):
-> 2817                     raise IndexError('index out of range')
   2818                 obj = ELM_LIST(obj, j+1)
   2819 

IndexError: index out of range

Apparently there also can be segmentation faults:

sage: set_random_seed(0)
sage: for ring in [ZZ, QQ, UniversalCyclotomicField(), GF(2), GF(3)]:
....:     M = MatrixSpace(ring, 2, implementation='gap')
....:     print(ring)
....:     for i in range(10000):    
....:         a = M.one()
....:         try:
....:             assert a.list() == [1, 0, 0, 1]
....:         except:
....:             print(a._libgap_())
....:             raise ValueError
....:             
Integer Ring
Rational Field
Universal Cyclotomic Field
Finite Field of size 2
Finite Field of size 3
sage: for ring in [ZZ, QQ, UniversalCyclotomicField(), GF(2), GF(3)]:
....:     M = MatrixSpace(ring, 2, implementation='gap')
....:     print(ring)
....:     for i in range(10000):    
....:         a = M.one()
....:         try:
....:             assert a.list() == [1, 0, 0, 1]
....:         except:
....:             print(a._libgap_())
....:             raise ValueError
....:             
Integer Ring
Rational Field
Universal Cyclotomic Field
------------------------------------------------------------------------
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/cysignals/signals.cpython-38-x86_64-linux-gnu.so(+0x9474)[0x7f0f371cb474]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/cysignals/signals.cpython-38-x86_64-linux-gnu.so(+0x9529)[0x7f0f371cb529]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/cysignals/signals.cpython-38-x86_64-linux-gnu.so(+0xd2b9)[0x7f0f371cf2b9]
/lib/x86_64-linux-gnu/libc.so.6(+0x46210)[0x7f0f3a00a210]
/home/jonathan/Applications/sage/local/lib/libgap.so.0(CLEAN_OBJ+0xa)[0x7f0edfcd4e1a]
/home/jonathan/Applications/sage/local/lib/libgap.so.0(+0x12f196)[0x7f0edfd02196]
/home/jonathan/Applications/sage/local/lib/libgap.so.0(CopyObj+0x1e)[0x7f0edfcd4ece]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/libs/gap/element.cpython-38-x86_64-linux-gnu.so(+0x42a85)[0x7f0ee077ea85]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/matrix/matrix_gap.cpython-38-x86_64-linux-gnu.so(+0x752e)[0x7f0edb6bd52e]
python3[0x5c4706]
python3(_PyEval_EvalFrameDefault+0x5706)[0x5703e6]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/misc/cachefunc.cpython-38-x86_64-linux-gnu.so(+0x107c1)[0x7f0f372f47c1]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/misc/cachefunc.cpython-38-x86_64-linux-gnu.so(+0x1235a)[0x7f0f372f635a]
/home/jonathan/Applications/sage/local/lib/python3.8/site-packages/sage/misc/cachefunc.cpython-38-x86_64-linux-gnu.so(+0x18702)[0x7f0f372fc702]
python3(_PyObject_MakeTpCall+0x296)[0x5f6a46]
python3(_PyEval_EvalFrameDefault+0x5d3f)[0x570a1f]
python3(_PyEval_EvalCodeWithName+0x26a)[0x5696da]
python3(PyEval_EvalCode+0x27)[0x68db17]
python3[0x600f34]
python3[0x5c4ad0]
python3(_PyEval_EvalFrameDefault+0x71e)[0x56b3fe]
python3[0x50053d]
python3(_PyEval_EvalFrameDefault+0x211c)[0x56cdfc]
python3[0x50053d]
python3(_PyEval_EvalFrameDefault+0x211c)[0x56cdfc]
python3[0x50053d]
python3[0x5042e6]
python3(_PyEval_EvalFrameDefault+0x900)[0x56b5e0]
python3(_PyFunction_Vectorcall+0x1b6)[0x5f6226]
python3(_PyEval_EvalFrameDefault+0x71e)[0x56b3fe]
python3(_PyFunction_Vectorcall+0x1b6)[0x5f6226]
python3(_PyEval_EvalFrameDefault+0x900)[0x56b5e0]
python3(_PyEval_EvalCodeWithName+0x26a)[0x5696da]
python3[0x50add0]
python3(_PyEval_EvalFrameDefault+0x18f1)[0x56c5d1]
python3(_PyEval_EvalCodeWithName+0x26a)[0x5696da]
python3(_PyFunction_Vectorcall+0x393)[0x5f6403]
python3(_PyEval_EvalFrameDefault+0x900)[0x56b5e0]
python3(_PyEval_EvalCodeWithName+0x26a)[0x5696da]
python3(_PyFunction_Vectorcall+0x393)[0x5f6403]
python3(_PyEval_EvalFrameDefault+0x900)[0x56b5e0]
python3(_PyFunction_Vectorcall+0x1b6)[0x5f6226]
python3(_PyEval_EvalFrameDefault+0x900)[0x56b5e0]
python3(_PyEval_EvalCodeWithName+0x26a)[0x5696da]
python3(PyEval_EvalCode+0x27)[0x68db17]
python3[0x67eeb1]
python3[0x67ef2f]
python3[0x67efd1]
python3(PyRun_SimpleFileExFlags+0x197)[0x67f377]
python3(Py_RunMain+0x212)[0x6b7902]
python3(Py_BytesMain+0x2d)[0x6b7c8d]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7f0f39feb0b3]
python3(_start+0x2e)[0x5fb12e]
------------------------------------------------------------------------
Attaching gdb to process id 6651.
GNU gdb (Ubuntu 9.2-0ubuntu1~20.04) 9.2
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
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-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word".
[New LWP 6720]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
0x00007f0f3a0a9dff in __GI___wait4 (pid=6725, stat_loc=stat_loc@entry=0x0, options=options@entry=0, usage=usage@entry=0x0) at ../sysdeps/unix/sysv/linux/wait4.c:27

Stack backtrace
---------------
        resultvar = 18446744073709551104
        sc_cancel_oldtype = 0
        sc_ret = <optimized out>
#1  0x00007f0f3a0a9d7b in __GI___waitpid (pid=<optimized out>, stat_loc=stat_loc@entry=0x0, options=options@entry=0) at waitpid.c:38
No locals.
#2  0x00007f0f371c9c24 in print_enhanced_backtrace () at build/src/cysignals/implementation.c:579
        parent_pid = 6651
        pid = <optimized out>
#3  0x00007f0f371cb566 in sigdie (sig=sig@entry=11, s=s@entry=0x7f0f371d4b80 "Unhandled SIGSEGV: A segmentation fault occurred.") at build/src/cysignals/implementation.c:605
No locals.
#4  0x00007f0f371cf2b9 in sigdie_for_sig (inside=0, sig=11) at build/src/cysignals/implementation.c:179
No locals.
#5  cysigs_signal_handler (sig=11) at build/src/cysignals/implementation.c:278
        inside = <optimized out>
#6  <signal handler called>
No locals.
#7  0x00007f0edfcd4e1a in CLEAN_OBJ () from /home/jonathan/Applications/sage/local/lib/libgap.so.0
No symbol table info available.
#8  0x00007f0edfd02196 in CleanPlist () from /home/jonathan/Applications/sage/local/lib/libgap.so.0
No symbol table info available.
#9  0x00007f0edfcd4ece in CopyObj () from /home/jonathan/Applications/sage/local/lib/libgap.so.0
No symbol table info available.
#10 0x00007f0ee077ea85 in __pyx_f_4sage_4libs_3gap_7element_10GapElement_deepcopy (__pyx_v_self=0x7f0edb6cf880, __pyx_v_mut=1, __pyx_skip_dispatch=<optimized out>)
    at build/cythonized/sage/libs/gap/element.c:7236
        __pyx_r = 0x0
        __pyx_t_1 = 0x7f0ee087a310
        __pyx_t_2 = 0x0
        __pyx_t_3 = 0x0
        __pyx_t_4 = 0x0
        __pyx_t_5 = 0x0
        __pyx_t_6 = <optimized out>
        __pyx_lineno = 0
        __pyx_filename = 0x0
        __pyx_clineno = 0
#11 0x00007f0edb6bd52e in __pyx_pf_4sage_6matrix_10matrix_gap_10Matrix_gap_2__copy__ (__pyx_v_self=0x7f0edb6e7660) at build/cythonized/sage/matrix/matrix_gap.c:3794
        __pyx_v_M = 0x7f0edb6e7200
        __pyx_r = 0x0
        __pyx_t_1 = 0x0
        __pyx_lineno = 0
        __pyx_filename = 0x0
        __pyx_clineno = 0
        __pyx_v_M = <optimized out>
        __pyx_r = <optimized out>
        __pyx_t_1 = <optimized out>
        __pyx_lineno = <optimized out>
        __pyx_filename = <optimized out>
        __pyx_clineno = <optimized out>
#12 __pyx_pw_4sage_6matrix_10matrix_gap_10Matrix_gap_3__copy__ (__pyx_v_self=0x7f0edb6e7660, unused=<optimized out>) at build/cythonized/sage/matrix/matrix_gap.c:3758
        __pyx_r = 0x0
#13 0x00000000005c4706 in ?? ()
No symbol table info available.
#14 0x00000000005703e6 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#15 0x00007f0f372f47c1 in __Pyx_PyFunction_FastCallNoKw (co=co@entry=0x7f0ee56cbb30, args=<optimized out>, args@entry=0x7ffd078ec0f0, na=na@entry=1, 
    globals=globals@entry=0x7f0ee56bf980) at build/cythonized/sage/misc/cachefunc.c:25083
        f = 0x7f0edb788b80
        tstate = 0x1a3e400
        fastlocals = <optimized out>
        i = <optimized out>
        result = <optimized out>
#16 0x00007f0f372f635a in __Pyx_PyFunction_FastCallDict (func=func@entry=0x7f0ee5236c10, args=args@entry=0x7ffd078ec0f0, nargs=nargs@entry=1, kwargs=0x0)
    at build/cythonized/sage/misc/cachefunc.c:25115
        co = 0x7f0ee56cbb30
        globals = 0x7f0ee56bf980
        argdefs = 0x0
        closure = <optimized out>
        kwdefs = <optimized out>
        kwtuple = <optimized out>
        k = <optimized out>
        d = <optimized out>
        nd = <optimized out>
        result = <optimized out>
        pos = <optimized out>
        i = <optimized out>
#17 0x00007f0f372fc702 in __Pyx_PyObject_CallOneArg (arg=<optimized out>, func=0x7f0ee5236c10) at build/cythonized/sage/misc/cachefunc.c:25242
No locals.
#18 __pyx_pf_4sage_4misc_9cachefunc_24CachedMethodCallerNoArgs_6__call__ (__pyx_v_self=0x7f0edb6f5a40) at build/cythonized/sage/misc/cachefunc.c:12955
        __pyx_t_3 = 0x0
        __pyx_clineno = 0
        __pyx_r = 0x0
        __pyx_t_1 = <optimized out>
        __pyx_t_4 = <optimized out>
        __pyx_filename = 0x0
        __pyx_v_f = 0x7f0ee5236c10
        __pyx_t_2 = <optimized out>
        __pyx_t_5 = <optimized out>
        __pyx_lineno = 0
        __pyx_v_f = <optimized out>
        __pyx_r = <optimized out>
        __pyx_t_1 = <optimized out>
        __pyx_t_2 = <optimized out>
        __pyx_t_3 = <optimized out>
        __pyx_t_4 = <optimized out>
        __pyx_t_5 = <optimized out>
        __pyx_lineno = <optimized out>
        __pyx_filename = <optimized out>
        __pyx_clineno = <optimized out>
        function = <optimized out>
        tmp = <optimized out>
#19 __pyx_pw_4sage_4misc_9cachefunc_24CachedMethodCallerNoArgs_7__call__ (__pyx_v_self=0x7f0edb6f5a40, __pyx_args=<optimized out>, __pyx_kwds=<optimized out>)
    at build/cythonized/sage/misc/cachefunc.c:12893
        __pyx_r = 0x0
#20 0x00000000005f6a46 in _PyObject_MakeTpCall ()
No symbol table info available.
#21 0x0000000000570a1f in _PyEval_EvalFrameDefault ()
No symbol table info available.
#22 0x00000000005696da in _PyEval_EvalCodeWithName ()
No symbol table info available.
#23 0x000000000068db17 in PyEval_EvalCode ()
No symbol table info available.
#24 0x0000000000600f34 in ?? ()
No symbol table info available.
#25 0x00000000005c4ad0 in ?? ()
No symbol table info available.
#26 0x000000000056b3fe in _PyEval_EvalFrameDefault ()
No symbol table info available.
#27 0x000000000050053d in ?? ()
No symbol table info available.
#28 0x000000000056cdfc in _PyEval_EvalFrameDefault ()
No symbol table info available.
#29 0x000000000050053d in ?? ()
No symbol table info available.
#30 0x000000000056cdfc in _PyEval_EvalFrameDefault ()
No symbol table info available.
#31 0x000000000050053d in ?? ()
No symbol table info available.
#32 0x00000000005042e6 in ?? ()
No symbol table info available.
#33 0x000000000056b5e0 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#34 0x00000000005f6226 in _PyFunction_Vectorcall ()
No symbol table info available.
#35 0x000000000056b3fe in _PyEval_EvalFrameDefault ()
No symbol table info available.
#36 0x00000000005f6226 in _PyFunction_Vectorcall ()
No symbol table info available.
#37 0x000000000056b5e0 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#38 0x00000000005696da in _PyEval_EvalCodeWithName ()
No symbol table info available.
#39 0x000000000050add0 in ?? ()
No symbol table info available.
#40 0x000000000056c5d1 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#41 0x00000000005696da in _PyEval_EvalCodeWithName ()
No symbol table info available.
#42 0x00000000005f6403 in _PyFunction_Vectorcall ()
No symbol table info available.
#43 0x000000000056b5e0 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#44 0x00000000005696da in _PyEval_EvalCodeWithName ()
No symbol table info available.
#45 0x00000000005f6403 in _PyFunction_Vectorcall ()
No symbol table info available.
#46 0x000000000056b5e0 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#47 0x00000000005f6226 in _PyFunction_Vectorcall ()
No symbol table info available.
#48 0x000000000056b5e0 in _PyEval_EvalFrameDefault ()
No symbol table info available.
#49 0x00000000005696da in _PyEval_EvalCodeWithName ()
No symbol table info available.
#50 0x000000000068db17 in PyEval_EvalCode ()
No symbol table info available.
#51 0x000000000067eeb1 in ?? ()
No symbol table info available.
#52 0x000000000067ef2f in ?? ()
No symbol table info available.
#53 0x000000000067efd1 in ?? ()
No symbol table info available.
#54 0x000000000067f377 in PyRun_SimpleFileExFlags ()
No symbol table info available.
#55 0x00000000006b7902 in Py_RunMain ()
No symbol table info available.
#56 0x00000000006b7c8d in Py_BytesMain ()
No symbol table info available.
#57 0x00007f0f39feb0b3 in __libc_start_main (main=0x4eed30 <main>, argc=3, argv=0x7ffd078edad8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7ffd078edac8) at ../csu/libc-start.c:308
        self = <optimized out>
        result = <optimized out>
        unwind_buf = {cancel_jmp_buf = {{jmp_buf = {7044256, -7460766405028691566, 6271232, 140724730256080, 0, 0, 7461346819326919058, 7379283807667929490}, 
              mask_was_saved = 0}}, priv = {pad = {0x0, 0x0, 0x3, 0x7ffd078edad8}, data = {prev = 0x0, cleanup = 0x0, canceltype = 3}}}
        not_first_call = <optimized out>
#58 0x00000000005fb12e in _start ()
No symbol table info available.


Cython backtrace
----------------
#0  0x00007f0f3a0a9da0 in __GI___wait4 () at /build/glibc-eX1tMB/glibc-2.31/posix/../sysdeps/unix/sysv/linux/wait4.c:27
#1  0x00007f0f3a0a9d70 in __GI___waitpid () at /build/glibc-eX1tMB/glibc-2.31/posix/waitpid.c:38
#2  0x00007f0f371c9bb0 in print_enhanced_backtrace () at /home/jonathan/Applications/sage/local/var/tmp/sage/build/cysignals-1.10.3/src/build/src/cysignals/implementation.c:579
#3  0x00007f0f371cb4f0 in sigdie () at /home/jonathan/Applications/sage/local/var/tmp/sage/build/cysignals-1.10.3/src/build/src/cysignals/implementation.c:605
#4  0x00007f0f371cf062 in sigdie_for_sig () at /home/jonathan/Applications/sage/local/var/tmp/sage/build/cysignals-1.10.3/src/build/src/cysignals/implementation.c:179
#5  0x00007f0f371cf040 in cysigs_signal_handler () at /home/jonathan/Applications/sage/local/var/tmp/sage/build/cysignals-1.10.3/src/build/src/cysignals/implementation.c:278
#6  0x00007f0f3a1ff3d0 in __restore_rt ()
#7  0x00007f0edfcd4e10 in CLEAN_OBJ ()
#8  0x00007f0edfd02160 in CleanPlist ()
#9  0x00007f0edfcd4eb0 in CopyObj ()
#10 0x00007f0ee077e880 in deepcopy () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/sage/libs/gap/element.pyx:583
   578                false
   579                sage: l.deepcopy(1).IsMutable()
   580                true
   581            """
   582            if IS_MUTABLE_OBJ(self.value):
>  583                return make_any_gap_element(self.parent(), CopyObj(self.value, mut))
   584            else:
   585                return self
   586    
   587        def __deepcopy__(self, memo):
#11 0x00007f0edb6bd4fb in __pyx_pf_4sage_6matrix_10matrix_gap_10Matrix_gap_2__copy__ () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/build/cythonized/sage/matrix/matrix_gap.c:3794
  3789     *         cdef Matrix_gap M = self._new(self._nrows, self._ncols)
  3790     *         M._libgap = self._libgap.deepcopy(1)             # <<<<<<<<<<<<<<
  3791     *         return M
  3792     *
  3793     */
> 3794      __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_4sage_4libs_3gap_7element_GapElement *)__pyx_v_self->_libgap->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->deepcopy(__pyx_v_self->_libgap, 1, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 153, __pyx_L1_error)
  3795      __Pyx_GOTREF(__pyx_t_1);
  3796      __Pyx_GIVEREF(__pyx_t_1);
  3797      __Pyx_GOTREF(__pyx_v_M->_libgap);
  3798      __Pyx_DECREF(((PyObject *)__pyx_v_M->_libgap));
#12 0x00007f0edb6bd4f0 in __copy__ () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/sage/matrix/matrix_gap.pyx:134
   129            else:
   130                P = self.matrix_space(nrows, ncols)
   131    
   132            return Matrix_gap.__new__(Matrix_gap, P)
   133    
>  134        def __copy__(self):
   135            r"""
   136            TESTS::
   137    
   138                sage: M = MatrixSpace(QQ, 2, implementation='gap')
#13 0x0000000000000000 in ?? ()
#14 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#15 0x00007f0f372f4750 in __Pyx_PyFunction_FastCallNoKw () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/build/cythonized/sage/misc/cachefunc.c:25083
  25078        fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
  25079        for (i = 0; i < na; i++) {
  25080            Py_INCREF(*args);
  25081            fastlocals[i] = *args++;
  25082        }
> 25083        result = PyEval_EvalFrameEx(f,0);
  25084        ++tstate->recursion_depth;
  25085        Py_DECREF(f);
  25086        --tstate->recursion_depth;
  25087        return result;
#16 0x00007f0f372f6210 in __Pyx_PyFunction_FastCallDict () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/build/cythonized/sage/misc/cachefunc.c:25115
  25110                co->co_kwonlyargcount == 0 &&
  25111    #endif
  25112                likely(kwargs == NULL || nk == 0) &&
  25113                co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
  25114            if (argdefs == NULL && co->co_argcount == nargs) {
> 25115                result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
  25116                goto done;
  25117            }
  25118            else if (nargs == 0 && argdefs != NULL
  25119                     && co->co_argcount == Py_SIZE(argdefs)) {
#17 0x00007f0f372fc514 in __Pyx_PyObject_CallOneArg () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/build/cythonized/sage/misc/cachefunc.c:25242
  25237        return result;
  25238    }
  25239    static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
  25240    #if CYTHON_FAST_PYCALL
  25241        if (PyFunction_Check(func)) {
> 25242            return __Pyx_PyFunction_FastCall(func, &arg, 1);
  25243        }
  25244    #endif
  25245        if (likely(PyCFunction_Check(func))) {
  25246            if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
#18 0x00007f0f372fc42e in __pyx_pf_4sage_4misc_9cachefunc_24CachedMethodCallerNoArgs_6__call__ () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/build/cythonized/sage/misc/cachefunc.c:12955
  12950            __Pyx_INCREF(__pyx_t_5);
  12951            __Pyx_INCREF(function);
  12952            __Pyx_DECREF_SET(__pyx_t_4, function);
  12953          }
  12954        }
> 12955        __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_self->_instance) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_self->_instance);
  12956        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  12957        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 2310, __pyx_L1_error)
  12958        __Pyx_GOTREF(__pyx_t_3);
  12959        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
#19 0x00007f0f372fc3f0 in __call__ () at /home/jonathan/Applications/sage/pkgs/sagemath-standard/sage/misc/cachefunc.pyx:2294
  2289                True
  2290    
  2291            """
  2292            return self.f(self._instance)
  2293    
> 2294        def __call__(self):
  2295            """
  2296            Call the cached method.
  2297    
  2298            EXAMPLES::
#20 0x00000000005f67b0 in _PyObject_MakeTpCall ()
#21 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#22 0x0000000000569470 in _PyEval_EvalCodeWithName ()
#23 0x000000000068daf0 in PyEval_EvalCode ()
#24 0x0000000000000000 in ?? ()
#25 0x0000000000000000 in ?? ()
#26 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#27 0x0000000000000000 in ?? ()
#28 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#29 0x0000000000000000 in ?? ()
#30 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#31 0x0000000000000000 in ?? ()
#32 0x0000000000000000 in ?? ()
#33 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#34 0x00000000005f6070 in _PyFunction_Vectorcall ()
#35 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#36 0x00000000005f6070 in _PyFunction_Vectorcall ()
#37 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#38 0x0000000000569470 in _PyEval_EvalCodeWithName ()
#39 0x0000000000000000 in ?? ()
#40 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#41 0x0000000000569470 in _PyEval_EvalCodeWithName ()
#42 0x00000000005f6070 in _PyFunction_Vectorcall ()
#43 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#44 0x0000000000569470 in _PyEval_EvalCodeWithName ()
#45 0x00000000005f6070 in _PyFunction_Vectorcall ()
#46 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#47 0x00000000005f6070 in _PyFunction_Vectorcall ()
#48 0x000000000056ace0 in _PyEval_EvalFrameDefault ()
#49 0x0000000000569470 in _PyEval_EvalCodeWithName ()
#50 0x000000000068daf0 in PyEval_EvalCode ()
#51 0x0000000000000000 in ?? ()
#52 0x0000000000000000 in ?? ()
#53 0x0000000000000000 in ?? ()
#54 0x000000000067f1e0 in PyRun_SimpleFileExFlags ()
#55 0x00000000006b76f0 in Py_RunMain ()
#56 0x00000000006b7c60 in Py_BytesMain ()
#57 0x00007f0f39feafc0 in __libc_start_main () at /build/glibc-eX1tMB/glibc-2.31/csu/../csu/libc-start.c:308
#58 0x00000000005fb100 in _start ()

[Inferior 1 (process 6651) detached]
27	../sysdeps/unix/sysv/linux/wait4.c: No such file or directory.
Saved trace to /home/jonathan/.sage/crash_logs/crash_63dver_a.log
------------------------------------------------------------------------
Unhandled SIGSEGV: A segmentation fault occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
------------------------------------------------------------------------
Segmentation fault (core dumped)

@orlitzky
Copy link
Contributor

comment:4

Possibly fixed by #31404.

@fchapoton
Copy link
Contributor

comment:5

bump to 9.6

@fchapoton fchapoton modified the milestones: sage-9.5, sage-9.6 Jan 29, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@vbraun
Copy link
Member Author

vbraun commented Oct 24, 2022

comment:8

The "too many indices" can also appear here

**********************************************************************
File "src/sage/matrix/matrix_gap.pyx", line 64, in sage.matrix.matrix_gap.Matrix_gap
Failed example:
    for ring in [ZZ, QQ, UniversalCyclotomicField(), GF(2), GF(3)]:
        M = MatrixSpace(ring, 2, implementation='gap')
        TestSuite(M).run(skip=['_test_construction'])
        M = MatrixSpace(ring, 2, 3, implementation='gap')
        TestSuite(M).run(skip=['_test_construction'])
Expected nothing
Got:
    Failure in _test_zero:
    Traceback (most recent call last):
      File "/var/lib/buildbot/worker/sage_git/build/src/sage/misc/sage_unittest.py", line 297, in run
        test_method(tester=tester)
      File "/var/lib/buildbot/worker/sage_git/build/src/sage/categories/additive_magmas.py", line 679, in _test_zero
        for x in tester.some_elements():
      File "/var/lib/buildbot/worker/sage_git/build/src/sage/misc/sage_unittest.py", line 576, in some_elements
        return list(some_tuples(S, repeat, self._max_runs, self._max_samples))
      File "/var/lib/buildbot/worker/sage_git/build/src/sage/matrix/matrix_space.py", line 2311, in some_elements
        for g in self.gens():
      File "/var/lib/buildbot/worker/sage_git/build/src/sage/categories/finite_dimensional_modules_with_basis.py", line 53, in gens
        return tuple(self.basis())
      File "/var/lib/buildbot/worker/sage_git/build/src/sage/matrix/matrix_space.py", line 1611, in basis
        v[r, c][r, c] = one
      File "sage/matrix/matrix0.pyx", line 1467, in sage.matrix.matrix0.Matrix.__setitem__
        self.set_unsafe(row, col, self._coerce_element(value))
      File "sage/matrix/matrix_gap.pyx", line 203, in sage.matrix.matrix_gap.Matrix_gap.set_unsafe
        self._libgap[i,j] = x
      File "sage/libs/gap/element.pyx", line 2891, in sage.libs.gap.element.GapElement_List.__setitem__
        raise ValueError('too many indices')
    ValueError: too many indices
    ------------------------------------------------------------
    The following tests failed: _test_zero
**********************************************************************
1 item had failures:
   1 of  19 in sage.matrix.matrix_gap.Matrix_gap
    [118 tests, 1 failure, 1.98 s]
doctest:warning
  File "/var/lib/buildbot/worker/sage_git/build/local/var/lib/sage/venv-python3.10.8/lib/python3.10/threading.py", line 973, in _bootstrap
    self._bootstrap_inner()
  File "/var/lib/buildbot/worker/sage_git/build/local/var/lib/sage/venv-python3.10.8/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
    self.run()
  File "/var/lib/buildbot/worker/sage_git/build/local/var/lib/sage/venv-python3.10.8/lib/python3.10/threading.py", line 953, in run
    self._target(*self._args, **self._kwargs)
  File "/var/lib/buildbot/worker/sage_git/build/local/var/lib/sage/venv-python3.10.8/lib/python3.10/multiprocessing/queues.py", line 244, in _feed
    obj = _ForkingPickler.dumps(obj)
  File "/var/lib/buildbot/worker/sage_git/build/local/var/lib/sage/venv-python3.10.8/lib/python3.10/multiprocessing/reduction.py", line 51, in dumps
    cls(buf, protocol).dump(obj)
  File "/var/lib/buildbot/worker/sage_git/build/local/var/lib/sage/venv-python3.10.8/lib/python3.10/warnings.py", line 109, in _showwarnmsg
    sw(msg.message, msg.category, msg.filename, msg.lineno,
:
RuntimeWarning: cypari2 leaked 139693603726504 bytes on the PARI stack
----------------------------------------------------------------------
sage -t --long --random-seed=0 src/sage/matrix/matrix_gap.pyx  # 1 doctest failed
----------------------------------------------------------------------

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants