On Aug 5, 5:07 pm, Robert Bradshaw <rober...@math.washington.edu>
wrote:
> On Fri, Aug 5, 2011 at 1:10 PM, kcrisman <kcris...@gmail.com> wrote:
> > Recently, Leif and I have been trying to track down #11551 (Pari
> > segfaults on startup in Cygwin).
>
> > The problem occurs in a (to me) odd spot.  Namely, in sage/misc/
> > functional.py, there is an import of CDF.  Print statements show that
> > - all inside this one line! - we initialize PariInstance, go to
> > integer.pyx for the first time, and lots of other stuff.
>
> > The problem is that all of these things happen BEFORE ANY print
> > statements in complex_number.pyx!  Looking at complex_number.c, it
> > becomes clear that this is because Cython puts a lot of cimport and
> > other stuff long before the "regular" stuff in the C file.
>
> Yeah, it's a mess. By the time misc.all is done, most of the Sage
> library has been loaded, and in a completely chaotic order.
>
> > But I don't know enough about the order that these things happen in,
> > nor how to tell that from the C file, to trace it all out.  Can
> > someone give me a sense - or show me enough of how to do it so I can
> > do it myself - how to track what's being done in complex_number.
> > {pyx,c} so I can tell what modules to try debugging?  The Pari stack
> > is good in the whole of gen.pyx, and somehow has been corrupted by
> > integer.pyx, so it would suffice to know what is imported between
> > them.
>
> You can add import hooks to print out whenever a module is imported. I
> put a patch to do this up on trac, can't seem to locate it now.

Oh, that would be wonderful for this!  I don't even really know what a
"hook" is, but I assume it would do what you say, which is just what I
need.

> > As a side note, following the sage imports in sage/all.py is a
> > nightmare.  A whole bunch of the stuff supposedly imported later is
> > already imported right away, because we import sage/misc/all.py really
> > early on, which imports most functions from sage/misc/functional.py -
> > and that imports quite a bit of "main" Sage.
>
> +1. I would love for this to get better cleaned up.

Is there any particular reason that misc is imported first?  Anyway,
this sounds like a terribly huge job.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to