Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using arb, flint and ntl from Homebrew #30745

Closed
mkoeppe opened this issue Oct 8, 2020 · 44 comments
Closed

Allow using arb, flint and ntl from Homebrew #30745

mkoeppe opened this issue Oct 8, 2020 · 44 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Oct 8, 2020

/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 mkoeppe added this to the sage-9.2 milestone Oct 8, 2020
@mkoeppe

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Oct 8, 2020

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
Copy link
Member

vbraun commented Oct 10, 2020

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
Copy link
Member Author

mkoeppe commented Oct 11, 2020

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

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Oct 11, 2020

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
Copy link
Member Author

mkoeppe commented Oct 15, 2020

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/[email protected]/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/[email protected]/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/[email protected]/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
Copy link
Member Author

mkoeppe commented Oct 15, 2020

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
Copy link
Member Author

mkoeppe commented Oct 15, 2020

comment:8

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

@dimpase
Copy link
Member

dimpase commented Oct 20, 2020

comment:9

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

@mkoeppe
Copy link
Member Author

mkoeppe commented Oct 21, 2020

comment:10

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

@dimpase
Copy link
Member

dimpase commented Oct 21, 2020

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
Copy link
Member

dimpase commented Oct 21, 2020

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.

@mkoeppe mkoeppe modified the milestones: sage-9.2, sage-9.3 Oct 24, 2020
@dimpase
Copy link
Member

dimpase commented Nov 16, 2020

Branch: u/dimpase/build/brewenablearbetc

@dimpase
Copy link
Member

dimpase commented Nov 16, 2020

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
Copy link
Member

dimpase commented Nov 16, 2020

Commit: bb37468

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 17, 2020

Author: Dima Pasechnik

@dimpase
Copy link
Member

dimpase commented Nov 18, 2020

Dependencies: #29719

@dimpase
Copy link
Member

dimpase commented Nov 18, 2020

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
Copy link
Member

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
Copy link
Member

dimpase commented Nov 18, 2020

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.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 18, 2020

Changed commit from bb37468 to 2fd95cd

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Nov 18, 2020

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

2fd95cd"fixing" tests on #30745

@dimpase
Copy link
Member

dimpase commented Nov 18, 2020

comment:26

ready for review

@jhpalmieri
Copy link
Member

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

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Nov 20, 2020

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
Copy link
Member

kiwifb commented Nov 20, 2020

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
Copy link
Member Author

mkoeppe commented Nov 20, 2020

comment:30

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

@jhpalmieri
Copy link
Member

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
Copy link
Member

dimpase commented Nov 20, 2020

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
Copy link
Member

dimpase commented Nov 20, 2020

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
Copy link
Member

@mkoeppe
Copy link
Member Author

mkoeppe commented Nov 21, 2020

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

@slel
Copy link
Member

slel commented Nov 23, 2020

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
Copy link
Member

slel commented Nov 23, 2020

comment:37

Changing ticket summary; feel free to improve or revert.

@slel slel changed the title homebrew: Errors when homebrew's ntl, flint, or ecl are installed in /usr/local Allow using arb, flint and ntl from Homebrew Nov 23, 2020
@dimpase
Copy link
Member

dimpase commented Nov 24, 2020

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
Copy link
Member

vbraun commented Nov 29, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants