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.
Created on 2014年04月01日 14:52 by dellair.jie, last changed 2022年04月11日 14:58 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| _struct.c.txt | dellair.jie, 2014年04月01日 14:52 | |||
| Build.log | dellair.jie, 2014年04月01日 14:53 | |||
| 3.4-struct.patch | masamoto, 2014年04月02日 12:17 | patch of compiling Modules/_struct.c on Cygwin | ||
| PyType_Ready-unpackiter_type.patch | masamoto, 2016年10月02日 11:08 | review | ||
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 552 | closed | dstufft, 2017年03月31日 16:36 | |
| Messages (17) | |||
|---|---|---|---|
| msg215321 - (view) | Author: dellair jie (dellair.jie) | Date: 2014年04月01日 14:52 | |
Dear all, I am compiling Python 3.4 on Cygwin 1.7.17. The following has been done in order to reach the point where _struct module failed. > A clean Python 3.4 > Applied patches: cygwin_si_band.patch in Issue21085 0001-CYGWIN-issue13756-Python-make-fail-on-cygwin.patch in issue13756 0019-MINGW-export-_PyNode_SizeOf-as-PyAPI-for-parser-modu.patch in issue186373 > configure + make The issue happened during make: building '_struct' extension gcc -Wno-unused-result -Werror=declaration-after-statement -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./Include -I. -IInclude -I/cygdrive/c/temp/Python-3.4.0/Include -I/cygdrive/c/temp/Python-3.4.0 -c /cygdrive/c/temp/Python-3.4.0/Modules/_struct.c -o build/temp.cygwin-1.7.17-i686-3.4/cygdrive/c/temp/Python-3.4.0/Modules/_struct.o /cygdrive/c/temp/Python-3.4.0/Modules/_struct.c:1630:5: error: initializer element is not constant /cygdrive/c/temp/Python-3.4.0/Modules/_struct.c:1630:5: error: (near initialization for ‘unpackiter_type.ob_base.ob_base.ob_type’) Please feel free to find the build.log and the output of _struct.c.txt (gcc with -dD -E -DPy_BUILD_core) for more information. Thanks in advance, Br, Dellair |
|||
| msg215322 - (view) | Author: dellair jie (dellair.jie) | Date: 2014年04月01日 14:53 | |
The full build log |
|||
| msg215349 - (view) | Author: Ned Deily (ned.deily) * (Python committer) | Date: 2014年04月02日 01:23 | |
This looks like a duplicate of Issue6672. |
|||
| msg215359 - (view) | Author: dellair jie (dellair.jie) | Date: 2014年04月02日 06:51 | |
Neil, It doesn't look like a duplicate of Issue6672. The one in Issue6672 was for Mingw, all the patches simply added __MINGW32__ to __CYGWIN__ build structure. While my issue is, the build failed with _struct.c on Cygwin. So the module is recognized, just didn't pass the compilation. Br, Dellair |
|||
| msg215379 - (view) | Author: Masayuki Yamamoto (masamoto) * | Date: 2014年04月02日 12:17 | |
I wrote a patch file. In other extention module source codes, global variable PyTypeObject has initialized to using "PyVarObject_HEAD_INIT(NULL, 0)". And so, as with other modules, I tried to edit and compiling _struct.c in Cygwin 1.7.28. The module compiling was passing, And struct module passed a test "python3.4 -m test test_struct". |
|||
| msg215385 - (view) | Author: dellair jie (dellair.jie) | Date: 2014年04月02日 14:11 | |
Yamamoto, Thanks, the patch you offered did make the _struct error disappeared. I will do a bit more testing. Dellair |
|||
| msg217517 - (view) | Author: dellair jie (dellair.jie) | Date: 2014年04月29日 13:17 | |
Hello masamoto, The patch you provided works quite well. The build passed and Python calls are successfully. Please let me know what else you need me to test in order to have the patch accepted or else feel free to close it with Resolution Fixed. Thanks, Dellair |
|||
| msg217562 - (view) | Author: Masayuki Yamamoto (masamoto) * | Date: 2014年04月29日 23:58 | |
I have solved about compiling _struct module too. I have no authority of this issues, So please close of issues. |
|||
| msg217577 - (view) | Author: dellair jie (dellair.jie) | Date: 2014年04月30日 07:15 | |
Fixed with the patch. |
|||
| msg277852 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年10月02日 05:34 | |
New changeset 3bde312ae936 by Zachary Ware in branch 'default': Issue #21124: Fix building _struct on Cygwin. https://hg.python.org/cpython/rev/3bde312ae936 |
|||
| msg277853 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2016年10月02日 05:38 | |
For future reference, having a patch attached to the issue does not mean the issue is fixed, and it should not be closed. |
|||
| msg277874 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) | Date: 2016年10月02日 09:51 | |
PyType_Ready() should be called for unpackiter_type. See also issue26906. |
|||
| msg277887 - (view) | Author: Masayuki Yamamoto (masamoto) * | Date: 2016年10月02日 11:08 | |
I wrote a patch to add the unpackiter_type initialization into PyInit__struct function. I has confirmed solve #28337 on ubuntu x86 16.04. |
|||
| msg277891 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2016年10月02日 13:49 | |
Do we not have a unit test for that? |
|||
| msg277959 - (view) | Author: Masayuki Yamamoto (masamoto) * | Date: 2016年10月03日 15:29 | |
unpack_iterator type has not been registered into _struct module. And all users get only unpack_iterator object from function returning iterator. The object iterating doesn't need reference to type. Therefore, I think issue finish by PyType_Ready fix because this segfault doesn't have big impact. However, I think if possible, it is preferable that extension module having un-initialize type objects gets a compile error at build time. And impossible case for compile error is better that wrong extension module always fails import. |
|||
| msg278012 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2016年10月04日 06:25 | |
New changeset c4eb211fb38b by Zachary Ware in branch 'default': Closes #21124, #28337: Call PyType_Ready on unpackiter_type. https://hg.python.org/cpython/rev/c4eb211fb38b |
|||
| msg278013 - (view) | Author: Zachary Ware (zach.ware) * (Python committer) | Date: 2016年10月04日 06:26 | |
Thanks for the patch again :). The last idea you mentioned sounds somewhat interesting, please open a new issue for it if you'd like to pursue it. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:58:01 | admin | set | github: 65323 |
| 2017年03月31日 16:36:22 | dstufft | set | pull_requests: + pull_request958 |
| 2016年10月04日 06:26:33 | zach.ware | set | messages: + msg278013 |
| 2016年10月04日 06:25:05 | python-dev | set | status: open -> closed resolution: fixed messages: + msg278012 stage: resolved |
| 2016年10月03日 15:29:43 | masamoto | set | messages: + msg277959 |
| 2016年10月02日 13:49:21 | zach.ware | set | messages: + msg277891 |
| 2016年10月02日 11:08:58 | masamoto | set | files:
+ PyType_Ready-unpackiter_type.patch nosy: + masamoto messages: + msg277887 |
| 2016年10月02日 09:51:26 | serhiy.storchaka | set | status: closed -> open nosy: + serhiy.storchaka messages: + msg277874 resolution: fixed -> (no value) stage: resolved -> (no value) |
| 2016年10月02日 05:38:25 | zach.ware | set | versions:
+ Python 3.7, - Python 3.4 nosy: + zach.ware messages: + msg277853 type: compile error stage: resolved |
| 2016年10月02日 05:34:12 | python-dev | set | nosy:
+ python-dev messages: + msg277852 |
| 2014年04月30日 07:15:17 | dellair.jie | set | status: open -> closed resolution: fixed messages: + msg217577 |
| 2014年04月29日 23:59:23 | masamoto | set | nosy:
- masamoto |
| 2014年04月29日 23:58:39 | masamoto | set | nosy:
dellair.jie, masamoto messages: + msg217562 |
| 2014年04月29日 13:17:28 | dellair.jie | set | messages: + msg217517 |
| 2014年04月03日 19:11:39 | ned.deily | set | nosy:
- ned.deily superseder: Add Mingw recognition to pyport.h to allow building extensions -> resolution: duplicate -> (no value) stage: resolved -> (no value) |
| 2014年04月02日 14:11:43 | dellair.jie | set | messages: + msg215385 |
| 2014年04月02日 12:17:12 | masamoto | set | files:
+ 3.4-struct.patch nosy: + masamoto messages: + msg215379 keywords: + patch |
| 2014年04月02日 06:51:24 | dellair.jie | set | status: pending -> open messages: + msg215359 |
| 2014年04月02日 01:23:30 | ned.deily | set | status: open -> pending superseder: Add Mingw recognition to pyport.h to allow building extensions components: + Build title: Compilation error on _struct module on Python 3.4 -> _struct module compilation error under Cygwin 1.7.17 on Python 3.4 nosy: + ned.deily messages: + msg215349 resolution: duplicate stage: resolved |
| 2014年04月01日 14:53:31 | dellair.jie | set | files:
+ Build.log messages: + msg215322 |
| 2014年04月01日 14:52:31 | dellair.jie | create | |