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

python embedded 3.5 amd64 crash when using venv #70253

Closed
LaurentDufrechou mannequin opened this issue Jan 9, 2016 · 5 comments
Closed

python embedded 3.5 amd64 crash when using venv #70253

LaurentDufrechou mannequin opened this issue Jan 9, 2016 · 5 comments
Assignees
Labels
OS-windows type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@LaurentDufrechou
Copy link
Mannequin

LaurentDufrechou mannequin commented Jan 9, 2016

BPO 26065
Nosy @pfmoore, @tjguk, @zware, @eryksun, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/zooba'
closed_at = <Date 2016-01-16.21:46:40.969>
created_at = <Date 2016-01-09.19:15:02.098>
labels = ['OS-windows', 'type-crash']
title = 'python embedded 3.5 amd64 crash when using venv'
updated_at = <Date 2016-01-16.21:46:40.967>
user = 'https://bugs.python.org/LaurentDufrechou'

bugs.python.org fields:

activity = <Date 2016-01-16.21:46:40.967>
actor = 'steve.dower'
assignee = 'steve.dower'
closed = True
closed_date = <Date 2016-01-16.21:46:40.969>
closer = 'steve.dower'
components = ['Windows']
creation = <Date 2016-01-09.19:15:02.098>
creator = 'Laurent Dufrechou'
dependencies = []
files = []
hgrepos = []
issue_num = 26065
keywords = []
message_count = 5.0
messages = ['257855', '257873', '257882', '258418', '258419']
nosy_count = 7.0
nosy_names = ['paul.moore', 'tim.golden', 'python-dev', 'zach.ware', 'eryksun', 'steve.dower', 'Laurent Dufrechou']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'crash'
url = 'https://bugs.python.org/issue26065'
versions = ['Python 3.5', 'Python 3.6']

@LaurentDufrechou
Copy link
Mannequin Author

LaurentDufrechou mannequin commented Jan 9, 2016

Install python-3.5.1-embed-amd64 to c:\dev\python-3.5.1-embed-amd64
Open terminal window:
cd c:\dev\python-3.5.1-embed-amd64
python -m venv c:\dev\myenv

-> crash
Error: Command '['C:\\dev\\myenv\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 3221226505

Using debugger (VS2015) shows error:
Exception non gérée à 0x00007FFDA1D05A4E (ucrtbase.dll) dans python.exe 
And stopping debugger leave this log:
C:\dev\python-3.5.1-embed-amd64>python -m venv C:\dev\python35_x64_rtquickreport
Traceback (most recent call last):
  File "runpy.py", line 170, in _run_module_as_main
  File "runpy.py", line 85, in _run_code
  File "venv\__main__.py", line 6, in <module>
  File "venv\__init__.py", line 442, in main
  File "venv\__init__.py", line 85, in create
  File "venv\__init__.py", line 257, in _setup_pip
  File "subprocess.py", line 629, in check_output
  File "subprocess.py", line 698, in run
  File "subprocess.py", line 1055, in communicate
KeyboardInterrupt

@LaurentDufrechou LaurentDufrechou mannequin added OS-windows type-crash A hard crash of the interpreter, possibly with a core dump labels Jan 9, 2016
@zooba
Copy link
Member

zooba commented Jan 9, 2016

I can't read those error messages, but I suspect this is because some of the bundled files are omitted from the embeddable package.

Using it to run venv isn't really part of the intended use cases - it's expected you'll manually install packages alongside it with your own installer. If that doesn't sound suitable for what you're trying to do, you should use the installers to install Python.

@eryksun
Copy link
Contributor

eryksun commented Jan 10, 2016

0xC0000409 (3221226505) is STATUS_STACK_BUFFER_OVERRUN due to the CRT calling __fastfail(FAST_FAIL_FATAL_APP_EXIT) in abort(). This is expected behavior in Windows 8+ 1.

Initially I couldn't reproduce this error because Python found the standard library from the system Python via the registry. After archiving (as .reg) and removing the key "HKLM\SOFTWARE\Python\PythonCore\3.5", I reproduced the problem as follows:

C:\Temp>myenv\Scripts\python.exe -Im ensurepip --upgrade --default-pip
Fatal Python error: Py_Initialize: unable to load the file system codec
ImportError: No module named 'encodings'

Current thread 0x00000b9c (most recent call first):

venv didn't copy over python35.zip to the Scripts directory. I don't know whether there's ever a legitimate reason to look for and copy a zipped standard library, or whether venv is only supported for use with a standard Python installation.

I don't recommend doing this, but if you create the environment --without-pip, the command 'succeeds'. Then you'll have to manually copy python35.zip to Scripts and obtain activate.bat (edit this) and deactivate.bat from another install or the web. You still won't have ensurepip. If you want pip and setuptools, use get-pip.py from the web. This is all probably more trouble than you want. However, the embedding distribution is not intended to be a full Python installation that's suitable for development.

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jan 16, 2016

New changeset 84101e587f47 by Steve Dower in branch '3.5':
Issue bpo-26065: Excludes venv from library when generating embeddable distro.
https://hg.python.org/cpython/rev/84101e587f47

New changeset d3422b0e0cee by Steve Dower in branch 'default':
Issue bpo-26065: Excludes venv from library when generating embeddable distro.
https://hg.python.org/cpython/rev/d3422b0e0cee

@zooba
Copy link
Member

zooba commented Jan 16, 2016

I'm declaring using venv from the embeddable distro as unsupported, and it will be removed completely from the next release.

To create virtual environments, use a regular install of Python.

@zooba zooba closed this as completed Jan 16, 2016
@zooba zooba self-assigned this Jan 16, 2016
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-windows type-crash A hard crash of the interpreter, possibly with a core dump
Projects
None yet
Development

No branches or pull requests

2 participants