#11116: Pynac module not initialized before being used. This causes a crash on
64-bit OpenSolaris.
------------------------+---------------------------------------------------
   Reporter:  drkirkby  |          Owner:  drkirkby  
       Type:  defect    |         Status:  new       
   Priority:  major     |      Milestone:  sage-4.7.1
  Component:  solaris   |       Keywords:            
Work_issues:            |       Upstream:  N/A       
   Reviewer:            |         Author:            
     Merged:            |   Dependencies:            
------------------------+---------------------------------------------------

Comment(by vbraun):

 Having spent the whole day yesterday worrying about import ordering, I
 must say that we have way too many circular imports. This is also an issue
 because we currently call Cython with `--disable-function-redefinition`
 that changes the import ordering for cython files to an old and obsolete
 behavior. But Sage relies on it, otherwise many of its circular imports
 break.

 It would be the wrong approach to require module X to load before module
 Y, this will just cause maintenance headaches down the road. Really, the
 problem is that module initializers do too much too early. If you start up
 Sage under a debugger then there are lots of non-trivial computations done
 in module initializers. Do we really need to construct some degree-20
 polynomials every time Sage starts up? I don't think so. I would deposit
 that
   * Module initializers should never require anything outside of their own
 module.
   * If there is the slightest doubt, make your initializer lazy.

 To my mind, the problem here in this ticket is that the
 `sage.symbolic.integration.integral` module instantiates its
 `IndefiniteIntegral` class,
 {{{
 indefinite_integral = IndefiniteIntegral()
 }}}
 which in turn calls into pynac to register itself. Really there is no
 reason for this to be immediate, and it opens a can of worms about
 initialization order.

 One could try to kludge around this and make
 `sage.symbolic.function.Function.__init__` delay the function registration
 with pynac until pynac is ready, or initialize pynac explicitly. But then
 somebody will find a way to not only initialize a pynac function, but also
 use it inside a module initalizer in a nontrivial way, and it would crash
 again.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11116#comment:17>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to