sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 481 forks source link

Allow using arb, flint and ntl from Homebrew #30745

Closed mkoeppe closed 3 years ago

mkoeppe commented 4 years ago

/usr/local is leaking into our build, through wrong orders of include and/or library directives.

Critical for 9.3 because it affects a major supported platform. We should at least give a configure-time error if these installations are found on homebrew if we cannot fix this.

Depends on #29719

CC: @dimpase @jhpalmieri @vbraun @nbruin @kiwifb

Component: build: configure

Author: Dima Pasechnik

Branch/Commit: 2fd95cd

Reviewer: John Palmieri

Issue created by migration from https://trac.sagemath.org/ticket/30745

mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -1,4 +1,4 @@
-- ntl/flint: https://groups.google.com/d/msg/sage-devel/KXK_zxzfhIQ/0MaSLhvMAAAJ
+- ntl/flint/singular: https://groups.google.com/d/msg/sage-devel/KXK_zxzfhIQ/0MaSLhvMAAAJ
 - ecl: Reported in https://groups.google.com/d/msg/sage-devel/gFaUNw4v3aw/P-dTJ5IOCgAJ

 `/usr/local` is leaking into our build, through wrong orders of include and/or library directives.
dimpase commented 4 years ago
comment:2

upstream ecl is indeed useless, as no known to me distro (gentoo, homebrew) provides sufficiently patched ecl-20. So we can have a spkg-configure.m4 for it, erroring out if it's found, on any distro.

perhaps ntl/flint/singular combo on homebrew is good enough for Sage?

vbraun commented 4 years ago
comment:3

Traditionally build systems are supposed to pick up stuff in /usr/local, so its a bit of a feature. Gentoo doesn't install anything there afaik, it is intended for stuff that users install by hand (i.e. non-portage in Gentoo). I consider it the big homebrew WTF.

Realistically, if you have stuff installed in /usr/local then you don't have a supported platform any more. Sure we should try to accommodate homebrew but imho not a blocker.

mkoeppe commented 4 years ago
comment:4

Replying to @vbraun:

Realistically, if you have stuff installed in /usr/local then you don't have a supported platform any more. Sure we should try to accommodate homebrew but imho not a blocker.

Given that since Sage 9.1, we recommend homebrew packages that the user should install, I don't think the view that a system with homebrew installed in /usr/local is not a "supported platform" has much practical value.

Setting it to "critical" rather than "blocker" because there is, of course, an easy remedy - just uninstall the useless homebrew packages that cause the problem.

mkoeppe commented 4 years ago

Description changed:

--- 
+++ 
@@ -3,4 +3,4 @@

 `/usr/local` is leaking into our build, through wrong orders of include and/or library directives.

-Blocker for 9.2 because it affects a major supported platform. We should at least give a configure-time error if these installations are found on homebrew if we cannot fix this.
+Critical for 9.2 because it affects a major supported platform. We should at least give a configure-time error if these installations are found on homebrew if we cannot fix this.
dimpase commented 4 years ago
comment:5

Replying to @vbraun:

Traditionally build systems are supposed to pick up stuff in /usr/local, so its a bit of a feature. Gentoo doesn't install anything there afaik, it is intended for stuff that users install by hand (i.e. non-portage in Gentoo). I consider it the big homebrew WTF.

Realistically, if you have stuff installed in /usr/local then you don't have a supported platform any more. Sure we should try to accommodate homebrew but imho not a blocker.

Despite your personal misgivings about Homebrew, this is a non-starter, Volker, sorry. Homebrew is the most popular macOS package manager out there, and it goes without saying that we want to support as many packages there as possible, and hopefully have a proper Homebrew Sage package.

As well, many *BSD systems install their packages in /usr/local, e.g. FreeBSD (where we now have a semi-working native package, with all the deps neatly divided into native packages), OpenBSD, etc.

mkoeppe commented 4 years ago
comment:6

