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

singular 3.1.7 fails to build using GCC 6 #20738

Closed
a-andre opened this issue May 31, 2016 · 17 comments
Closed

singular 3.1.7 fails to build using GCC 6 #20738

a-andre opened this issue May 31, 2016 · 17 comments

Comments

@a-andre
Copy link
Contributor

a-andre commented May 31, 2016

Till #17254 is ready. Let's add another patch to singular to fix a build issue with GCC 6.

Component: build

Keywords: GCC6 c++11

Author: André Apitzsch

Branch: 04c0af9

Reviewer: Volker Braun

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

@a-andre a-andre added this to the sage-7.3 milestone May 31, 2016
@kiwifb
Copy link
Member

kiwifb commented May 31, 2016

comment:2

This looks like OS X bits (macho-bundles). Has it also been tested on pre gcc-6.1 compilers? I guess the bots will answer that question soon.

@jdemeyer
Copy link
Contributor

jdemeyer commented Jun 1, 2016

comment:3

Can you replace &mach_o[0] by mach_o for simplicity?

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 1, 2016

Changed commit from d0da72b to 04c0af9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Jun 1, 2016

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

04c0af9replace &mach_o[0] by mach_o

@a-andre
Copy link
Contributor Author

a-andre commented Jun 1, 2016

comment:5

Replying to @jdemeyer:

Can you replace &mach_o[0] by mach_o for simplicity?

Done.

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jun 30, 2016

comment:6

While this (or a similar patch I posted on sage-release) allows building Singular with GCC 6.1 (and without -std=c++98 or -std=c++11), the resulting binaries crash for me (even when compiled with -std=c++98).

Seems we have to fiddle with optimization flags as well, which doesn't necessarily mean it's GCC's fault.

IIRC, with -O1 in CPPFLAGS (which aren't consistently used or get overridden by other settings, just like CXXFLAGS), I obtained a version (of Sage 7.2 btw.) where ./sage and ./sage --singular did no longer segfault, but building the documentation still crashed...

(The previous segfaults happened immediately when initializing libsingular, as also reported by someone else on sage-release, in a thread for Sage 7.3.beta2 related to GCC 6.1 and BRiAl.)

@vbraun
Copy link
Member

vbraun commented Jul 3, 2016

Changed keywords from GCC6 to GCC6 c++11

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

comment:8

My patch to Singular for C++11 is IMHO more straight-forward... ;-)

--- singular-3.1.7p1/kernel/mod_raw.cc	2014-11-19 14:06:05.000000000 +0100
+++ singular-3.1.7p1/kernel/mod_raw.cc	2016-06-19 23:27:19.420554691 +0200
@@ -38,8 +38,8 @@
 
 lib_types type_of_LIB(char *newlib, char *libnamebuf)
 {
-  const char mach_o[]={0xfe,0xed,0xfa,0xce,0};
-  const char mach_o_module[]={0xce,0xfa,0xed,0xfe,0};
+  const char mach_o[]="\xfe\xed\xfa\xce";
+  const char mach_o_module[]="\xce\xfa\xed\xfe";
   int i=0;
   while(si_bultin_libs[i]!=NULL)
   {

(I've put it into build/pkgs/singular/patches/remove_narrowing_conversion.patch.)

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

comment:9

Just for the record:

If I compile everything except the Singular 3.1.7p1 package (the latter with GCC 5.4) with GCC 6.1.0, ptestlong passes for me (modulo the usual noise in one doctest, and two GAP tests which pass when rerun, but that's again the same as with GCC 5.x).

This still refers to Sage 7.2 (plus some work-arounds).

So the Singular problem appears to be a singular one. XD

@vbraun
Copy link
Member

vbraun commented Jul 3, 2016

Reviewer: Volker Braun

@vbraun
Copy link
Member

vbraun commented Jul 3, 2016

comment:10

Singular works with -fno-delete-null-pointer-checks, which I added at #20926

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

comment:11

Replying to @vbraun:

Singular works with -fno-delete-null-pointer-checks, which I added at #20926

While it doesn't immediately crash, I'm getting doctest failures with that.

ptestlong hasn't (fully) finished yet, but it seems just because of a singular Singular process running 100%...

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

comment:12

Replying to @nexttime:

Replying to @vbraun:

Singular works with -fno-delete-null-pointer-checks, which I added at #20926

While it doesn't immediately crash, I'm getting doctest failures with that.

ptestlong hasn't (fully) finished yet, but it seems just because of a singular Singular process running 100%...

That's the last test it was waiting for (with Singular 100% busy for a while):

sage -t --long src/sage/schemes/plane_conics/con_rational_function_field.py
    Timed out (and interrupt failed)
**********************************************************************
Tests run before process (pid=10413) timed out:
sage: K = FractionField(PolynomialRing(QQ, 't')) ## line 17 ##
sage: P.<X, Y, Z> = K[] ## line 18 ##
sage: Conic(X^2 + Y^2 - Z^2) ## line 19 ##
Projective Conic Curve over Fraction Field of Univariate Polynomial Ring in t over Rational Field defined by X^2 + Y^2 - Z^2
sage: K.<t> = FractionField(QQ['t']) ## line 26 ##
sage: C = Conic([1,-t,t]) ## line 27 ##
sage: C.has_rational_point(point = True) ## line 28 ##
(True, (0 : 1 : 1))
sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 30 ##
0
sage: K = FractionField(PolynomialRing(QQ, 't')) ## line 58 ##
sage: P.<X, Y, Z> = K[] ## line 59 ##
sage: Conic(X^2 + Y^2 - Z^2) ## line 60 ##
Projective Conic Curve over Fraction Field of Univariate Polynomial Ring in t over Rational Field defined by X^2 + Y^2 - Z^2
sage: K = FractionField(PolynomialRing(QQ, 't')) ## line 67 ##
sage: Conic([K(1), 1, -1])._test_pickling() ## line 68 ##
sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 76 ##
0
sage: c = Conic([1, 1, 1]); c ## line 83 ##
Projective Conic Curve over Rational Field defined by x^2 + y^2 + z^2
sage: sig_on_count() # check sig_on/off pairings (virtual doctest) ## line 86 ##
0
sage: K.<t> = FractionField(PolynomialRing(QQ, 't')) ## line 129 ##
sage: C = Conic(K, [t^2-2, 2*t^3, -2*t^3-13*t^2-2*t+18]) ## line 130 ##
sage: C.has_rational_point() ## line 135 ##
True
sage: C.has_rational_point(point=True) ## line 137 ##
(True, (5*t : 8 : 1))
sage: F.<i> = QuadraticField(-1) ## line 139 ##
sage: R.<t> = F[] ## line 140 ##
sage: C = Conic([1,i*t,-t^2+4]) ## line 141 ##
sage: C.has_rational_point(point = True) ## line 142 ##
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
(True, (-t - 2*i : -2*i : 1))
sage: K.<t> = QQ[] ## line 149 ##
sage: C = Conic([4, -4, 8, 1, -4, t + 4]) ## line 150 ##
sage: C.has_rational_point(point=True) ## line 151 ##
(True, (1/2 : 1 : 0))
sage: K.<t> = QQ[] ## line 156 ##
sage: C = Conic(K, [t^2, (t-1), -2*(t-1)]) ## line 157 ##
sage: C.has_rational_point() ## line 158 ##
False
sage: C.has_rational_point(point=True) ## line 160 ##
(False, None)
sage: F.<t1> = FractionField(QQ['t1']) ## line 167 ##
sage: K.<t2> = FractionField(F['t2']) ## line 168 ##
sage: a = K(1) ## line 169 ##
sage: b = 2*t2^2+2*t1*t2-t1^2 ## line 170 ##
sage: c = -3*t2^4-4*t1*t2^3+8*t1^2*t2^2+16*t1^3-t2-48*t1^4 ## line 171 ##
sage: C = Conic([a,b,c]) ## line 172 ##
sage: C.has_rational_point() ## line 173 ##
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
sage: P.<u> = QQ[] ## line 186 ##
sage: E = P.fraction_field() ## line 187 ##
sage: Q.<Y> = E[] ## line 188 ##
sage: F.<v> = E.extension(Y^2 - u^3 - 1) ## line 189 ##
sage: R.<t> = F[] ## line 190 ##
sage: K = R.fraction_field() ## line 191 ##
sage: C = Conic(K, [u, v, 1]) ## line 192 ##
sage: C.has_rational_point() ## line 193 ##
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
verbose 0 (3369: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
sage: K.<t> = PolynomialRing(GF(7)) ## line 205 ##
sage: C = Conic([5*t^2+4, t^2+3*t+3, 6*t^2+3*t+2, 5*t^2+5, 4*t+3, 4*t^2+t+5]) ## line 206 ##
sage: C.has_rational_point() ## line 207 ##
sage: K.<t> = FractionField(PolynomialRing(QQ, 't')) ## line 224 ##
sage: a = (2*t^2 - 3/2*t + 1)/(37/3*t^2 + t - 1/4) ## line 225 ##
sage: b = (1/2*t^2 + 1/3)/(-73*t^2 - 2*t + 11/4) ## line 226 ##
sage: c = (6934/3*t^6 + 8798/3*t^5 - 947/18*t^4 + 3949/9*t^3 + 20983/18*t^2 + 28/3*t - 131/3)/(-2701/3*t^4 - 293/3*t^3 + 301/6*t^2 + 13/4*t - 11/16) ## line 227 ##
sage: C = Conic([a,b,c]) ## line 228 ##
sage: C.has_rational_point(point=True) ## line 229 ##
(True, (4*t + 4 : 2*t + 2 : 1))
sage: K.<t> = FractionField(PolynomialRing(QQ, 't')) ## line 234 ##
sage: a = (-1/3*t^6 - 14*t^5 - 1/4*t^4 + 7/2*t^2 - 1/2*t - 1)/(24/5*t^6 - t^5 - 1/4*t^4 + t^3 - 3*t^2 + 8/5*t + 5) ## line 235 ##
sage: b = (-3*t^3 + 8*t + 1/2)/(-1/3*t^3 + 3/2*t^2 + 1/12*t + 1/2) ## line 236 ##
sage: c = (1232009/225*t^25 - 1015925057/8100*t^24 + 1035477411553/1458000*t^23 + 7901338091/30375*t^22 - 1421379260447/729000*t^21 + 266121260843/972000*t^20 + 80808723191/486000*t^19 - 516656082523/972000*t^18 + 21521589529/40500*t^17 + 4654758997/21600*t^16 - 20064038625227/9720000*t^15 - 173054270347/324000*t^14 + 536200870559/540000*t^13 - 12710739349/50625*t^12 - 197968226971/135000*t^11 - 134122025657/810000*t^10 + 22685316301/120000*t^9 - 2230847689/21600*t^8 - 70624099679/270000*t^7 - 4298763061/270000*t^6 - 41239/216000*t^5 - 13523/36000*t^4 + 493/36000*t^3 + 83/2400*t^2 + 1/300*t + 1/200)/(-27378/125*t^17 + 504387/500*t^16 - 97911/2000*t^15 + 1023531/4000*t^14 + 1874841/8000*t^13 + 865381/12000*t^12 + 15287/375*t^11 + 6039821/6000*t^10 + 599437/1500*t^9 + 18659/250*t^8 + 1218059/6000*t^7 + 2025127/3000*t^6 + 1222759/6000*t^5 + 38573/200*t^4 + 8323/125*t^3 + 15453/125*t^2 + 17031/500*t + 441/10) ## line 237 ##
sage: C = Conic([a,b,c]) ## line 238 ##
sage: C.has_rational_point(point = True) # long time (4 seconds) ## line 239 ##

**********************************************************************

Excluding unrelated failures in src/sage/dev/, the following tests failed (still in 7.2) with Singular built with GCC 6.1.0 and -fno-delete-null-pointer-checks:

----------------------------------------------------------------------
...
sage -t --long src/sage/doctest/forker.py  # 1 doctest failed
sage -t --long src/sage/libs/singular/standard_options.py  # 2 doctests failed
sage -t --long src/sage/matrix/matrix_double_dense.pyx  # 1 doctest failed
sage -t --long src/sage/libs/gap/assigned_names.py  # 1 doctest failed
sage -t --long src/sage/rings/invariant_theory.py  # 13 doctests failed
sage -t --long src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py  # 2 doctests failed
sage -t --long src/sage/rings/ideal.py  # 1 doctest failed
sage -t --long src/sage/rings/polynomial/multi_polynomial_ideal.py  # 2 doctests failed
sage -t --long src/sage/rings/polynomial/multi_polynomial_ideal_libsingular.pyx  # 1 doctest failed
sage -t --long src/sage/schemes/elliptic_curves/ell_field.py  # 1 doctest failed
sage -t --long src/sage/schemes/elliptic_curves/ell_generic.py  # 1 doctest failed
sage -t --long src/sage/schemes/elliptic_curves/ell_curve_isogeny.py  # 1 doctest failed
sage -t --long src/sage/schemes/elliptic_curves/isogeny_small_degree.py  # 15 doctests failed
sage -t --long src/sage/schemes/elliptic_curves/jacobian.py  # 1 doctest failed
sage -t --long src/sage/tests/french_book/mpoly.py  # 1 doctest failed
sage -t --long src/sage/schemes/plane_conics/con_rational_function_field.py  # Timed out (and interrupt failed)
----------------------------------------------------------------------

The GAP failure is unrelated (but typical here, passes when rerun), while the forker doctest failure is indeed indirectly caused by Singular (or libsingular), also fails when rerun:

sage -t --long src/sage/doctest/forker.py
**********************************************************************
File "src/sage/doctest/forker.py", line 1402, in sage.doctest.forker.DocTestDispatcher.serial_dispatch
Failed example:
    DD.serial_dispatch()
Expected:
    sage -t .../rings/homset.py
        [... tests, ... s]
    sage -t .../rings/ideal.py
        [... tests, ... s]
Got:
    sage -t /data/Sage/release/stable/sage-7.2-gcc-6.1.0/src/sage/rings/homset.py
        [46 tests, 0.12 s]
    sage -t /data/Sage/release/stable/sage-7.2-gcc-6.1.0/src/sage/rings/ideal.py
    **********************************************************************
    File "/data/Sage/release/stable/sage-7.2-gcc-6.1.0/src/sage/rings/ideal.py", line 1611, in sage.rings.ideal.Cyclic
    Failed example:
        len(B)
    Expected:
        45
    Got:
        1
    **********************************************************************
    1 item had failures:
       1 of   9 in sage.rings.ideal.Cyclic
        [351 tests, 1 failure, 52.37 s]
**********************************************************************
1 item had failures:
   1 of  17 in sage.doctest.forker.DocTestDispatcher.serial_dispatch
    [439 tests, 1 failure, 63.08 s]
----------------------------------------------------------------------
sage -t --long src/sage/doctest/forker.py  # 1 doctest failed
----------------------------------------------------------------------

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

comment:13

All of the above Singular-related failures vanish when building Singular with -O1 -fno-delete-null-pointer-checks, so there's more optimization options we apparently have to disable with GCC 6.1.0.

@vbraun
Copy link
Member

vbraun commented Jul 3, 2016

Changed branch from u/aapitzsch/gcc6issue to 04c0af9

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

Changed commit from 04c0af9 to none

@nexttime
Copy link
Mannequin

nexttime mannequin commented Jul 3, 2016

comment:15

Replying to @nexttime:

All of the above Singular-related failures vanish when building Singular with -O1 -fno-delete-null-pointer-checks, so there's more optimization options we apparently have to disable with GCC 6.1.0.

With env CXXFLAGS="-fno-strict-overflow -fno-delete-null-pointer-checks" ./sage -f singular all Singular-related doctests again pass in make ptestlong.

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

4 participants