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.

Title: Compile error on Modules/socketmodule.c
Type: compile error Stage: resolved
Components: Build, Extension Modules Versions: Python 3.7, Python 3.6, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: martin.panter, masamoto, python-dev
Priority: normal Keywords: patch

Created on 2016-10-19 23:27 by masamoto, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
socketmodule-behind-label.patch masamoto, 2016-10-19 23:27 review
Pull Requests
URL Status Linked Edit
PR 552 closed dstufft, 2017-03-31 16:36
Messages (6)
msg279000 - (view) Author: Masayuki Yamamoto (masamoto) * Date: 2016-10-19 23:27
_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.
msg279002 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-10-19 23:37
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:

+    ;  /* necessary for --without-threads flag */
msg279003 - (view) Author: Masayuki Yamamoto (masamoto) * Date: 2016-10-19 23:44
Oh, that's enough to work, Martin.
I confirmed too.
msg279010 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-10-20 03:57
New changeset 17629dee23ca by Martin Panter in branch '2.7':
Issue #28480: Avoid label at end of compound statement --without-threads
msg279015 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-10-20 05:31
New changeset 9316b4ebf3fa by Martin Panter in branch '3.6':
Issue #28480: Avoid label at end of compound statement --without-threads

New changeset 7cb86d404866 by Martin Panter in branch '3.6':
Issue #28480: Adjust or skip tests if multithreading is disabled

New changeset 948cf38793ce by Martin Panter in branch 'default':
Issue #28480: Merge multithreading fixes from 3.6
msg279019 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-10-20 07:44
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 Issue 28482, Issue 28484 and Issue 28485 about other test suite failures identified when multithreading is disabled.
Date User Action Args
2022-04-11 14:58:38adminsetgithub: 72666
2017-03-31 16:36:18dstufftsetpull_requests: + pull_request921
2016-10-20 07:44:03martin.pantersetstatus: open -> closed
versions: + Python 2.7
messages: + msg279019

resolution: fixed
stage: patch review -> resolved
2016-10-20 05:31:10python-devsetmessages: + msg279015
2016-10-20 03:57:48python-devsetnosy: + python-dev
messages: + msg279010
2016-10-19 23:44:24masamotosetmessages: + msg279003
2016-10-19 23:37:28martin.pantersetnosy: + martin.panter

messages: + msg279002
stage: patch review
2016-10-19 23:27:58masamotocreate