Trying this with tox -e local-homebrew-usrlocal-standard. Building the ecl extension uses the following command line:

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -Isage/libs -I./sage/cpython -I/Users/mkoeppe/s/sage/sage-rebasing/.tox/local-homebrew-usrlocal-standard/local/lib/python3.8/site-packages/cysignals -I/Users/mkoeppe/s/sage/sage-rebasing/build/pkgs/sagelib/src -I/Users/mkoeppe/s/sage/sage-rebasing/build/pkgs/sagelib/src/sage/ext -I/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/include/python3.8 -I/Users/mkoeppe/s/sage/sage-rebasing/.tox/local-homebrew-usrlocal-standard/local/lib/python3.8/site-packages/numpy/core/include -Ibuild/cythonized -I/usr/local/include -I/usr/local/opt/openssl@1.1/include -I/usr/local/opt/sqlite/include -I/Users/mkoeppe/s/sage/sage-rebasing/.tox/local-homebrew-usrlocal-standard/local/include -I/usr/local/Cellar/python@3.8/3.8.6/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c build/cythonized/sage/libs/ecl.c -o build/temp.macosx-10.15-x86_64-3.8/build/cythonized/sage/libs/ecl.o -fno-strict-aliasing -DCYTHON_CLINE_IN_TRACEBACK=1 -std=c99

which indeed has /usr/local/include in front of $SAGE_LOCAL/include. (There is also CPATH, which is set to $SAGE_LOCAL/include; but CPATH is searched "after any paths given with -I options on the command line" - https://gcc.gnu.org/onlinedocs/gcc/Environment-Variables.html)

mkoeppe commented 4 years ago
comment:7

A related recent change was made in #29697 (sage_include_directories: Do not add another copy of SAGE_INC, SAGE_LOCAL/lib to include dirs, library dirs).

mkoeppe commented 4 years ago
comment:8

The correct fix for ecl is probably to call ecl-config to determine the correct flags. #30770

dimpase commented 4 years ago
comment:9

arb, ntl, and flint can and should just be enabled on Homebrew. ECL is a different story, as it lacks patches.

mkoeppe commented 4 years ago
comment:10

It's not quite that easy, I am afraid. There are still the threading issues such as #27764

dimpase commented 4 years ago
comment:11

Replying to @mkoeppe:

It's not quite that easy, I am afraid. There are still the threading issues such as #27764

these issues have solved themselves - I am able to build and doctest on macOS 10.15.7 with arb, ntl, flint from Homebrew just fine (with #30805 and doctest patches from the Flint 2.6 upgrade ticket).

dimpase commented 4 years ago
comment:12

more precisely, I see 2 doctests failing in src/sage/rings/polynomial/plural.pyx - not sure if this is related. The rest of make ptest passes.

dimpase commented 3 years ago

Branch: u/dimpase/build/brewenablearbetc

dimpase commented 3 years ago
comment:14

my tests show that we can use Homebrew's NTL, arb, and flint, and with flint 2.6.3 patches in it's time to advertise them.

For testing, don't forget to ran make arb-clean ntl-clean flint-clean after installing them in Homebrew.


New commits:

bb37468advertise NTL, flint, and arb on Homebrew
dimpase commented 3 years ago

Commit: bb37468

mkoeppe commented 3 years ago

Author: Dima Pasechnik

mkoeppe commented 3 years ago

Reviewer: https://github.com/mkoeppe/sage/actions/runs/367237067

jhpalmieri commented 3 years ago
comment:16

I'm getting some doctest errors, apparently from this. This is on OS X Big Sur with a beta release of Xcode 12.3, Sage 9.3.beta1 built from scratch:

File "src/sage/modules/fg_pid/fgp_module.py", line 130, in sage.modules.fg_pid.fgp_module
Failed example:
    y = f.lift(3*M1.0); y
Expected:
    (0, 13)
Got:
    (1, 0)
**********************************************************************
File "src/sage/modules/fg_pid/fgp_module.py", line 1288, in sage.modules.fg_pid.fgp_module.FGP_Module_class.coordinate_vector
Failed example:
    Q.coordinate_vector(-x, reduce=False)
Expected:
    (0, -4)
Got:
    (0, 8)
**********************************************************************
File "src/sage/modules/fg_pid/fgp_module.py", line 1417, in sage.modules.fg_pid.fgp_module.FGP_Module_class.optimized
Failed example:
    X
Expected:
    [0 4 0]
    [0 1 0]
    [0 0 1]
Got:
    [ 0 -8  0]
    [ 0  1  0]
    [ 0  0  1]
**********************************************************************
3 items had failures:
   1 of  45 in sage.modules.fg_pid.fgp_module
   1 of  23 in sage.modules.fg_pid.fgp_module.FGP_Module_class.coordinate_vector
   1 of  11 in sage.modules.fg_pid.fgp_module.FGP_Module_class.optimized
    [396 tests, 3 failures, 9.12 s]

and

sage -t --long --warn-long 198.4 --random-seed=0 src/sage/rings/polynomial/plural.pyx
**********************************************************************
File "src/sage/rings/polynomial/plural.pyx", line 401, in sage.rings.polynomial.plural.NCPolynomialRing_plural.__dealloc__
Failed example:
    R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
Exception raised:
    Traceback (most recent call last):
      File "/Users/palmieri/Sage/TESTING/sage-9.3.beta1/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 720, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/palmieri/Sage/TESTING/sage-9.3.beta1/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 1145, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.polynomial.plural.NCPolynomialRing_plural.__dealloc__[6]>", line 1, in <module>
        R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+Integer(2)*x, z*y:y*z-Integer(2)*y}, order=TermOrder('degrevlex', Integer(2)))
      File "/Users/palmieri/Sage/TESTING/sage-9.3.beta1/local/lib/python3.9/site-packages/sage/algebras/free_algebra.py", line 873, in g_algebra
        return g_Algebra(base_ring, cmat, dmat, names = names or self.variable_names(),
      File "sage/structure/factory.pyx", line 369, in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:2258)
        return self.get_object(version, key, kwds)
      File "sage/structure/factory.pyx", line 412, in sage.structure.factory.UniqueFactory.get_object (build/cythonized/sage/structure/factory.c:2652)
        obj = self.create_object(version, key, **extra_args)
      File "sage/rings/polynomial/plural.pyx", line 176, in sage.rings.polynomial.plural.G_AlgFactory.create_object (build/cythonized/sage/rings/polynomial/plural.cpp:5470)
        return NCPolynomialRing_plural(base_ring, names, c, d, order,
      File "sage/rings/polynomial/plural.pyx", line 334, in sage.rings.polynomial.plural.NCPolynomialRing_plural.__init__ (build/cythonized/sage/rings/polynomial/plural.cpp:6549)
        cdef RingWrap rw = ncalgebra(self._c, self._d, ring = P)
      File "sage/libs/singular/function.pyx", line 1334, in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:15148)
        return call_function(self, args, ring, interruptible, attributes)
      File "sage/libs/singular/function.pyx", line 1516, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:16998)
        with opt_ctx: # we are preserving the global options state here
      File "sage/libs/singular/function.pyx", line 1518, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:16910)
        sig_on()
    cysignals.signals.SignalError: Segmentation fault

