New comment by tornaria on void-packages repository https://github.com/void-linux/void-packages/pull/34030#issuecomment-1000894040 Comment: Using this patch ```diff --- a/src/sage/rings/integer.pyx 2021-12-12 07:19:28.000000000 -0300 +++ b/src/sage/rings/integer.pyx 2021-12-24 13:09:22.860265615 -0300 @@ -4475,10 +4475,19 @@ cdef Integer z = PY_NEW(Integer) + cdef mpz_ptr zz + zz = (z.value) + print(zz._mp_alloc, zz._mp_size, zz._mp_d) + print([(zz._mp_d)[i] for i in range(zz._mp_size)]) + sig_on() mpz_fac_ui(z.value, mpz_get_ui(self.value)) sig_off() + zz = (z.value) + print(zz._mp_alloc, zz._mp_size, zz._mp_d) + print([(zz._mp_d)[i] for i in range(zz._mp_size)]) + return z def multifactorial(self, long k): ``` I get ```sage sage: sage.rings.integer.Integer.factorial(26) 2 0 94045612553408 [] 2 2 94045612553408 [16877220553537093632, 21862473] 403291461126605635584000000 sage: sage.rings.integer.Integer.factorial(27) 2 0 94045618588208 [] 3 2 94045618588208 [12963097176472289280, 590286795] 10888869450418352160768000000 ``` Note: the `940456...` are allocated pointers, so random; everything else should be similar I guess. Note 2: if you already have sage compiled, you can just patch the file and run `./sage -br` to recompile just this file. Not in the system installed version because that's readonly, but it works ok in the chroot.