Changes between Version 89 and Version 117 of Ticket #13731


Ignore:
Timestamp:
12/03/12 13:04:46 (7 years ago)
Author:
SimonKing
Comment:

I have produced a new patchlevel for the singular spkg. The optional patch is now smaller, since I simply erase the content of the omalloc/ folder, so that the removed files are not part of the patch.

Needs review!

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #13731

    • Property Status changed from new to needs_review
  • Ticket #13731 – Description

    v89 v117  
     1We created a new patchlevel for the singular-3-1-5 spkg. It contains backports of some upstream fixes of several memory corruptions.
     2
     3If one does `export SINGULAR_XALLOC=yes` before installing the spkg, Singular's usual memory manager "omalloc" will be replaced by "xalloc". This is a compatibility layer on top of malloc. The resulting Singular executable and library will be slower, but allows the use of some debug tools.
     4
     5Here is the background.
     6
    17We have several indications that interaction with libsingular's memory management is tricky. Debugging is hard, because libsingular uses omalloc for its memory management and that hides all allocation/deallocation from conventional memory checking tools. Singular's allocation library is relatively pluggable, though, and (at a speed penalty) one can mostly switch it to using the system malloc for everything.
    28
    3 For that purpose, one can use one of the following:
     9Preliminary packages for linux and for osx using malloc are found here:
    410
    511* [http://sage.math.washington.edu/home/nbruin/singular-3-1-5.malloc-linux.spkg] (for linux). It replaces omalloc by the system malloc and tries to keep the changes small. It does build a libsingular library, but the Singular executable does not work.
    612* [http://sage.math.washington.edu/home/nbruin/singular-3-1-5.malloc.spkg] (for OSX). Same as the previous item.
     13
     14With the help from [https://groups.google.com/forum/?hl=en&fromgroups=#!topic/libsingular-devel/AZI-6eZAgus libsingular-devel], we managed to use xalloc instead of malloc. We now obtain Singular executable and library, and can still use debugging tools.
     15
     16'''__Install__'''
     17
    718* [http://sage.math.washington.edu/home/SimonKing/SAGE/spkgs/singular-3-1-5.p2.spkg] (both linux and OSX).
    8   * It contains [attachment:singular_15435.patch] and [attachment: singular_part_of_changeset_baadc0f7.patch], which backport upstream fixes.
    9   * It usually builds with omalloc. If `export SINGULAR_XALLOC=yes`, then it builds with xalloc, which is a compatibility layer for omalloc on top of malloc. See the discussion on [https://groups.google.com/forum/?hl=en&fromgroups=#!topic/libsingular-devel/AZI-6eZAgus libsingular-devel]
    10   * It builds both a working libsingular library and a Singular executable.
    1119
    12 With the [http://sage.math.washington.edu/home/nbruin/singular-3-1-5.malloc-linux.spkg linux spkg], one obtains:
     20The spkg contains [attachment:singular_15435.patch] and [attachment: singular_part_of_changeset_baadc0f7.patch], which backport upstream fixes.
     21It usually builds with omalloc. If `export SINGULAR_XALLOC=yes`, then it builds with xalloc, which is a compatibility layer for omalloc on top of malloc.
     22
     23'''__Bugs fixed__'''
     24
     25With the preliminary [http://sage.math.washington.edu/home/nbruin/singular-3-1-5.malloc-linux.spkg linux spkg], one obtains:
    1326{{{
    1427$ export MALLOC_CHECK_ 3
     
    4558    at sage/rings/polynomial/plural.cpp:12060
    4659}}}
    47 running it in valgrind gets you complaints about the same locations. Meanwhile two of the underlying problems where found and fixed upstream. [http://sage.math.washington.edu/home/SimonKing/SAGE/spkgs/singular-3-1-5.p2.spkg] contains backports of these fixes.
     60running it in valgrind gets you complaints about the same locations.
     61
     62On OSX, `MALLOC_CHECK_` is not available. But gmalloc does detect the crash.
     63
     64The new spkg fixes that problem
     65
     66'''__Testing__'''
     67
     68Meanwhile two of the underlying problems where found and fixed upstream. [http://sage.math.washington.edu/home/SimonKing/SAGE/spkgs/singular-3-1-5.p2.spkg] contains backports of these fixes. With the exeption of one unrelated problem in sage/graphs/, the whole Sage test suite passes on Linux with `export MALLOC_CHECK_=yes`.