and

File "src/sage/modules/free_module_morphism.py", line 353, in sage.modules.free_module_morphism.FreeModuleMorphism.lift
Failed example:
    f.lift([1/3])
Expected:
    (8, -16)
Got:
    (20, -48)
**********************************************************************
File "src/sage/modules/free_module_morphism.py", line 355, in sage.modules.free_module_morphism.FreeModuleMorphism.lift
Failed example:
    f.lift([1/2])
Expected:
    (12, -24)
Got:
    (30, -72)
**********************************************************************
File "src/sage/modules/free_module_morphism.py", line 357, in sage.modules.free_module_morphism.FreeModuleMorphism.lift
Failed example:
    f.lift([1/6])
Expected:
    (4, -8)
Got:
    (10, -24)
**********************************************************************
1 item had failures:
   3 of  22 in sage.modules.free_module_morphism.FreeModuleMorphism.lift

and

**********************************************************************
File "src/doc/en/constructions/algebraic_geometry.rst", line 145, in doc.en.constructions.algebraic_geometry
Failed example:
    print(L)
Expected:
    [1]:
       _[1]=y    
       _[2]=x    
    ...
Got:
    [1]:
       _[1]=y^2+y+1
       _[2]=x+1
    [2]:
       _[1]=y^2+y+1
       _[2]=x+y+1
    [3]:
       _[1]=y^2+y+1
       _[2]=x+y
    [4]:
       _[1]=y^2+y+1
       _[2]=x
    [5]:
       _[1]=y+1
       _[2]=x^2+x+1
    [6]:
       _[1]=y+1
       _[2]=x+1
    [7]:
       _[1]=y+1
       _[2]=x
    [8]:
       _[1]=y
       _[2]=x^2+x+1
    [9]:
       _[1]=y
       _[2]=x+1
    [10]:
       _[1]=y
       _[2]=x

