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

Inconsistency between stack size in main thread and secondary threads on macOS #78445

Closed
ronaldoussoren opened this issue Jul 28, 2018 · 3 comments
Labels
3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-mac type-feature A feature request or enhancement

Comments

@ronaldoussoren
Copy link
Contributor

BPO 34264
Nosy @ronaldoussoren, @ned-deily
PRs
  • bpo-34264: [macOS] make stack size of created threads same as on main… #8534
  • Superseder
  • bpo-18049: Re-enable threading test on macOS
  • 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 = None
    closed_at = <Date 2019-07-13.14:14:06.057>
    created_at = <Date 2018-07-28.16:00:44.920>
    labels = ['OS-mac', 'interpreter-core', 'type-feature', '3.8']
    title = 'Inconsistency between stack size in main thread and secondary threads on macOS'
    updated_at = <Date 2019-07-13.14:14:06.056>
    user = 'https://github.com/ronaldoussoren'

    bugs.python.org fields:

    activity = <Date 2019-07-13.14:14:06.056>
    actor = 'ronaldoussoren'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-07-13.14:14:06.057>
    closer = 'ronaldoussoren'
    components = ['Interpreter Core', 'macOS']
    creation = <Date 2018-07-28.16:00:44.920>
    creator = 'ronaldoussoren'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34264
    keywords = ['patch']
    message_count = 3.0
    messages = ['322569', '322573', '347825']
    nosy_count = 2.0
    nosy_names = ['ronaldoussoren', 'ned.deily']
    pr_nums = ['8534']
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '18049'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue34264'
    versions = ['Python 3.8']

    @ronaldoussoren
    Copy link
    Contributor Author

    configure.ac sets the stack size for the main thread on macOS to 1000000 (hex), while Python/threading_pthread.h sets the default stack size for other threads to 0x500000. The latter is half of the former.

    IMHO both should be the same, as both claim to have been chosen to be just large enough to accommodate the default recursion limit.

    I'd prefer to increase the default stack size of secondary threads to match the main thread. I tagged this as a 3.8 thread because there is a (very) small chance that changing the stack size breaks existing programs (although you'd have to create a lot of threads to use a significant amount of memory).

    This is vaguely related to bpo-33955.

    @ronaldoussoren ronaldoussoren added 3.8 only security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-mac type-feature A feature request or enhancement labels Jul 28, 2018
    @ronaldoussoren
    Copy link
    Contributor Author

    PS. A pull request will follow shortly.

    @ronaldoussoren
    Copy link
    Contributor Author

    This is a duplicate of 18049, which has a more complete patch.

    @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 interpreter-core (Objects, Python, Grammar, and Parser dirs) OS-mac type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant