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

os.path.realpath crashes in Windows Store package #82201

Closed
zooba opened this issue Sep 3, 2019 · 4 comments
Closed

os.path.realpath crashes in Windows Store package #82201

zooba opened this issue Sep 3, 2019 · 4 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes OS-windows release-blocker type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@zooba
Copy link
Member

zooba commented Sep 3, 2019

BPO 38020
Nosy @pfmoore, @tjguk, @ambv, @zware, @zooba, @miss-islington
PRs
  • bpo-38020: Fixes potential crash in os.readlink() on Windows #15663
  • [3.8] bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663) #15665
  • 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 2019-09-03.20:16:14.712>
    created_at = <Date 2019-09-03.18:28:55.395>
    labels = ['release-blocker', '3.8', 'OS-windows', 'type-crash', '3.9']
    title = 'os.path.realpath crashes in Windows Store package'
    updated_at = <Date 2019-09-03.20:16:14.711>
    user = 'https://github.com/zooba'

    bugs.python.org fields:

    activity = <Date 2019-09-03.20:16:14.711>
    actor = 'steve.dower'
    assignee = 'steve.dower'
    closed = True
    closed_date = <Date 2019-09-03.20:16:14.712>
    closer = 'steve.dower'
    components = ['Windows']
    creation = <Date 2019-09-03.18:28:55.395>
    creator = 'steve.dower'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 38020
    keywords = ['patch', '3.8regression']
    message_count = 4.0
    messages = ['351094', '351095', '351100', '351102']
    nosy_count = 6.0
    nosy_names = ['paul.moore', 'tim.golden', 'lukasz.langa', 'zach.ware', 'steve.dower', 'miss-islington']
    pr_nums = ['15663', '15665']
    priority = 'release blocker'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue38020'
    versions = ['Python 3.8', 'Python 3.9']

    @zooba
    Copy link
    Member Author

    zooba commented Sep 3, 2019

    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.

    @zooba zooba added 3.8 only security fixes 3.9 only security fixes release-blocker labels Sep 3, 2019
    @zooba zooba self-assigned this Sep 3, 2019
    @zooba zooba added OS-windows type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 3, 2019
    @zooba
    Copy link
    Member Author

    zooba commented Sep 3, 2019

    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.

    @zooba
    Copy link
    Member Author

    zooba commented Sep 3, 2019

    New changeset 993ac92 by Steve Dower in branch 'master':
    bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
    993ac92

    @miss-islington
    Copy link
    Contributor

    New changeset 54dac6c by Miss Islington (bot) in branch '3.8':
    bpo-38020: Fixes crash in os.readlink() on Windows (GH-15663)
    54dac6c

    @zooba zooba closed this as completed Sep 3, 2019
    @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
    3.8 only security fixes 3.9 only security fixes OS-windows release-blocker type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants