[SRU] Sage crashes on start due to a missmatched dependency

Bug #2040059 reported by Aitor Attarantato García
62
This bug affects 10 people
Affects Status Importance Assigned to Milestone
sagemath (Ubuntu)
Opinion
Undecided
Unassigned
Mantic
Fix Committed
Undecided
Unassigned

Bug Description

[ Impact ]

sage is completely unusable as it will fail to launch with the below error:

  File "/usr/lib/python3/dist-packages/sage/rings/polynomial/polynomial_ring_constructor.py", line 775, in _multi_variate
    from sage.rings.polynomial.multi_polynomial_libsingular import MPolynomialRing_libsingular
ImportError: libsingular-Singular-4.3.1.so: cannot open shared object file: No such file or directory

This is because sagemath was not rebuilt when new libsingular was introduced in Mantic. And as a result sagemath is still linked with and tries to load libsingular-Singular-4.3.1.so whereas Mantic now has libsingular-Singular-4.3.2.so

sagemath only needs a rebuild to correctly link it with the correct library.

[ Test Plan ]

* Execute "sage"
* if its not fixed then it will fail as the error above

* With fixed package, we will reach the "sage" prompt as below:

$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.5, Release Date: 2022-01-30 │
│ Using Python 3.11.6. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage:

* On the sage prompt, we can do some basic maths to test its working.

sage: 2 + 2
4

sage: factor(-2007)
-1 * 3^2 * 223

sage: A = matrix(4,4, range(16)); A
[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]
[12 13 14 15]

sage: factor(A.charpoly())
x^2 * (x^2 - 30*x - 80)

[ Where problems could occur ]

There is no change in code and only a rebuild and so user should not see any regression.
The only worry is that the failed doctests limit had to be increased for the build to succeed, so some of the functions might not work as documented.

[ Other Info ]

failed doctests limit had to be increased for the build to succeed. I do not have the resources to build it locally to debug why some of the doctests are failing.

The failed buildlog without an increase of the limit is at: https://launchpadlibrarian.net/712588440/buildlog_ubuntu-mantic-amd64.sagemath_9.5-6ubuntu0.1_BUILDING.txt.gz which took almost 1 hour 46 minutes to complete on launchpad-buildd.

The build log with increased limit is at: https://launchpadlibrarian.net/712708040/buildlog_ubuntu-mantic-amd64.sagemath_9.5-6ubuntu0.1_BUILDING.txt.gz

[ Original Bug Description ]

Ubuntu version: 23.10
SageMath version: 9.5.6

SageMath crashes when launching on the terminal. It seems that it expects libsingular 4.3.1 but instead 4.3.2 is the one in the repositories.

I attach a file with the output given by running sage in the terminal.

ProblemType: Bug
DistroRelease: Ubuntu 23.10
Package: sagemath 9.5-6
ProcVersionSignature: Ubuntu 6.5.0-9.9-generic 6.5.3
Uname: Linux 6.5.0-9-generic x86_64
NonfreeKernelModules: nvidia_modeset nvidia
ApportVersion: 2.27.0-0ubuntu5
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Sat Oct 21 16:47:39 2023
InstallationDate: Installed on 2023-10-20 (1 days ago)
InstallationMedia: Ubuntu 23.10.1 "Mantic Minotaur" - Release amd64 (20231016.1)
PackageArchitecture: all
ProcEnviron:
 LANG=es_ES.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 XDG_RUNTIME_DIR=<set>
SourcePackage: sagemath
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Aitor Attarantato García (attga) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in sagemath (Ubuntu):
status: New → Confirmed
Revision history for this message
fwjmath (fwjmath) wrote :

Same problem here, with exactly the same terminal output. This problem appears just after upgrading to Xubuntu 23.10.

Revision history for this message
Andrew Skalski (askalski) wrote :

Same here as well. Rebuilding the python3-sage package fixes it, but you need to increase the number of allowed test failures (200 is not enough) or the build will fail.

Changed in sagemath (Ubuntu Mantic):
status: New → In Progress
assignee: nobody → Sudip Mukherjee (sudipmuk)
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

sagemath is not in Noble as its not available in Debian unstable. But the bug tracking Noble can be re-visited if sagemath lands in Debian unstable before Noble freeze.

I have also confirmed that the bug is reproducible in Mantic.

Changed in sagemath (Ubuntu):
status: Confirmed → Opinion
summary: - Sage crashes on start due to a missmatched dependency
+ [SRU] Sage crashes on start due to a missmatched dependency
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

debdiff for Mantic attached.

description: updated
description: updated
description: updated
description: updated
Changed in sagemath (Ubuntu Mantic):
status: In Progress → Confirmed
assignee: Sudip Mukherjee (sudipmuk) → nobody
Revision history for this message
Dave Jones (waveform) wrote :

A no-change rebuild would be perfectly acceptable, but the more-or-less arbitrary bump in the text-failure limit makes me nervous. On the other hand, it's already "200" by default (!) so one might argue: if we're already ignoring 200 tests arbitrarily, what's 30 more non-specific failures? (of course, one might also argue: if we blindly ignore 200 non-specific tests ... why bother running them?).

However, the regression risk seems reasonable given that the current state is that the application won't even launch, and we obviously don't want to break things on upgrade. So, I'll do a full test-build locally (to get a feel for what sort of "expected failures" occur), and sponsor.

Revision history for this message
Dave Jones (waveform) wrote :

Uploaded with version adjusted to 9.5-6ubuntu1 (just to avoid one of the lintian warnings about a missing version).

I had a look through the test failures and quite a lot of them are a case of "output when not expecting any", with the output being deprecation warnings largely concerning pkg_resources and numpy types (which are not terribly surprising). It appears this is the bulk of the "extra count" required (comparing to the current archive build).

Other errors are cases of reductions changing (because sympy changed?) for certain things. For instance:

File "src/sage/calculus/calculus.py", line 1811, in sage.calculus.calculus.inverse_laplace
Failed example:
    inverse_laplace(1/s^2*exp(-s), s, t, algorithm='sympy')
Expected:
    -(log(e^(-t)) + 1)*heaviside(t - 1)
Got:
    (t - 1)*heaviside(t - 1)

Still others are errors that do look genuinely "wrong" to my eyes:

File "src/sage/env.py", line 16, in sage.env
Failed example:
    out == repr((SAGE_ROOT, SAGE_LOCAL)) # long time
Expected:
    True
Got:
    False

But I checked several of these cases against the current build in the archive, and these are not "new" either, so I'm reasonably satisfied the bulk of the extra error count is from new deprecations producing unexpected output for certain tests.

Revision history for this message
Robie Basak (racb) wrote :

I don't think the quality implications of allowing further test failures is something I'd normally be comfortable accepting. However, in this case, the package is not in Noble at all, removed from Debian testing for reasons that seem unlikely to be fixed by feature freeze, so I expect it to remain removed from Noble. So Noble isn't fixed, but nor does the package exist in Noble. What's the difference between this and the package being bad in Mantic? Dave points out that on release upgrade the removal in Noble would be explicit but for Mantic the package would remain and then start failing.

So, given the package is completely broken at the moment, I think it's OK to accept this into Mantic as it won't make the situation any worse, and some users may benefit from it working in Mantic.

It does seem like many people will be unhappy about sagemath being missing in Noble though. Volunteers to help with this are welcome!

Revision history for this message
Robie Basak (racb) wrote : Please test proposed package

Hello Aitor, or anyone else affected,

Accepted sagemath into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sagemath/9.5-6ubuntu0.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in sagemath (Ubuntu Mantic):
status: Confirmed → Fix Committed
tags: added: verification-needed verification-needed-mantic
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (sagemath/9.5-6ubuntu0.1)

All autopkgtests for the newly accepted sagemath (9.5-6ubuntu0.1) for mantic have finished running.
The following regressions have been reported in tests triggered by the package:

sagemath/9.5-6ubuntu0.1 (amd64)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/mantic/update_excuses.html#sagemath

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that the sage package in mantic-proposed has fixed the bug for me.

Test done:

1. enable mantic-proposed
2. Install sage
3. execute sage and confirm sage starts
4. execute the maths operation from the test plan
5. confirm all the operations worked

Test result: the errors with sage has been fixed.

Package tested:

$ dpkg -l | grep sagemath
ii sagemath 9.5-6ubuntu0.1 all Open Source Mathematical Software

The autopkgtest has failed because of the same error for which the number of tests was increased in the build. I will request an exception for the autopkgtest regression please.

tags: added: verification-done verification-done-mantic
removed: verification-needed verification-needed-mantic
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

I can't just override the release of the package, there is a process for that. In this case, I see two options:

a) bump the number of acceptable failures in debian/tests.mk. This means a new upload. (untested if it "fixes" the issue, but I see it runs the same tests as the build, so makes sense it would need the same limits)
b) Create an MP against ubuntu-hints[1] and mark this specific version of the package as having a bad test

I re-ran the tests with the migration-reference/0 trigger, and they passed[2][3], but that looks like a bug, because zero tests ran:

644s ImportError: libsingular-Singular-4.3.1.so: cannot open shared object file: No such file or directory
644s Success: 0 tests failed, up to 200 failures are tolerated

1. https://code.launchpad.net/~ubuntu-release/britney/+git/hints-ubuntu/+ref/mantic
2. https://autopkgtest.ubuntu.com/packages/s/sagemath/mantic/amd64
3. https://autopkgtest.ubuntu.com/results/autopkgtest-mantic/mantic/amd64/s/sagemath/20240307_171013_755e8@/log.gz

Revision history for this message
Dave Jones (waveform) wrote :

I had another look at this and it appears the default for MAX_TEST_FAILURES in d/tests.mk just needs bumping to match the new amount specified in d/rules (230). I'm happy to upload this change (it just matches what we've done in d/rules after all), but it's not going to migrate yet due to existing breakage in ipywidgets; specifically ipywidgets is currently stuck in proposed because jupyter-nbextension-jupyter-js-widgets has moved from ipywidgest to node-ipydatagrid and the latter is also stuck in proposed. I'll dig into this a bit further next week.

Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

My apologies. I had the debdiff ready and also verified from a PPA that the autopkgtest now works.

Autopkgtest results at: https://autopkgtest.ubuntu.com/results/autopkgtest-mantic-sudipmuk-sagemath-1/
PPA at: https://launchpad.net/~sudipmuk/+archive/ubuntu/sagemath-1/

I am confused with your comment about ipywidgets, thats noble-proposed, and this is for Mantic.

Debdiff attached.

Revision history for this message
Dave Jones (waveform) wrote :

> I am confused with your comment about ipywidgets, thats noble-proposed, and this is for Mantic.

Argh, getting confused myself between this and trying to get sagemath migrating in noble! :)

I'll upload this in a bit, thanks!

Revision history for this message
Dave Jones (waveform) wrote :

Argh, that upload was rejected because there's a deleted 9.5-6ubuntu0.2 in noble-proposed as a no-change rebuild, which therefore has different content (https://launchpad.net/ubuntu/+source/sagemath/9.5-6ubuntu0.2)!

I'll re-upload with some suitably weird version like 9.5-6ubuntu0.1.1

Revision history for this message
Timo Aaltonen (tjaalton) wrote : Please test proposed package

Hello Aitor, or anyone else affected,

Accepted sagemath into mantic-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/sagemath/9.5-6ubuntu0.1.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-mantic to verification-done-mantic. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-mantic. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

tags: added: verification-needed verification-needed-mantic
removed: verification-done verification-done-mantic
Revision history for this message
Sudip Mukherjee (sudipmuk) wrote :

I can confirm that the sagemath package in mantic-proposed has fixed the bug for me.

Test done according to the testplan:

$ sage
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.5, Release Date: 2022-01-30 │
│ Using Python 3.11.6. Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
sage: 2 + 2
4
sage: factor(-2007)
-1 * 3^2 * 223
sage: A = matrix(4,4, range(16)); A
[ 0 1 2 3]
[ 4 5 6 7]
[ 8 9 10 11]
[12 13 14 15]
sage: factor(A.charpoly())
x^2 * (x^2 - 30*x - 80)

Test result: the errors with sagemath has been fixed.

Package tested:

$ apt-cache policy sagemath
sagemath:
  Installed: 9.5-6ubuntu0.1.1
  Candidate: 9.5-6ubuntu0.1.1
  Version table:
 *** 9.5-6ubuntu0.1.1 100
        100 http://us.archive.ubuntu.com/ubuntu mantic-proposed/universe amd64 Packages
        100 /var/lib/dpkg/status
     9.5-6 500
        500 http://us.archive.ubuntu.com/ubuntu mantic/universe amd64 Packages

tags: added: verification-done verification-done-mantic
removed: verification-needed verification-needed-mantic
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.