Changes between Initial Version and Version 1 of Ticket #24986
- Timestamp:
- 03/15/18 10:47:40 (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #24986 – Description
initial v1 21 21 }}} 22 22 23 Obviously Sage doesn't even allow creation of an order 1 field. In fact, I traced the cause of this to a n 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.23 Obviously 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. 24 24 25 25 The 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.