and maybe one or two others.

dimpase commented 3 years ago
comment:17

most of these errors look like the things fixed in the branch of #29719 - which is marked as closed, but perhaps it's not in your/this branch yet?

dimpase commented 3 years ago
comment:18

The branch from #29719 is named public/packages/flint260 - you can try merging it and test again.

jhpalmieri commented 3 years ago
comment:19

I've tried on another computer (running OS X 10.15.7 this time), including the branch from #29719:

sage -t --long --random-seed=0 src/sage/functions/other.py  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/parallel/decorate.py  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/repl/preparse.py  # 12 doctests failed
sage -t --long --random-seed=0 src/sage/rings/polynomial/plural.pyx  # 2 doctests failed
sage -t --long --random-seed=0 src/sage/data_structures/mutable_poset.py  # 1 doctest failed
sage -t --long --random-seed=0 src/sage/rings/polynomial/pbori/randompoly.py  # 1 doctest failed

Most of these are due to Python 3.9, but this is new:

sage -t --long --random-seed=0 src/sage/rings/polynomial/plural.pyx

(Details in the previous comment.)

Not only is it new, but I see this error (a) with this branch (merged with #29719), but also (b) with homebrew's flint, ntl, and arb installed but with a standard develop branch from 9.3.beta1. If I remove those homebrew packages, the doctests pass. So just the presence of those packages is interfering with Sage's build somehow.

dimpase commented 3 years ago
comment:20

yes, I also see the error on plural.pyx, only on macOS with arb, ntl, flint from Homebrew. This is very localised (and lighly used). I'd try to reproduce it in Singular directly, but it should not really prevent this branch being merged.

Anyhow, arb has nothing to do with Singular, and I fail to see differences between ntl+flint from Homebrew and ntl+flint 2.6.3 from #29719.

That ntl and flint install in Homebrew affect (lib)Singular linked with other instances of ntl and flint is a Singular bug. I'll report it.

dimpase commented 3 years ago

Dependencies: #29719

dimpase commented 3 years ago
comment:22

the plural.pyx doctest error iso a Heisenbug. The following, i.e. repeating a part of this test a bit earlier in the lets the tests there pass for me. Needless to say, it cannot be reproduced in the Sage prompt, either.

--- a/src/sage/rings/polynomial/plural.pyx
+++ b/src/sage/rings/polynomial/plural.pyx
@@ -367,6 +367,8 @@ cdef class NCPolynomialRing_plural(Ring):
             True
             sage: H is loads(dumps(H))  # indirect doctest
             True
+            sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3)
+            sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))

         Check that :trac:`17224` is fixed::

If you like I can add this "fix" to the branch.

alternatively, if I just change the order of tests, using randorder option, everything works too:

./sage -tp --random-seed=0 --randorder=42 --long src/sage/rings/polynomial/plural.pyx
jhpalmieri commented 3 years ago
comment:23

That's sweeping things under the rug. Not necessarily the worst thing to do, but I wish there were an actual fix. I guess if we "fix" this now and upstream fixes the real bug pretty soon, it's a good approach.

dimpase commented 3 years ago
comment:24

Replying to @jhpalmieri:

That's sweeping things under the rug. Not necessarily the worst thing to do, but I wish there were an actual fix. I guess if we "fix" this now and upstream fixes the real bug pretty soon, it's a good approach.

Yes, certainly, what I propose is not a real fix.

Just reproducing the Heisenbug in question outside of the testing framework is a very tall order, leave alone fixing it. By the way, if I run the tests with ./sage -tp 8 src/sage/ then the bug does not show, either. Maybe it's a OS bug, who knows.

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Changed commit from bb37468 to 2fd95cd

7ed8c4ca-6d56-4ae9-953a-41e42b4ed313 commented 3 years ago

Branch pushed to git repo; I updated commit sha1. New commits:

2fd95cd"fixing" tests on #30745
dimpase commented 3 years ago
comment:26

ready for review

jhpalmieri commented 3 years ago
comment:27

This whole thing makes no sense to me. I agree that the problem is there with #29719. If instead of your change, I do this:

