Changes between Initial Version and Version 1 of Ticket #24986


Ignore:
Timestamp:
03/15/18 10:47:40 (4 years ago)
Author:
embray
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24986 – Description

    initial v1  
    2121}}}
    2222
    23 Obviously Sage doesn't even allow creation of an order 1 field.  In fact, I traced the cause of this to an exact line, in `FiniteFieldFactory.create_key_and_extra_args` where, by chance, an `Integer` with a value of `1` is constructed (using `fast_tp_new`) whose `(mp_limb*)(Integer.value._mp_d)` member is assigned the same address as the `_mp_d` of the `Integer` that happens to hold the field's order.
     23Obviously Sage doesn't even allow creation of an order 1 field.  In fact, I traced the cause of this to a ''specific'' line in `FiniteFieldFactory.create_key_and_extra_args` where, by chance, an `Integer` with a value of `1` is constructed (using `fast_tp_new`) whose `(mp_limb*)(Integer.value._mp_d)` member is assigned the same address as the `_mp_d` of the `Integer` that happens to hold the field's order.
    2424
    2525The result is that the `order` is then set to `1` as well.  This happens ''after'' the check that `order>1` so creation of the field still succeeds.  Clearly there is a subtle bug either in `fast_tp_new`, or in the memory allocator itself.