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

Patch for fatal stack overflow in Windows caused by -v #46550

Closed
duggelz mannequin opened this issue Mar 16, 2008 · 5 comments
Closed

Patch for fatal stack overflow in Windows caused by -v #46550

duggelz mannequin opened this issue Mar 16, 2008 · 5 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump

Comments

@duggelz
Copy link
Mannequin

duggelz mannequin commented Mar 16, 2008

BPO 2297
Nosy @duggelz, @tpn
Files
  • py3k-win-codec-recursion-20080315.diff: Patch for pythonrun.c
  • py3k-win-codec-recursion-20080316.diff: Updated patch including testcase
  • 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/tpn'
    closed_at = <Date 2008-03-19.06:53:27.140>
    created_at = <Date 2008-03-16.05:24:44.311>
    labels = ['interpreter-core', 'type-crash']
    title = 'Patch for fatal stack overflow in Windows caused by -v'
    updated_at = <Date 2008-03-19.06:53:27.139>
    user = 'https://github.com/duggelz'

    bugs.python.org fields:

    activity = <Date 2008-03-19.06:53:27.139>
    actor = 'trent'
    assignee = 'trent'
    closed = True
    closed_date = <Date 2008-03-19.06:53:27.140>
    closer = 'trent'
    components = ['Interpreter Core']
    creation = <Date 2008-03-16.05:24:44.311>
    creator = 'dgreiman'
    dependencies = []
    files = ['9678', '9685']
    hgrepos = []
    issue_num = 2297
    keywords = ['patch']
    message_count = 5.0
    messages = ['63570', '63611', '63613', '63615', '64044']
    nosy_count = 2.0
    nosy_names = ['dgreiman', 'trent']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = 'crash'
    url = 'https://bugs.python.org/issue2297'
    versions = ['Python 3.0']

    @duggelz
    Copy link
    Mannequin Author

    duggelz mannequin commented Mar 16, 2008

    When python is invoked with -v or -vv under Windows, the process of
    importing the codec for sys.stderr causes a message to be written to
    stderr, which in turn causes the codec to be recursively imported.
    Sometimes the stack overflow exception is swallowed, other times it is
    not. The bug depends on the particular locale settings of the Windows
    machine.

    To reproduce: python_d.exe -v
    and look for many repeated imports of encodings.<some codec>

    Patch is attached.

    @duggelz duggelz mannequin added interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump labels Mar 16, 2008
    @tpn
    Copy link
    Member

    tpn commented Mar 17, 2008

    Any chance of getting a test case that demonstrates this? I'll happily
    test the patch if there's an associated test case I can run to assert
    before/after behaviour.

    @duggelz
    Copy link
    Mannequin Author

    duggelz mannequin commented Mar 17, 2008

    Good call. I've attached an updated patch which includes a testcase in
    test_cmd_line.py.

    @tpn
    Copy link
    Member

    tpn commented Mar 17, 2008

    +1, tested on x86 XP and x64 2k8.

    @tpn tpn self-assigned this Mar 18, 2008
    @tpn
    Copy link
    Member

    tpn commented Mar 19, 2008

    Fixed in r61607, thanks for the report + patch.

    @tpn tpn closed this as completed Mar 19, 2008
    @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
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-crash A hard crash of the interpreter, possibly with a core dump
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant