4

When attempting to upgrade from 14.10 to 15.04 I'm running the following command.

sudo do-release-upgrade

The command is failing silently with no output on the command prompt.

What should be my first steps to troubleshoot this? Are there logs somewhere that I can check? I'm accustomed to more feedback from failing programs.

Edit 1: more info...

The command returns after about one second, and the exit code is 139, which indicates a segmentation fault.

Edit 2:

After running the following command

sudo strace -o do-release-upgrade.strace do-release-upgrade

You can find the strace output here: http://pastebin.com/hb5zthbb

16
  • Really no output?
    – A.B.
    May 6, 2015 at 15:42
  • Yep really no output. The command returns after about one second. Exit code is 139. I'll add that info to the question.
    – David
    May 6, 2015 at 15:50
  • 1
    Is there a mistake with sudo apt-get upgrade?
    – A.B.
    May 6, 2015 at 15:56
  • 1
    You could debug the program, it is Python. sudo apt-get install python3-pudb ;)
    – A.B.
    May 6, 2015 at 16:18
  • 1
    @AUmarMukthar yes, I did try the GUI upgrade, with similar results.
    – David
    May 6, 2015 at 17:58

2 Answers 2

3

Ok, I have a somewhat unusual answer:

Since do-release-upgrade is written in Python and in your profile you mention that you know about Python, I've used a Python debugger and for me the program runs correctly.

sudo apt-get install python3-pudb

Start the debugger with:

pudb3 $(which do-release-upgrade)

and localize the problem.

Then I looked at the strace output. That's the interesting part:

stat("/usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so", {st_mode=S_IFREG|0644, st_size=351400, ...}) = 0
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x184e6} ---

I make a forecast:

sudo apt-get install --reinstall python3-apt
4
  • Nice answer. This answers the question. Impressive forecast too. For me, the forecast does not solve the problem, but thanks for the suggestion.
    – David
    May 6, 2015 at 19:58
  • Do you have a solution?
    – A.B.
    May 6, 2015 at 20:00
  • I just added what I did as an answer. Unfortunately, no great solution.
    – David
    May 6, 2015 at 20:25
  • Reinstallation of python3-apt is not possible, it cannot be downloaded =(
    – alvas
    Apr 21, 2016 at 5:51
3

Here are the debugging steps that I took.

  1. Determined the failing program's return code

    sudo do-release-upgrade
    echo $?
    

    The code was 139

  2. Searched google for the return code to find out what it meant

    The code indicates a segmentation fault

  3. Used strace to get an idea of where the error was happening

    sudo strace -o do-release-upgrade.strace do-release-upgrade
    

    This wrote the trace log into a file named do-release-upgrade.strace, and the log showed, at the bottom, the runtime file in which the failure occurred.

  4. Ran the pudb3 debugger to debug do-release-upgrade

    If pudb3 is not installed yet.

    sudo apt-get install python3-pudb
    

    Run the pudb3 debugger

    sudo pudb3 /usr/bin/do-release-upgrade
    

    For those unfamiliar with debuggers, this allowed me to step through each execution point of the script.

    I quickly found the following error.

    Traceback (most recent call last):
      File "/usr/bin/do-release-upgrade", line 10, in <module>
        from UpdateManager.Core.MetaRelease import MetaReleaseCore
      File "/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py", line 25, in <module>
        import apt
      File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
        import apt_pkg
    ImportError:
    /usr/lib/python3/dist-packages/apt_pkg.cpython-34m-x86_64-linux-gnu.so:
    undefined symbol: _ZN13pkgSrcRecords4StepEv
    

    Which lead me to the corresponding ubuntu bug report

  5. Attempted removing and reinstalling the package indicated in the bug report

    First method

    sudo apt-get install --reinstall python3-apt
    

    Second, more drastic method

    sudo dpkg --purge --force-depends python3-apt
    sudo apt-get install python3-apt
    

    Neither of these fixed the problem.

Conclusion:

I still find it odd that the error was not printed to stdout; normally, I expect it should be. This solution should not have required a debugger.

This is a bug in the binary package python3-apt. Without fixing the bug and rebuilding the package, this error is likely to remain.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .