Opened 11 years ago

Last modified 9 years ago

#11868 closed defect

PARI library interface broken by design — at Version 2

Reported by: jdemeyer Owned by: was
Priority: major Milestone: sage-5.13
Component: interfaces Keywords: t0GEN t1GEN gen
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

The t0GEN(), t1GEN(),... system in the PARI interface is broken by design. Apply demonstrate_11868.patch to see the bug in action.

The problem is that the conversion of b (Python object) to t1 (PARI GEN) uses the PARI stack and therefore it clobbers the previously computed t0.

There is no urgent need to fix this, as the bug doesn't seem to occur in practice (it was discovered when working on #9334). It only occurs when:

  1. Calling a PARI function with at least 2 arguments besides self.
  2. Apart from the first non-self argument, there should be another argument which is a "complicated" Python type (e.g. a number field element).

As work-around, it is easy to defeat condition 2 by converting arguments to pari before calling the function.

Change History (3)

comment:1 Changed 11 years ago by jdemeyer

  • Description modified (diff)

The t0GEN(), t1GEN(),... system in the PARI interface is broken by design. Apply demonstrate_11868.patch to see the bug in action.

Changed 11 years ago by jdemeyer

Patch to *demonstrate* the bug

comment:2 Changed 11 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.