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

Compile error on Modules/socketmodule.c #72666

Closed
ma8ma mannequin opened this issue Oct 19, 2016 · 6 comments
Closed

Compile error on Modules/socketmodule.c #72666

ma8ma mannequin opened this issue Oct 19, 2016 · 6 comments
Labels
3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir

Comments

@ma8ma
Copy link
Mannequin

ma8ma mannequin commented Oct 19, 2016

BPO 28480
Nosy @vadmium, @ma8ma
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • socketmodule-behind-label.patch
  • 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 2016-10-20.07:44:03.138>
    created_at = <Date 2016-10-19.23:27:58.635>
    labels = ['extension-modules', 'build', '3.7']
    title = 'Compile error on Modules/socketmodule.c'
    updated_at = <Date 2017-03-31.16:36:18.413>
    user = 'https://github.com/ma8ma'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:18.413>
    actor = 'dstufft'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-10-20.07:44:03.138>
    closer = 'martin.panter'
    components = ['Build', 'Extension Modules']
    creation = <Date 2016-10-19.23:27:58.635>
    creator = 'masamoto'
    dependencies = []
    files = ['45146']
    hgrepos = []
    issue_num = 28480
    keywords = ['patch']
    message_count = 6.0
    messages = ['279000', '279002', '279003', '279010', '279015', '279019']
    nosy_count = 3.0
    nosy_names = ['python-dev', 'martin.panter', 'masamoto']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue28480'
    versions = ['Python 2.7', 'Python 3.6', 'Python 3.7']

    @ma8ma
    Copy link
    Mannequin Author

    ma8ma mannequin commented Oct 19, 2016

    _socket module has failed to compile with --without-threads flag since 554fb699af8c, because Py_END_ALLOW_THREADS macro exists behind the done label ( Modules/socketmodule.c:666 ).

    If --without-threads flag goes on, Py_END_ALLOW_THREADS macro replaces to just right curly bracket. Therefore, between label and end of block have no statements. There needs meaningless statement (e.g. result = result;) to avoid compile error.
    I wrote a one line patch as a test.

    @ma8ma ma8ma mannequin added 3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir labels Oct 19, 2016
    @vadmium
    Copy link
    Member

    vadmium commented Oct 19, 2016

    Thanks for the report and patch. I think an empty statement might be better than the dummy assignment. Let me know if the following would work and I will commit it:

    done:
    + ; /* necessary for --without-threads flag */
    Py_END_ALLOW_THREADS

    @ma8ma
    Copy link
    Mannequin Author

    ma8ma mannequin commented Oct 19, 2016

    Oh, that's enough to work, Martin.
    I confirmed too.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 20, 2016

    New changeset 17629dee23ca by Martin Panter in branch '2.7':
    Issue bpo-28480: Avoid label at end of compound statement --without-threads
    https://hg.python.org/cpython/rev/17629dee23ca

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 20, 2016

    New changeset 9316b4ebf3fa by Martin Panter in branch '3.6':
    Issue bpo-28480: Avoid label at end of compound statement --without-threads
    https://hg.python.org/cpython/rev/9316b4ebf3fa

    New changeset 7cb86d404866 by Martin Panter in branch '3.6':
    Issue bpo-28480: Adjust or skip tests if multithreading is disabled
    https://hg.python.org/cpython/rev/7cb86d404866

    New changeset 948cf38793ce by Martin Panter in branch 'default':
    Issue bpo-28480: Merge multithreading fixes from 3.6
    https://hg.python.org/cpython/rev/948cf38793ce

    @vadmium
    Copy link
    Member

    vadmium commented Oct 20, 2016

    I also committed a similar but independent fix in Python 2.7 building Modules/_sqlite/connection.c, caused by revision 649937bb8f1c, and adjusted some tests to work when multithreading is disabled.

    For the record, I also opened bpo-28482, bpo-28484 and bpo-28485 about other test suite failures identified when multithreading is disabled.

    @vadmium vadmium closed this as completed Oct 20, 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
    3.7 (EOL) end of life build The build process and cross-build extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant