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 cycliccover_finite_field.py #33304

Closed
vbraun opened this issue Feb 6, 2022 · 5 comments · Fixed by #38628
Closed

Random failure in cycliccover_finite_field.py #33304

vbraun opened this issue Feb 6, 2022 · 5 comments · Fixed by #38628

Comments

@vbraun
Copy link
Member

vbraun commented Feb 6, 2022

Non-reproducible random failures with the following traceback:

**********************************************************************
File "src/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1138, in sage.schemes.cyclic_covers.cycliccover_finite_field.CyclicCover_finite_field.frobenius_polynomial
Failed example:
    CyclicCover(11, PolynomialRing(GF(1129), 'x')([-1] + [0]*(5-1) + [1])).frobenius_polynomial() # long time
Exception raised:
    Traceback (most recent call last):
      File "sage/misc/cachefunc.pyx", line 1943, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10410)
        return cache[k]
    KeyError: ((11,), ())
    During handling of the above exception, another exception occurred:
    Traceback (most recent call last):
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 694, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/doctest/forker.py", line 1088, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.cyclic_covers.cycliccover_finite_field.CyclicCover_finite_field.frobenius_polynomial[23]>", line 1, in <module>
        CyclicCover(Integer(11), PolynomialRing(GF(Integer(1129)), 'x')([-Integer(1)] + [Integer(0)]*(Integer(5)-Integer(1)) + [Integer(1)])).frobenius_polynomial() # long time
      File "sage/misc/cachefunc.pyx", line 2310, in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (build/cythonized/sage/misc/cachefunc.c:13020)
        self.cache = f(self._instance)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1233, in frobenius_polynomial
        F = self.frobenius_matrix(self._N0)
      File "sage/misc/cachefunc.pyx", line 1948, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10546)
        w = self._instance_call(*args, **kwds)
      File "sage/misc/cachefunc.pyx", line 1824, in sage.misc.cachefunc.CachedMethodCaller._instance_call (build/cythonized/sage/misc/cachefunc.c:10012)
        return self.f(self._instance, *args, **kwds)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1071, in frobenius_matrix
        FrobP = _frobenius_matrix_p(self._N0)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1067, in _frobenius_matrix_p
        ] = self._frob(i, j + self._epsilon * self._r, N0)
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 993, in _frob
        self._initialize_fat_horizontal(
      File "/Users/buildbot-sage/worker/sage_git/build/local/var/lib/sage/venv-python3.9.9/lib/python3.9/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 737, in _initialize_fat_horizontal
        DH = [elt[0, 0] for elt in interval_products(D0, D1, targets)]
      File "sage/schemes/hyperelliptic_curves/hypellfrob.pyx", line 140, in sage.schemes.hyperelliptic_curves.hypellfrob.interval_products (build/cythonized/sage/schemes/hyperelliptic_curves/hypellfrob.cpp:3997)
        sig_on()
    SystemError: calling remove_from_pari_stack() inside sig_on()
**********************************************************************
1 item had failures:
   1 of  60 in sage.schemes.cyclic_covers.cycliccover_finite_field.CyclicCover_finite_field.frobenius_polynomial
    [168 tests, 1 failure, 64.56 s]
----------------------------------------------------------------------
sage -t --long --random-seed=0 src/sage/schemes/cyclic_covers/cycliccover_finite_field.py  # 1 doctest failed
----------------------------------------------------------------------

CC: @kiwifb

Component: geometry

Keywords: random_fail

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

@vbraun vbraun added this to the sage-9.6 milestone Feb 6, 2022
@vbraun
Copy link
Member Author

vbraun commented Feb 6, 2022

Changed keywords from none to random_fail

@seblabbe
Copy link
Contributor

seblabbe commented Feb 7, 2022

comment:2

I don't know if it is related, but the KeyError part reminds me of a failure reported by Justin on 9.5.rc4, see #33231.

@vbraun
Copy link
Member Author

vbraun commented Feb 7, 2022

comment:3

The KeyError is just because the value isn't cached, in response to it we try to compute the value and thats where things go wrong. So I don't think it has anything to do with the KeyError.

The inner traceback was truncated, is now complete.

@vbraun

This comment has been minimized.

@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@strogdon
Copy link

comment:5

I see this too when doctesting 9.6. It's difficult to reproduce when testing individually.

sage -t --long --warn-long 93.1 --random-seed=326768892435172328506243023113108037760 src/sage/schemes/cyclic_covers/cycliccover_finite_field.py
**********************************************************************
File "src/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1139, in sage.schemes.cyclic_covers.cycliccover_finite_field.CyclicCover_finite_field.frobenius_polynomial
Failed example:
    CyclicCover(11, PolynomialRing(GF(1129), 'x')([-1] + [0]*(5-1) + [1])).frobenius_polynomial() # long time
Exception raised:
    Traceback (most recent call last):
      File "sage/misc/cachefunc.pyx", line 1943, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10414)
        return cache[k]
    KeyError: ((11,), ())

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/doctest/forker.py", line 695, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/doctest/forker.py", line 1093, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.schemes.cyclic_covers.cycliccover_finite_field.CyclicCover_finite_field.frobenius_polynomial[23]>", line 1, in <module>
        CyclicCover(Integer(11), PolynomialRing(GF(Integer(1129)), 'x')([-Integer(1)] + [Integer(0)]*(Integer(5)-Integer(1)) + [Integer(1)])).frobenius_polynomial() # long time
      File "sage/misc/cachefunc.pyx", line 2310, in sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__ (build/cythonized/sage/misc/cachefunc.c:13024)
        self.cache = f(self._instance)
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1234, in frobenius_polynomial
        F = self.frobenius_matrix(self._N0)
      File "sage/misc/cachefunc.pyx", line 1948, in sage.misc.cachefunc.CachedMethodCaller.__call__ (build/cythonized/sage/misc/cachefunc.c:10550)
        w = self._instance_call(*args, **kwds)
      File "sage/misc/cachefunc.pyx", line 1824, in sage.misc.cachefunc.CachedMethodCaller._instance_call (build/cythonized/sage/misc/cachefunc.c:10016)
        return self.f(self._instance, *args, **kwds)
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1072, in frobenius_matrix
        FrobP = _frobenius_matrix_p(self._N0)
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 1068, in _frobenius_matrix_p
        ] = self._frob(i, j + self._epsilon * self._r, N0)
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 994, in _frob
        self._initialize_fat_horizontal(
      File "/local/sage-git/sage/local/var/lib/sage/venv-python3.10/lib/python3.10/site-packages/sage/schemes/cyclic_covers/cycliccover_finite_field.py", line 738, in _initialize_fat_horizontal
        DH = [elt[0, 0] for elt in interval_products(D0, D1, targets)]
      File "sage/schemes/hyperelliptic_curves/hypellfrob.pyx", line 140, in sage.schemes.hyperelliptic_curves.hypellfrob.interval_products (build/cythonized/sage/schemes/hyperelliptic_curves/hypellfrob.cpp:4008)
        sig_on()
    SystemError: calling remove_from_pari_stack() inside sig_on()

Is this a duplicate of #30419 ?

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 6, 2024
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304

URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 6, 2024
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304

URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 8, 2024
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304

URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 8, 2024
    
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304
    
URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 10, 2024
    
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304
    
URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 12, 2024
    
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304
    
URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s): Matthias Köppe
vbraun pushed a commit to vbraun/sage that referenced this issue Sep 14, 2024
    
set_ntl_matrix_modn_dense uses isinstance so there is a chance for
Python garbage collection to run. Presumably you get the

    SystemError: calling remove_from_pari_stack() inside sig_on()

if that happens.

Fixes sagemath#33304
    
URL: sagemath#38628
Reported by: Volker Braun
Reviewer(s): Matthias Köppe
@vbraun vbraun closed this as completed in 4fcf282 Sep 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants