The problematic bullet point in that PR is:

* Don't copy everything from the PARI stack. During the 2018 PARI/GP 
atelier, I talked to Karim Belabas about a strategy to achieve this. The 
basic idea is that we need to have a linked list containing the Gens which 
live on the PARI stack. When the time comes that we need to garbage collect 
the PARI stack, we traverse that list and copy the GEN objects from the 
PARI stack to the PARI heap.

That has been reverted in CyPari, which you could look at as a guide to 
what needs to be done.

The linked list design is not implemented correctly, and it is not clear if 
there is a reasonable way to fix it.  The Cypari2#112 
<https://github.com/sagemath/cypari2/issues/112> issue contains pretty 
concrete examples of how it prevents Gen objects from being deallocated.

- Marc



On Thursday, November 14, 2024 at 2:43:52 AM UTC-6 vdelecroix wrote:

> This is commit 551a5277456a3170dd690773e22f319cc1ad795a from
> https://github.com/sagemath/cypari2/pull/59.
>
> On Thu, 14 Nov 2024 at 09:13, David Roe <roed...@gmail.com> wrote:
> >
> > Thanks for the suggestion. Is there a PR when cypari2 started using 
> pointers on the PARI stack? I'm just trying to figure out how to make such 
> a change.
> > David
> >
> > On Thu, Nov 14, 2024 at 2:44 AM Vincent Delecroix <20100.d...@gmail.com> 
> wrote:
> >>
> >> Hi David,
> >>
> >> I think that a reasonable move is to revert the use of pointers on the
> >> PARI stack. It created a lot of trouble with memory management.
> >>
> >> Best
> >> Vincent
> >>
> >> On Thu, 14 Nov 2024 at 04:21, David Roe <roed...@gmail.com> wrote:
> >> >
> >> > This bug is continuing to seriously impact the LMFDB. We haven't had 
> a functional debugger for 3 years. It's preventing us from serving large 
> downloads, limiting users' ability to download large search results. Today, 
> it's interfering in efforts to add the Stein-Watkins and BHKSSW elliptic 
> curve databases to the LMFDB, since the files they contain are too large to 
> host with a non-threaded 30 second timeout.
> >> >
> >> > Help resolving the bug or suggesting workarounds is welcome.
> >> > David
> >> >
> >> > On Fri, Jun 4, 2021 at 3:54 PM David Roe <roed...@gmail.com> wrote:
> >> >>
> >> >>
> >> >>
> >> >> On Fri, Jun 4, 2021 at 3:24 PM Vincent Delecroix <
> 20100.d...@gmail.com> wrote:
> >> >>>
> >> >>> Thread support in cypari2 is definitely a reasonable requirement.
> >> >>> I don't think this is tested.
> >> >>>
> >> >>> It would be nice to
> >> >>>
> >> >>> 1) reproduce the segfault outside of sage only using python and
> >> >>> cypari2
> >> >>>
> >> >>> 2) open an issue on cypari2 development website at
> >> >>> https://github.com/sagemath/cypari2.
> >> >>
> >> >>
> >> >> Thanks. I've made https://github.com/sagemath/cypari2/issues/107.
> >> >> David
> >> >
> >> > --
> >> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group.
> >> > To unsubscribe from this group and stop receiving emails from it, 
> send an email to sage-devel+...@googlegroups.com.
> >> > To view this discussion visit 
> https://groups.google.com/d/msgid/sage-devel/CAChs6_m6a1akrUuX2s7dObcDJQ-jpH3WMZQauD8b3s00Xg0%3Dtw%40mail.gmail.com
> .
> >>
> >> --
> >> You received this message because you are subscribed to the Google 
> Groups "sage-devel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-devel+...@googlegroups.com.
> >> To view this discussion visit 
> https://groups.google.com/d/msgid/sage-devel/CAGEwAAk_sjON0uYO3gAmt3VsbaY69qMvFqVZnm_PtGPuEgKD-g%40mail.gmail.com
> .
> >
> > --
> > You received this message because you are subscribed to the Google 
> Groups "sage-devel" group.
> > To unsubscribe from this group and stop receiving emails from it, send 
> an email to sage-devel+...@googlegroups.com.
> > To view this discussion visit 
> https://groups.google.com/d/msgid/sage-devel/CAChs6_mLznvwxKea5RRAQVNWMiZREyGd3UU3TR2ybVTv_-u-fw%40mail.gmail.com
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/sage-devel/86377c29-ddac-40b9-90c9-6d3a1af292een%40googlegroups.com.

Reply via email to