The current ebuild has several issues: * the `--with-ntl="${EPREFIX}"/usr` configuration flag causes `-L/usr/lib` to be used in linking on 64bit archs. Upstream has merged PR that make the addition of the `="${EPREFIX}"/usr` unnecessary. * the package doesn't pass its test suite one test at least fails by segfault ================================================================== singular 4.2.0: Singular/dyn_modules/syzextra/test-suite.log ================================================================== # TOTAL: 1 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 FAIL: test_release.sh ===================== ./test.sh: line 6: 463288 Segmentation fault (core dumped) "$SINGULAR_EXECUTABLE" -tec 'LIB "schreyer.lib"; listvar(Top); example Sres; $' FAIL test_release.sh (exit status: 1) * Once installed the singular executable itself segfault on execution fbissey@tarazed ~ $ singular Segmentation fault (core dumped) In comparison, building singular 4.2.0_p3 with sage on the machine does work. Tricking The Gentoo singular executable will not segfault when tricked into using singular's libraries built in vanilla sage with the appropriate LD_LIBRARY_PATH. Removing the Gentoo patches has no effect. Forcing the C++ standard to c++11 has no effect. Reproducible: Always
The configuration flag `--disable-optimizationflags` which was added in the 4.2.0_p3 ebuild and wasn't present in 4.2.0_p1 is responsible for both the general segfault and the test failure.
I just found that the doc_install patch has a mistake. Will add to the PR.
Sorry, I hadn't seen this yet. I added --disable-optimizationflags to keep the build system from appending all of these to CFLAGS, OPTFLAGS="-g0 -O3 -Wno-unused-function -Wno-trigraphs -Wno-unused-parameter -Wunknown-pragmas -Wno-unused-variable -fomit-frame-pointer -fwrapv -fvisibility=default -finline-functions -fno-exceptions -fno-threadsafe-statics -fno-enforce-eh-specs -fconserve-space -funroll-loops -fno-delete-null-pointer-checks" because they were overriding the user's own CFLAGS. Let me see if I can reproduce this with CFLAGS="-O2 -pipe", and then I'll start to add those flags back until I find the one whose absence is causing the segfault.
It looks like "-fno-delete-null-pointer-checks" avoids the segfault. Note that the problem doesn't appear when CXXFLAGS is empty; it only shows up for me with CXXFLAGS="-O2". But then CXXFLAGS="-O2 -pipe -fno-delete-null-pointer-checks" is okay. Can you confirm that appending -fno-delete-null-pointer-checks in the ebuild (but leaving --disable-optimizationflags) fixes the issue? If so, I'll report this upstream.
I'll be on it as soon as I can. It is a bit busy right now.
Yes, adding that flag does the trick. No more singular crashes.
Ok, I reported upstream at https://github.com/Singular/Singular/issues/1105 If you want to update the PR I'll merge it ASAP (the other changes LGTM).
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0f67609cac00b0e0009925a651d2486f0ed61d34 commit 0f67609cac00b0e0009925a651d2486f0ed61d34 Author: François Bissey <frp.bissey@gmail.com> AuthorDate: 2021-07-02 00:17:49 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2021-07-02 00:42:13 +0000 sci-mathematics/singular: better flag control to avoid segfault Closes: https://bugs.gentoo.org/797655 Closes: https://github.com/gentoo/gentoo/pull/21381 Package-Manager: Portage-3.0.20, Repoman-3.0.2 Signed-off-by: François René Pierre Bissey <frp.bissey@gmail.com> Signed-off-by: Michael Orlitzky <mjo@gentoo.org> sci-mathematics/singular/singular-4.2.0_p3-r1.ebuild | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0972e08163c4ebf06a69371ba89051758735e46a commit 0972e08163c4ebf06a69371ba89051758735e46a Author: François Bissey <frp.bissey@gmail.com> AuthorDate: 2021-06-23 02:12:37 +0000 Commit: Michael Orlitzky <mjo@gentoo.org> CommitDate: 2021-07-02 00:40:24 +0000 sci-mathematics/singular: Fix QA issues in 4.2.0_p3 Package-Manager: Portage-3.0.20, Repoman-3.0.2 Bug: https://bugs.gentoo.org/797655 Signed-off-by: François René Pierre Bissey <frp.bissey@gmail.com> Signed-off-by: Michael Orlitzky <mjo@gentoo.org> .../singular/singular-4.2.0_p3-r1.ebuild | 104 +++++++++++++++++++++ 1 file changed, 104 insertions(+)