diff --git a/src/sage/rings/polynomial/plural.pyx b/src/sage/rings/polynomial/plural.pyx
index c2792aec88..500253533a 100644
--- a/src/sage/rings/polynomial/plural.pyx
+++ b/src/sage/rings/polynomial/plural.pyx
@@ -399,6 +399,8 @@ cdef class NCPolynomialRing_plural(Ring):
             sage: R1 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
             sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3)
             sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
+            sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3)
+            sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
             sage: A3.<x,y,z> = FreeAlgebra(GF(11), 3)
             sage: R3 = A3.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
             sage: A4.<x,y,z> = FreeAlgebra(GF(13), 3)

then I get a more detailed segfault:

sage -t --random-seed=0 src/sage/rings/polynomial/plural.pyx
**********************************************************************
File "src/sage/rings/polynomial/plural.pyx", line 401, in sage.rings.polynomial.plural.NCPolynomialRing_plural.__dealloc__
Failed example:
    R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2))
Exception raised:
    Traceback (most recent call last):
      File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.3.beta1/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 720, in _run
        self.compile_and_execute(example, compiler, test.globs)
      File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.3.beta1/local/lib/python3.9/site-packages/sage/doctest/forker.py", line 1145, in compile_and_execute
        exec(compiled, globs)
      File "<doctest sage.rings.polynomial.plural.NCPolynomialRing_plural.__dealloc__[6]>", line 1, in <module>
        R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+Integer(2)*x, z*y:y*z-Integer(2)*y}, order=TermOrder('degrevlex', Integer(2)))
      File "/Users/jpalmier/Desktop/Sage/sage_builds/TESTING/sage-9.3.beta1/local/lib/python3.9/site-packages/sage/algebras/free_algebra.py", line 873, in g_algebra
        return g_Algebra(base_ring, cmat, dmat, names = names or self.variable_names(),
      File "sage/structure/factory.pyx", line 369, in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:2258)
        return self.get_object(version, key, kwds)
      File "sage/structure/factory.pyx", line 412, in sage.structure.factory.UniqueFactory.get_object (build/cythonized/sage/structure/factory.c:2652)
        obj = self.create_object(version, key, **extra_args)
      File "sage/rings/polynomial/plural.pyx", line 176, in sage.rings.polynomial.plural.G_AlgFactory.create_object (build/cythonized/sage/rings/polynomial/plural.cpp:5471)
        return NCPolynomialRing_plural(base_ring, names, c, d, order,
      File "sage/rings/polynomial/plural.pyx", line 334, in sage.rings.polynomial.plural.NCPolynomialRing_plural.__init__ (build/cythonized/sage/rings/polynomial/plural.cpp:6550)
        cdef RingWrap rw = ncalgebra(self._c, self._d, ring = P)
      File "sage/libs/singular/function.pyx", line 1334, in sage.libs.singular.function.SingularFunction.__call__ (build/cythonized/sage/libs/singular/function.cpp:15149)
        return call_function(self, args, ring, interruptible, attributes)
      File "sage/libs/singular/function.pyx", line 1516, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:16999)
        with opt_ctx: # we are preserving the global options state here
      File "sage/libs/singular/function.pyx", line 1518, in sage.libs.singular.function.call_function (build/cythonized/sage/libs/singular/function.cpp:16911)
        sig_on()
    cysignals.signals.SignalError: Segmentation fault
    Killed due to bus error
**********************************************************************
Tests run before process (pid=40470) failed:
sage: A.<x,y,z> = FreeAlgebra(QQ, 3) ## line 51 ##

  [snip]

sage: from sage.rings.polynomial.plural import NCPolynomialRing_plural ## line 396 ##
sage: from sage.algebras.free_algebra import FreeAlgebra ## line 397 ##
sage: A1.<x,y,z> = FreeAlgebra(QQ, 3) ## line 398 ##
sage: R1 = A1.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) ## line 399 ##
sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3) ## line 400 ##
sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) ## line 401 ##
sage: A2.<x,y,z> = FreeAlgebra(GF(5), 3) ## line 402 ##
sage: R2 = A2.g_algebra({y*x:x*y-z, z*x:x*z+2*x, z*y:y*z-2*y}, order=TermOrder('degrevlex', 2)) ## line 403 ##
------------------------------------------------------------------------
0   signals.cpython-39-darwin.so        0x0000000103090252 print_backtrace + 66
1   signals.cpython-39-darwin.so        0x0000000103094167 sigdie + 39
2   signals.cpython-39-darwin.so        0x0000000103094102 sigdie_for_sig + 290
3   libsystem_platform.dylib            0x00007fff6e8865fd _sigtramp + 29
4   Python                              0x00000001014c3eb0 _Py_FalseStruct + 0
5   multi_polynomial_libsingular.cpytho 0x0000000154c6810b _ZL109__pyx_f_4sage_5rings_10polynomial_28multi_polynomial_libsingular_23MPolynomial_libsingular__new_constant_polyP90__pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomial_libsingularP7_objectP94__pyx_obj_4sage_5rings_10polynomial_28multi_polynomial_libsingular_MPolynomialRing_libsingulari + 571
6   multi_polynomial_libsingular.cpytho 0x0000000154c8e1db _ZL111__pyx_pw_4sage_5rings_10polynomial_28multi_polynomial_libsingular_23MPolynomial_libsingular_9_new_constant_polyP7_objectS0_S0_ + 123
7   Python                              0x0000000101321487 cfunction_call + 122
8   polynomial_element.cpython-39-darwi 0x00000001514c90bd __pyx_f_4sage_5rings_10polynomial_18polynomial_element_27PolynomialBaseringInjection__call_ + 397
9   parent.cpython-39-darwin.so         0x00000001030d84b7 __pyx_pw_4sage_9structure_6parent_6Parent_33__call__ + 1207
10  args.cpython-39-darwin.so           0x0000000152a3b8cd __Pyx_PyObject_CallOneArg + 237
11  args.cpython-39-darwin.so           0x0000000152a56e8c __pyx_gb_4sage_6matrix_4args_10MatrixArgs_12generator1 + 9996
12  cachefunc.cpython-39-darwin.so      0x00000001023e8aea __Pyx_Coroutine_SendEx + 122
13  Python                              0x00000001013086ca list_extend + 246
14  Python                              0x00000001012df55f PySequence_List + 47
15  args.cpython-39-darwin.so           0x0000000152a3d10b __pyx_f_4sage_6matrix_4args_10MatrixArgs_list + 363
16  matrix_generic_dense.cpython-39-dar 0x0000000152a8b758 __pyx_pw_4sage_6matrix_20matrix_generic_dense_20Matrix_generic_dense_1__init__ + 520
17  Python                              0x000000010133321b type_call + 150
18  Python                              0x00000001012f0b47 _PyObject_MakeTpCall + 266
19  Python                              0x0000000101398bd7 call_function + 455
20  Python                              0x0000000101395d34 _PyEval_EvalFrameDefault + 27452
21  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
22  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
23  Python                              0x00000001012f09cc _PyObject_FastCallDictTstate + 149
24  Python                              0x00000001012f1435 _PyObject_Call_Prepend + 139
25  Python                              0x0000000101338e83 slot_tp_call + 87
26  matrix0.cpython-39-darwin.so        0x0000000152e16125 __pyx_pw_4sage_6matrix_7matrix0_6Matrix_37change_ring + 2725
27  plural.cpython-39-darwin.so         0x0000000154e5ca7a _ZL25__Pyx_PyObject_CallOneArgP7_objectS0_ + 138
28  plural.cpython-39-darwin.so         0x0000000154e8c1f7 _ZL84__pyx_pw_4sage_5rings_10polynomial_6plural_12G_AlgFactory_3create_key_and_extra_argsP7_objectS0_S0_ + 5175
29  Python                              0x00000001012f0b47 _PyObject_MakeTpCall + 266
30  Python                              0x00000001012f2e78 method_vectorcall + 205
31  Python                              0x00000001012f0ec3 PyVectorcall_Call + 146
32  factory.cpython-39-darwin.so        0x0000000150d3f2ce __pyx_pw_4sage_9structure_7factory_13UniqueFactory_5__call__ + 206
33  Python                              0x00000001012f0b47 _PyObject_MakeTpCall + 266
34  Python                              0x0000000101398bd7 call_function + 455
35  Python                              0x0000000101395e9e _PyEval_EvalFrameDefault + 27814
36  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
37  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
38  Python                              0x00000001012f2e4f method_vectorcall + 164
39  Python                              0x0000000101398ba3 call_function + 403
40  Python                              0x0000000101395e9e _PyEval_EvalFrameDefault + 27814
41  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
42  Python                              0x000000010138f11d PyEval_EvalCode + 79
43  Python                              0x000000010138c457 builtin_exec + 581
44  Python                              0x0000000101320d43 cfunction_vectorcall_FASTCALL + 203
45  Python                              0x0000000101398ba3 call_function + 403
46  Python                              0x0000000101395de0 _PyEval_EvalFrameDefault + 27624
47  Python                              0x00000001012f11ec function_code_fastcall + 97
48  Python                              0x0000000101398ba3 call_function + 403
49  Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
50  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
51  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
52  Python                              0x0000000101398ba3 call_function + 403
53  Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
54  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
55  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
56  Python                              0x0000000101398ba3 call_function + 403
57  Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
58  Python                              0x00000001012f11ec function_code_fastcall + 97
59  Python                              0x0000000101398ba3 call_function + 403
60  Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
61  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
62  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
63  Python                              0x00000001012f0a0b _PyObject_FastCallDictTstate + 212
64  Python                              0x00000001012f1435 _PyObject_Call_Prepend + 139
65  Python                              0x0000000101338e83 slot_tp_call + 87
66  Python                              0x00000001012f0b47 _PyObject_MakeTpCall + 266
67  Python                              0x0000000101398bd7 call_function + 455
68  Python                              0x0000000101395de0 _PyEval_EvalFrameDefault + 27624
69  Python                              0x00000001012f11ec function_code_fastcall + 97
70  Python                              0x0000000101398ba3 call_function + 403
71  Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
72  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
73  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
74  Python                              0x00000001012f2e4f method_vectorcall + 164
75  Python                              0x0000000101398ba3 call_function + 403
76  Python                              0x0000000101395e9e _PyEval_EvalFrameDefault + 27814
77  Python                              0x00000001012f11ec function_code_fastcall + 97
78  Python                              0x0000000101398ba3 call_function + 403
79  Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
80  Python                              0x00000001012f11ec function_code_fastcall + 97
81  Python                              0x00000001012f0a0b _PyObject_FastCallDictTstate + 212
82  Python                              0x00000001012f1435 _PyObject_Call_Prepend + 139
83  Python                              0x0000000101339a1e slot_tp_init + 87
84  Python                              0x000000010133321b type_call + 150
85  Python                              0x00000001012f0b47 _PyObject_MakeTpCall + 266
86  Python                              0x0000000101398bd7 call_function + 455
87  Python                              0x0000000101395de0 _PyEval_EvalFrameDefault + 27624
88  Python                              0x00000001012f11ec function_code_fastcall + 97
89  Python                              0x0000000101398ba3 call_function + 403
90  Python                              0x0000000101395d34 _PyEval_EvalFrameDefault + 27452
91  Python                              0x00000001012f11ec function_code_fastcall + 97
92  Python                              0x0000000101398ba3 call_function + 403
93  Python                              0x0000000101395d34 _PyEval_EvalFrameDefault + 27452
94  Python                              0x00000001012f11ec function_code_fastcall + 97
95  Python                              0x00000001012f2e4f method_vectorcall + 164
96  Python                              0x0000000101398ba3 call_function + 403
97  Python                              0x0000000101395d34 _PyEval_EvalFrameDefault + 27452
98  Python                              0x00000001013996eb _PyEval_EvalCode + 1998
99  Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
100 Python                              0x0000000101398ba3 call_function + 403
101 Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
102 Python                              0x00000001013996eb _PyEval_EvalCode + 1998
103 Python                              0x00000001012f117c _PyFunction_Vectorcall + 248
104 Python                              0x0000000101398ba3 call_function + 403
105 Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
106 Python                              0x00000001012f11ec function_code_fastcall + 97
107 Python                              0x0000000101398ba3 call_function + 403
108 Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
109 Python                              0x00000001012f11ec function_code_fastcall + 97
110 Python                              0x0000000101398ba3 call_function + 403
111 Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
112 Python                              0x00000001012f11ec function_code_fastcall + 97
113 Python                              0x0000000101398ba3 call_function + 403
114 Python                              0x0000000101395d18 _PyEval_EvalFrameDefault + 27424
115 Python                              0x00000001013996eb _PyEval_EvalCode + 1998
116 Python                              0x000000010138f11d PyEval_EvalCode + 79
117 Python                              0x00000001013ca185 run_eval_code_obj + 110
118 Python                              0x00000001013c957d run_mod + 103
119 Python                              0x00000001013c8441 PyRun_FileExFlags + 241
120 Python                              0x00000001013c7a31 PyRun_SimpleFileExFlags + 271
121 Python                              0x00000001013df94d Py_RunMain + 1839
122 Python                              0x00000001013dfc86 pymain_main + 306
123 Python                              0x00000001013dfcd4 Py_BytesMain + 42
124 libdyld.dylib                       0x00007fff6e68dcc9 start + 1
------------------------------------------------------------------------
Unhandled SIGBUS: A bus error occurred.
This probably occurred because a *compiled* module has a bug
in it and is not properly wrapped with sig_on(), sig_off().
Python will now terminate.
------------------------------------------------------------------------

**********************************************************************
----------------------------------------------------------------------
sage -t --random-seed=0 src/sage/rings/polynomial/plural.pyx  # Killed due to bus error

Does that convey any useful information?

dimpase commented 3 years ago

Description changed:

--- 
+++ 
@@ -3,4 +3,4 @@

 `/usr/local` is leaking into our build, through wrong orders of include and/or library directives.

-Critical for 9.2 because it affects a major supported platform. We should at least give a configure-time error if these installations are found on homebrew if we cannot fix this.
+Critical for 9.3 because it affects a major supported platform. We should at least give a configure-time error if these installations are found on homebrew if we cannot fix this.
dimpase commented 3 years ago
comment:28

The problem is certainly not in flint update, which is modern high quality code, but in Singular's plural package, which is relying on 9-year old C++, not used much, either, no wonder it misbehaves.

I cc few people who might tell us more about the dump (I can reproduce it, so it's not random).

It seems that Singular with Clang is not tested much (e.g. Singular built on OpenBSD 6.7 and 6.8 with OpenBSD's clang 10 and 11: standalone Singular crashes on startup).

kiwifb commented 3 years ago
comment:29

At first glance, from what I can read, it looks like the system has to be "primed" before the error occurs. That suggests memory management issues - which have always been a hard topic in singular :(

mkoeppe commented 3 years ago
comment:30

Unfortunately it also seems that the Singular team is uninterested in portability testing - my pull request at https://github.com/Singular/Singular/pull/1018 has been sitting there without even an acknowledgment by the maintainers

jhpalmieri commented 3 years ago
comment:31

If this is really a Singular issue, then let's merge the bandaid and move on. Any objections? What is the status with ecl? Does that need a new ticket?

dimpase commented 3 years ago
comment:32

Also note #29528 which is about this Singular bug. As well, in #25993 (upgrade to Singular 4.1.3p2 - the latest) these tests are marked as # not tested. I tried the branch of #25993 with these tests reenabled, and they all work! And this doubling from comment:27 does not give any trouble either. So perhaps the latest Singular and the latest Flint are a winning combo?

dimpase commented 3 years ago
comment:33

Replying to @jhpalmieri:

If this is really a Singular issue, then let's merge the bandaid and move on. Any objections? What is the status with ecl? Does that need a new ticket?

yes, let's move on this. And open a new ticket for ecl.

jhpalmieri commented 3 years ago

Changed reviewer from https://github.com/mkoeppe/sage/actions/runs/367237067 to John Palmieri, https://github.com/mkoeppe/sage/actions/runs/367237067

mkoeppe commented 3 years ago

Changed reviewer from John Palmieri, https://github.com/mkoeppe/sage/actions/runs/367237067 to John Palmieri

slel commented 3 years ago
comment:36

Since the ECL part is postponed, should we update this ticket's summary and description?

Could the summary be: "Allow using arb, flint and ntl from Homebrew"?

Is the ECL issue part of #29617 or does it need a new ticket?

slel commented 3 years ago
comment:37

Changing ticket summary; feel free to improve or revert.

dimpase commented 3 years ago
comment:38

Replying to @slel:

Since the ECL part is postponed, should we update this ticket's summary and description?

Could the summary be: "Allow using arb, flint and ntl from Homebrew"?

Is the ECL issue part of #29617 or does it need a new ticket?

yes, #29617 would probably take care of this. Even better, we should upsteam to Homebrew "our" ECL patches.

vbraun commented 3 years ago

Changed branch from u/dimpase/build/brewenablearbetc to 2fd95cd