8.2 Weird Issues

  1. If you see
    > > - "*** glibc detected *** free(): invalid pointer: 0x0846a684 ***"
    
    when leaving Sage, you might wonder why.

    Martin Albrecht finally figured out how to solve this strange bug. The scenario: If you write a PYREX wrapper for some C code which needs to be linked to the GMP library and you load the extension you wrote during runtime into Sage you'll get such error messages on exit or even more strange behavior.

    This vanishes completely if you load your extension module during the startup of Sage like the other library wrappers/PYREX code (e.g. in sage/libs/all.py). This is because when you load the module the GMP library gets somehow reinitialized and all your prior GMP variables are not valid anymore. So when they are freed/cleared on exit you get this error stated above. Some objects relying on GMP are created during startup of Sage so you'll see this behavior as well if the first thing you do on the prompt is to load your library.

See About this document... for information on suggesting changes.