Ticket #11868: demonstrate_11868.patch

File demonstrate_11868.patch, 1.0 KB (added by jdemeyer, 11 years ago)

Patch to *demonstrate* the bug

  • sage/libs/pari/gen.pyx

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1317286264 -7200
    # Node ID 90b24e06fb6ab8fddf6c86797360761fb05432fd
    # Parent  4ba749730979c602cf45aa8f03b5ecf4ed470783
    Demonstrate the bug
    
    diff --git a/sage/libs/pari/gen.pyx b/sage/libs/pari/gen.pyx
    a b  
    443443        sig_off()
    444444        return h
    445445
     446    def demonstrate_t1GEN_bug(self, a, b):
     447        """
     448        This demonstrates Trac #11868.
     449
     450        EXAMPLES::
     451
     452            sage: K.<t> = NumberField(x^3-x+1)
     453            sage: pari(0).demonstrate_t1GEN_bug(t+1,t+1)
     454            Traceback (most recent call last):
     455            ...
     456            RuntimeError: Segmentation fault
     457        """
     458        t0GEN(a)
     459
     460        print "### t0 ###"
     461        sig_on(); dbgGEN(t0,-1); sig_off()
     462       
     463        t1GEN(b)
     464        print "### t0 (after creating t1) ###"
     465        sig_on(); dbgGEN(t0,-1); sig_off()
     466
    446467    def _testclass(self):
    447468        import test
    448469        T = test.testclass()