This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: os.path.realpath crashes in Windows Store package
Type: crash Stage: resolved
Components: Windows Versions: Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: steve.dower Nosy List: lukasz.langa, miss-islington, paul.moore, steve.dower, tim.golden, zach.ware
Priority: release blocker Keywords: 3.8regression, patch

Created on 2019-09-03 18:28 by steve.dower, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 15663 merged steve.dower, 2019-09-03 18:49
PR 15665 merged miss-islington, 2019-09-03 19:51
Messages (4)
msg351094 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-09-03 18:28
When installed via the Store, "python3.8 -c 'import sysconfig'" crashes hard.

So far, I've discovered it's inside an os.path.realpath() call, and appears to be a refcounting issue (double DECREF I think), but haven't gotten any further yet.

I'm looking into it.
msg351095 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-09-03 18:45
I forgot to initialize the result object in readlink() on Windows, and so when we hit the failure path it returns garbage. Attempting to DECREF that garbage fails.

The call to readlink() fails in the Store app because sys.executable is not a readable link. It should fail in most cases anyway, but apparently outside of the app container the stack is NULL here.
msg351100 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2019-09-03 19:50
New changeset 993ac92418839427d4068d6ae8e618b06b5d9294 by Steve Dower in branch 'master':
bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
https://github.com/python/cpython/commit/993ac92418839427d4068d6ae8e618b06b5d9294
msg351102 - (view) Author: miss-islington (miss-islington) Date: 2019-09-03 20:13
New changeset 54dac6c0f4fa24d03025c45899ee7c5f2a4c367e by Miss Islington (bot) in branch '3.8':
bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
https://github.com/python/cpython/commit/54dac6c0f4fa24d03025c45899ee7c5f2a4c367e
History
Date User Action Args
2022-04-11 14:59:19adminsetgithub: 82201
2019-09-03 20:16:14steve.dowersetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-09-03 20:13:46miss-islingtonsetnosy: + miss-islington
messages: + msg351102
2019-09-03 19:51:10miss-islingtonsetpull_requests: + pull_request15330
2019-09-03 19:50:56steve.dowersetmessages: + msg351100
2019-09-03 18:49:05steve.dowersetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request15328
2019-09-03 18:45:57steve.dowersetmessages: + msg351095
2019-09-03 18:28:55steve.dowercreate