lsb_release crashed with SIGABRT in Py_FatalError()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
| lsb (Ubuntu) |
High
|
Barry Warsaw | ||
| Precise |
High
|
Barry Warsaw | ||
| Quantal |
High
|
Barry Warsaw | ||
| Raring |
High
|
Barry Warsaw |
Bug Description
= SRU =
All Python system scripts should use -Es to ignore $PYTHON* envars and to ignore the user's site directory. This is a general recommendation.
[Test Case]
$ PYTHONHOME=
-> crashes without the fix
-> works correctly with the fix
[Regression Potential]
None expected.
= Details =
During the installation process of either VMware Player major version 4 or 5 you will receive a crash report regarding lsb-release as VMware ships a version of python 2 with the installer and the installation process calls lsb-release which uses python 3.
I'm just login, and the message to some application crashed pops up.
ProblemType: Crash
DistroRelease: Ubuntu 12.04
Package: lsb-release 4.0-0ubuntu19
ProcVersionSign
Uname: Linux 3.2.0-17-generic i686
ApportVersion: 1.92-0ubuntu1
Architecture: i386
Date: Wed Feb 22 13:45:24 2012
ExecutablePath: /usr/bin/
InterpreterPath: /usr/bin/
PackageArchitec
ProcCmdline: /usr/bin/python3 /usr/bin/
Signal: 6
SourcePackage: lsb
StacktraceTop:
raise () from /lib/i386-
abort () from /lib/i386-
Py_FatalError ()
?? ()
Py_InitializeEx ()
Title: lsb_release crashed with SIGABRT in raise()
UpgradeStatus: Upgraded to precise on 2012-02-17 (5 days ago)
UserGroups:
tolostoi (tolostoi) wrote : | #1 |
Apport retracing service (apport) wrote : | #2 |
Changed in lsb (Ubuntu): | |
importance: | Undecided → Medium |
summary: |
- lsb_release crashed with SIGABRT in raise() + lsb_release crashed with SIGABRT in Py_FatalError() |
tags: | removed: need-i386-retrace |
Launchpad Janitor (janitor) wrote : | #5 |
Status changed to 'Confirmed' because the bug affects multiple users.
Changed in lsb (Ubuntu): | |
status: | New → Confirmed |
tags: | added: quantal |
visibility: | private → public |
Changed in lsb (Ubuntu): | |
importance: | Medium → High |
affects: | lsb (Ubuntu) → python3.2 (Ubuntu) |
Changed in python3.2 (Ubuntu): | |
assignee: | nobody → Matthias Klose (doko) |
Sasa Paporovic (melchiaros) wrote : | #6 |
Evan Broder wrote in
https:/
-------
I ran into this error while installing VMware Player on Precise. I believe I've tracked it down to the environment that the VMware installer sets.
/usr/lib/
if [ -z "$_VMIS_
export PYTHON_
. "$PYTHON_
export PYTHONHOME=`dirname "$PYTHON_ROOT"`
export PYTHONPATH=
export LD_LIBRARY_
PYTHON=
export PYTHON
export _VMIS_INIT_PYTHON=1
fi
Setting PYTHONHOME as init.sh sets it is enough to get python3.2mu to abort:
evan@evan-
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: no codec search functions registered: can't find encoding
Aborted (core dumped)
Sasa Paporovic (melchiaros) wrote : | #7 |
Stacktrace Top from bug original generated to Ubuntu11.10 Oneric
https:/
-------
StacktraceTop:
Py_FatalError (msg=<optimized out>) at ../Python/
initfsencoding (interp=<optimized out>) at ../Python/
Py_InitializeEx (install_sigs=1) at ../Python/
Py_Main (argc=3, argv=0x284c010) at ../Modules/
main (argc=3, argv=0x7fff07b6
Sasa Paporovic (melchiaros) wrote : | #8 |
malus wrote on
https:/
-------
happened upon boot of installed system
Sasa Paporovic (melchiaros) wrote : | #9 |
File Kolodny wrote on
https:/
-------
Also happened while installing Vmware Workstation.
Sasa Paporovic (melchiaros) wrote : | #10 |
Happen to myself on direct hardware installation (HP655 laptop), during figuring arround with mounted tar.gz archives (archive mount). -> Why ever; may correlated by accident.
tags: | added: oneiric |
tags: | added: amd64 |
tags: | added: qa-manual-testing |
Sasa Paporovic (melchiaros) wrote : | #11 |
qa-manual-testing is imported from
https:/
The procedure is given by:"Crashed during installation of vmplayer 4.01 on amd64"
May be actual versions make sense.
Matthias Klose (doko) wrote : | #12 |
the segfault is fixed in quantal.
couldn't reproduce this with vmware player 5.0 on precise.
Changed in python3.2 (Ubuntu): | |
status: | Confirmed → Fix Released |
monomakh (monomakh) wrote : | #13 |
This problem still occuries while installing VMWare Workstation 9 in quantal.
Brian Murray (brian-murray) wrote : | #14 |
New duplicates of this bug can be found in bug 1045726. It doesn't seem like it has been fixed.
Changed in python3.2 (Ubuntu): | |
status: | Fix Released → Triaged |
Brian Murray (brian-murray) wrote : | #15 |
I was able to recreate this when installing vmware-player version VMware-
Matthias Klose (doko) wrote : | #16 |
looks like the vmware installer uses a partial python2.x environment, and then calling everything else with this environment. when lsb_release is called, then they try to run a python3 with a partial python2.x library, which is ... interesting.
not seen on other distros, because lsb_release isn't implemented there in python. not seen in precise (at least in the final release), because lsb_release uses python2.x there, and they don't break it as bad as in quantal.
Rob Adams (readams) wrote : | #17 |
I tried replacing the /usr/bin/
Barry Warsaw (barry) wrote : | #18 |
The most boiled down example that provides Python 3 to fatally exit is:
$ PYTHONHOME=
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named encodings
Aborted (core dumped)
That's to be expected I suppose; it's not a bug in Python in the sense that it is purposefully aborting itself when it cannot find the encodings module during start up. I'm not sure what else Python could do in that case (and neither is upstream, hence the self-abort).
It's not at all clear to me what we can do here, short of reporting the problem to VMware and having them not break the Python environment when they invoke lsb_release.
Rob Adams (readams) wrote : | #19 |
The problem here is presumably that there's no correct way to set PYTHONHOME in this case. They need the python2.4 that they ship in the installer and to point it to their PYTHONHOME. But if from that environment you ever call any other python program then it will abort since PYTHONHOME is set incorrectly. What presumably needs to happen is that python 3 would ignore PYTHONHOME and instread use another variable PYTHON3HOME (and related) so that there is a correct way to have both versions of python work.
Barry Warsaw (barry) wrote : Re: [Bug 938869] Re: lsb_release crashed with SIGABRT in Py_FatalError() | #20 |
On Oct 02, 2012, at 08:35 PM, Rob Adams wrote:
>The problem here is presumably that there's no correct way to set
>PYTHONHOME in this case. They need the python2.4 that they ship in the
>installer and to point it to their PYTHONHOME. But if from that
>environment you ever call any other python program then it will abort
>since PYTHONHOME is set incorrectly. What presumably needs to happen is
>that python 3 would ignore PYTHONHOME and instread use another variable
>PYTHON3HOME (and related) so that there is a correct way to have both
>versions of python work.
Well, strictly speaking that's not even correct. They're just getting lucky
that setting PYTHONHOME in their script to get their custom Python 2.4
environment doesn't break the system Python 2.7, let alone Python 3.2. IOW,
they're already skating on thin ice, but they only broke through in this case.
Rob Adams (readams) wrote : | #21 |
Here is a workaround for installing vmware workstation:
Create a file called python3.2mu with the following contents:
------------------ start after this line
#!/bin/bash
unset PYTHONHOME
unset PYTHONPATH
exec /usr/bin/
------------------ end before this line
Then run sudo mv /usr/bin/
Then mv your python3.2mu to /usr/bin
then chmod 755 /usr/bin/
This will allow the workstation installer to run.
Then move the wrapper out of the way and restore the real python3.2
Karma Dorje (taaroa) wrote : | #22 |
got a couple of errors during the installation of vmware player.
description: | updated |
Barry Warsaw (barry) wrote : | #23 |
I am reminded of the -E switch to python3 which ignores environment variables. lsb_release should use this.
affects: | python3.2 (Ubuntu) → lsb (Ubuntu) |
Changed in lsb (Ubuntu): | |
milestone: | none → quantal-updates |
Changed in lsb (Ubuntu Raring): | |
milestone: | quantal-updates → ubuntu-13.04 |
Changed in lsb (Ubuntu Quantal): | |
milestone: | none → quantal-updates |
status: | New → Triaged |
importance: | Undecided → High |
Christian Heimes (heimes) wrote : | #24 |
All system command should have "-E -s" in the shebang line to isolate them from the user's env vars and local site-packages directory.
-E : ignore PYTHON* environment variables (such as PYTHONPATH)
-s : don't add user site directory to sys.path
None of Ubuntu's Python scripts in /usr/bin and /usr/sbin are using -E or -s.
$ for F in /usr/bin/* /usr/sbin/*; do head -n1 $F | grep -q python && echo $F; done
Barry Warsaw (barry) wrote : | #25 |
-s may also be neede:
quoting from python-dev:
- -E : ignore PYTHON* environment variables (such as PYTHONPATH)
- -s : don't add user site directory to sys.path
- -E -s are useful for system commands and mandatory for suid commands.
Celso Providelo (cprov) wrote : | #26 |
Thanks Barry and Christian!
Modifying '/usr/bin/
Changed in lsb (Ubuntu Raring): | |
assignee: | Matthias Klose (doko) → Barry Warsaw (barry) |
Changed in lsb (Ubuntu Quantal): | |
assignee: | nobody → Barry Warsaw (barry) |
Barry Warsaw (barry) wrote : | #27 |
Just to be clear, the shebang line needs to use -Es
#!/usr/bin/python3 -Es
Changed in lsb (Ubuntu Quantal): | |
status: | Triaged → In Progress |
Changed in lsb (Ubuntu Raring): | |
status: | Triaged → In Progress |
description: | updated |
Changed in lsb (Ubuntu Precise): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Barry Warsaw (barry) |
milestone: | none → precise-updates |
Launchpad Janitor (janitor) wrote : | #28 |
This bug was fixed in the package lsb - 4.0-0ubuntu27
---------------
lsb (4.0-0ubuntu27) raring; urgency=low
* lsb_release: Add -Es to #! line for Python so that it will ignore
the $PYTHON* environment variables, and not add the user's site
directory to sys.path. Both of these are general recommendations that
should apply to all system scripts, but in this case fixes LP: #938869
-- Barry Warsaw <email address hidden> Tue, 23 Oct 2012 18:48:21 -0400
Changed in lsb (Ubuntu Raring): | |
status: | In Progress → Fix Released |
Hello tolostoi, or anyone else affected,
Accepted lsb into quantal-proposed. The package will build now and be available at http://
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-
Further information regarding the verification process can be found at https:/
Changed in lsb (Ubuntu Quantal): | |
status: | In Progress → Fix Committed |
tags: | added: verification-needed |
Changed in lsb (Ubuntu Precise): | |
status: | In Progress → Fix Committed |
Adam Conrad (adconrad) wrote : | #30 |
Hello tolostoi, or anyone else affected,
Accepted lsb into precise-proposed. The package will build now and be available at http://
Please help us by testing this new package. See https:/
If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-
Further information regarding the verification process can be found at https:/
Karma Dorje (taaroa) wrote : | #31 |
No more errors. Tested using vmware player 5.0.0.812388.
verification-done
tags: |
added: verification-done removed: verification-needed |
Adam Conrad (adconrad) wrote : Update Released | #32 |
The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.
Launchpad Janitor (janitor) wrote : | #33 |
This bug was fixed in the package lsb - 4.0-0ubuntu20.2
---------------
lsb (4.0-0ubuntu20.2) precise-proposed; urgency=low
* lsb_release: Add -Es to #! line for Python so that it will ignore
the $PYTHON* environment variables, and not add the user's site
directory to sys.path. Both of these are general recommendations that
should apply to all system scripts, but in this case fixes LP: #938869
-- Barry Warsaw <email address hidden> Tue, 23 Oct 2012 20:20:42 -0400
Changed in lsb (Ubuntu Precise): | |
status: | Fix Committed → Fix Released |
Launchpad Janitor (janitor) wrote : | #34 |
This bug was fixed in the package lsb - 4.0-0ubuntu26.1
---------------
lsb (4.0-0ubuntu26.1) quantal-proposed; urgency=low
* lsb_release: Add -Es to #! line for Python so that it will ignore
the $PYTHON* environment variables, and not add the user's site
directory to sys.path. Both of these are general recommendations that
should apply to all system scripts, but in this case fixes LP: #938869
-- Barry Warsaw <email address hidden> Tue, 23 Oct 2012 18:52:45 -0400
Changed in lsb (Ubuntu Quantal): | |
status: | Fix Committed → Fix Released |
peshte (peshte) wrote : | #35 |
Hi everyone.
I'm a bit newbie in linux systems.
How can I use/install the lsb-4.0 package?
I've updated my kubuntu 12.1, installed the lsb packages from muon package manager, lsb-core, lsb-base, but my VMplayer 5.0 won't start any virtual machine. When I press "Play virtual machine", the VMplayer exit.
I've downloaded the lsb_4.0-
Please help.
Thanks.
Karma Dorje (taaroa) wrote : | #36 |
peshte, do not hijack this bug, start a new bug. I dont' want to be rude, but this isn't a support forum.
If you need support you can open the new bug or ask help in https:/
StacktraceTop:
Py_FatalError ()
initfsencoding ()
Py_InitializeEx ()
Py_Initialize ()
Py_Main ()