Skip to content

Cygwin does not provide siginfo_t.si_band #65284

Closed

Description

@dellairjie
BPO 21085
Nosy @loewis, @vstinner, @bitdancer, @embray, @zware, @ma8ma, @AraHaan
PRs
  • [Do Not Merge] Convert Misc/NEWS so that it is managed by towncrier #552
  • Files
  • signalmodule.output.txt
  • cygwin_si_band.patch
  • 3.4-issue21085-cygwin-struct_siginfo.patch
  • 3.4-issue21085-struct_siginfo.patch: use configure script
  • 3.5-issue21085-struct_siginfo.patch: assigned zero into si_band field
  • 3.5-issue21085-struct_siginfo-2.patch
  • tip-issue21085-struct_siginfo-2.patch
  • 3.4-issue21085-struct_siginfo-2.patch
  • 3.3-issue21085-struct_siginfo-2.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 = 'https://github.com/zware'
    closed_at = <Date 2016-10-01.05:52:54.742>
    created_at = <Date 2014-03-28.15:17:09.827>
    labels = ['build', '3.7']
    title = 'Cygwin does not provide siginfo_t.si_band'
    updated_at = <Date 2017-03-31.16:36:14.354>
    user = 'https://bugs.python.org/dellairjie'

    bugs.python.org fields:

    activity = <Date 2017-03-31.16:36:14.354>
    actor = 'dstufft'
    assignee = 'zach.ware'
    closed = True
    closed_date = <Date 2016-10-01.05:52:54.742>
    closer = 'zach.ware'
    components = ['Build']
    creation = <Date 2014-03-28.15:17:09.827>
    creator = 'dellair.jie'
    dependencies = []
    files = ['34682', '34693', '38704', '38752', '44204', '44208', '44262', '44263', '44264']
    hgrepos = []
    issue_num = 21085
    keywords = ['patch']
    message_count = 40.0
    messages = ['215050', '215051', '215052', '215055', '215183', '215221', '215232', '215243', '215247', '215248', '215249', '215252', '215257', '215266', '215267', '215302', '215303', '215308', '215309', '215319', '217518', '239343', '239345', '239349', '239350', '239663', '273429', '273445', '273488', '273537', '273542', '273907', '273915', '277796', '277797', '277798', '278027', '278037', '286402', '286520']
    nosy_count = 10.0
    nosy_names = ['loewis', 'vstinner', 'rpetrov', 'r.david.murray', 'python-dev', 'erik.bray', 'zach.ware', 'dellair.jie', 'masamoto', 'Decorater']
    pr_nums = ['552']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'compile error'
    url = 'https://bugs.python.org/issue21085'
    versions = ['Python 3.7']

    Activity

    1. dellairjie commented on Mar 28, 2014

      dellairjiemannequin
      MannequinAuthor

      Folks,

      Is Cygwin supported by Python? We met the following error when compiling Python 3.3.2 on Cygwin 1.7.17:

      gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/main.o Modules/main.c
      Modules/main.c:17:0: warning: "PATH_MAX" redefined
      /usr/include/limits.h:336:0: note: this is the location of the previous definition
      Modules/main.c: In function ‘Py_Main’:
      Modules/main.c:561:5: warning: implicit declaration of function ‘_setmode’
      gcc -c -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -o Modules/gcmodule.o Modules/gcmodule.c
      gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/_threadmodule.c -o Modules/_threadmodule.o
      gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -c ./Modules/signalmodule.c -o Modules/signalmodule.o
      ./Modules/signalmodule.c: In function ‘fill_siginfo’:
      ./Modules/signalmodule.c:745:5: error: ‘siginfo_t’ has no member named ‘si_band’
      Makefile:1501: recipe for target `Modules/signalmodule.o' failed
      make: *** [Modules/signalmodule.o] Error 1

      Any lights would be appreciated.

      Thanks,

    2. vstinner commented on Mar 28, 2014

      @vstinner
      Member

      ./Modules/signalmodule.c:745:5: error: ‘siginfo_t’ has no member named ‘si_band’

      This code is conditional, it is surrounded by:

      #if defined(HAVE_SIGWAITINFO) || defined(HAVE_SIGTIMEDWAIT)
      

      Does Windows support sigwaitinfo() or sigtimedwait()? I would be surprised. You used configure? Check pyconfig.h for these two constants.

    3. bitdancer commented on Mar 28, 2014

      @bitdancer
      Member

      cygwin is not officially supported. We do accept patches that improve cygwin support when they are narrowly targted and well motivated.

    4. dellairjie commented on Mar 28, 2014

      dellairjiemannequin
      MannequinAuthor

      Victor,

      I did do ./configure, without any parameters. Should I use it with "--without-signal-module" option? Will all signals be disabled if this option is specified?

      From Python document, it mentions Windows support the following signals:
      signal.SIGINT, signal.SIGTERM, signal.SIGABRT, signal.SIGFPE, signal.SIGILL, signal.SIGSEGV

      The following are found in pyconfig.h.in

      804 /* Define to 1 if you have the sigtimedwait' function. */ 805 #undef HAVE_SIGTIMEDWAIT 810 /* Define to 1 if you have the sigwaitinfo' function. */
      811 #undef HAVE_SIGWAITINFO

      Br,
      Li

    5. loewis commented on Mar 30, 2014

      loewismannequin
      Mannequin

      dellair jie: would you like to work on a patch?

      It's fine if not, but it may then be that there is no resolution to this issue for the coming months or years (unless somebody else volunteers to write a patch).

      Running configure should have created pyconfig.h. Please report what this file has; pyconfig.h.in is not configured.

    6. dellairjie commented on Mar 31, 2014

      dellairjiemannequin
      MannequinAuthor

      Yes, my pleasure.

      After configure on Cygwin, there is pyconfig.h generated, variables are as following:
      /* #undef HAVE_SIGTIMEDWAIT */
      /* #define HAVE_SIGWAITINFO 1 */

      The error disappeared once changed HAVE_SIGWAITINFO to undef.
      However, it encountered another issue mentioned here:
      http://bugs.python.org/issue13756

      The patches provided seem only for 3.2.2, not sure if it is ok to apply them directly on 3.3.2?

    7. dellairjie commented on Mar 31, 2014

      dellairjiemannequin
      MannequinAuthor

      Applied the patch 0001-CYGWIN-issue13756-Python-make-fail-on-cygwin.patch in case: http://bugs.python.org/issue13756

      The build failed with parser module:
      building 'parser' extension
      gcc -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I./Include -I. -IInclude -I/cygdrive/c/temp/Python-3.3.2/Include -I/cygdrive/c/temp/Python-3.3.2 -c /cygdrive/c/temp/Python-3.3.2/Modules/parsermodule.c -o build/temp.cygwin-1.7.17-i686-3.3/cygdrive/c/temp/Python-3.3.2/Modules/parsermodule.o
      gcc -shared -Wl,--enable-auto-image-base build/temp.cygwin-1.7.17-i686-3.3/cygdrive/c/temp/Python-3.3.2/Modules/parsermodule.o -L. -L/usr/local/lib -lpython3.3m -o build/lib.cygwin-1.7.17-i686-3.3/parser.dll
      build/temp.cygwin-1.7.17-i686-3.3/cygdrive/c/temp/Python-3.3.2/Modules/parsermodule.o: In function parser_sizeof': /cygdrive/c/temp/Python-3.[3.2/Modules/parsermodule.c:371](https://github.com/python/cpython/blob/3.2/Modules/parsermodule.c#L371): undefined reference to __PyNode_SizeOf'
      collect2: ld returned 1 exit status

      Could anyone shed some lights please?

      Br,
      Li

    8. loewis commented on Mar 31, 2014

      loewismannequin
      Mannequin

      dellair jie: please focus on one issue at a time. The issue you reported here is the compile error with si_band; I will not discuss any other problems you bring up in this issue.

      Note that editing pyconfig.h is not a solution. It's a generated file, so it must not be edited.

      To diagnose this further, add the -dD option to the preprocessor output of signalmodule.c, i.e. run

      gcc -dD -Wno-unused-result -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I. -IInclude -I./Include -DPy_BUILD_CORE -E ./Modules/signalmodule.c

      and attach the resulting file (or else study the output yourself).

      BTW, please also understand that Python 3.3 is no longer maintained; it would be good if you could run this porting project on Python 3.4 instead.

    9. dellairjie commented on Mar 31, 2014

      dellairjiemannequin
      MannequinAuthor

      Martin,

      Certainly running on 3.4 now.
      The output of the command is attached.

      Will try to look into it tomorrow if no immediate follow up post.

      Br,
      Li

    10. vstinner commented on Mar 31, 2014

      @vstinner
      Member

      Can you try to comment si_band code in signalmodule.c, and then run test_signal to see if sigwaitinfo works on Windows? test_sigwaitinfo() uses signal.alarm(1): does it work on Windows (with Cygwin)? (sigwaitinfo doc says "Availability: Unix.")

    11. loewis commented on Mar 31, 2014

      loewismannequin
      Mannequin

      dellair: According to the compiler output, ./pyconfig.h has

      #define HAVE_SIGWAIT 1
      
      
      #define HAVE_SIGWAITINFO 1

      So why did you say (in msg215221) that the file had

      /* #undef HAVE_SIGTIMEDWAIT */
      /* #define HAVE_SIGWAITINFO 1 */

      (i.e. where do the comment signs come from)

    12. dellairjie commented on Mar 31, 2014

      dellairjiemannequin
      MannequinAuthor

      Martin,

      Thanks for the analysis!

      The following values came from Python 3.3.2, the #define HAVE_SIGWAITINFO 1 was without comment sign, I commented it out for the build to go through.
      /* #undef HAVE_SIGTIMEDWAIT */
      /* #define HAVE_SIGWAITINFO 1 */

      The output was from 3.4, haven't checked the values yet, might be different. Will check it tomorrow.

      Br,
      Dellair

    13. rpetrov commented on Mar 31, 2014

      rpetrovmannequin
      Mannequin

      STINNER Victor wrote:

      STINNER Victor added the comment:

      I found this patch:
      https://github.com/Alexpux/MSYS2-packages/blob/master/python3/3.3.2-cygwin-siginfo.patch

      Sure. It seems to me it is extracted from bpo-3871 .

    14. 19 remaining items

    15. embray commented on Aug 30, 2016

      @embray
      Contributor

      I've reviewed masamoto's last patch 3.5-issue21085-struct_siginfo-2.patch

      It applies cleanly and allows the signals module to compile on Cygwin64 2.5.1 / Windows 10. I attached versions of the patch that apply cleanly to tip, 3.4, and 3.3 as well.

      However, even with this issue resolved it can't be fully tested because there are other open issues preventing a successful build on Cygwin, including bpo-25658 and bpo-13756

      Would it be ok to commit this even though it doesn't resolve all build issues? Or should I try to cobble together a meta-issue of current known build issues and make sure they all have working patches first?

    16. bitdancer commented on Aug 30, 2016

      @bitdancer
      Member

      I think it would be reasonable to apply it, unless other devs object, given your confirmation that it solves this particular problem (and, looking at the code, it won't break anything...which the buildbots will confirm).

      This will only be applied to 3.5 and 3.6, since this is not a security issue. I've updated the versions accordingly.

    17. python-dev commented on Oct 1, 2016

      python-devmannequin
      Mannequin

      New changeset 6874928eae4b by Zachary Ware in branch 'default':
      Issue bpo-21085: add configure check for siginfo_t.si_band
      https://hg.python.org/cpython/rev/6874928eae4b

    18. zware commented on Oct 1, 2016

      @zware
      Member

      Thanks for the patch, masamoto, and thanks for the review and rebase, erik.bray!

      I only applied this to 3.7. It's much more open to experimentation currently, and we have a way to go before Python can even be built on Cygwin. Once we reach a more stable point (say, the full test suite can be run, even if not everything passes), we can evaluate whether backporting all the changes it took to get there is worthwhile.

    19. assigned and unassigned on Oct 1, 2016
    20. changed the title [-]compile error Python3.3 on Cygwin[/-] [+]Cygwin does not provide siginfo_t.si_band[/+] on Oct 1, 2016
    21. python-dev commented on Oct 1, 2016

      python-devmannequin
      Mannequin

      New changeset 5673cf852daa by Zachary Ware in branch 'default':
      Issue bpo-21085: Fix accidental leading +'s in configure.ac
      https://hg.python.org/cpython/rev/5673cf852daa

    22. embray commented on Oct 4, 2016

      @embray
      Contributor

      Thanks for the merge--targeting 3.7 for now and thinking about backporting later sounds fine to me.

      I'm also in the process of getting a Cygwin buildbot for Python up and running, but it's been slow going. That said, having a Cygwin buildbot is also high priority for my own (non-Python-specific) work. So once I have that up I will happily maintain a buildbot for Python on Cygwin.

    23. zware commented on Oct 4, 2016

      @zware
      Member

      When you're ready to get your bot set up, ping me and I'll get you set up on the master side. Thanks!

    24. AraHaan commented on Jan 28, 2017

      AraHaanmannequin
      Mannequin

      In 3.6 and 3.7 The Same Error is back on line 960 with gcc 6.3.0 on cygwin64. This issue is not entirely fixed even with the absolute latest commits.

      $ make
      gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-pro
      totypes    -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missin
      g-field-initializers   -I. -I./Include    -DPy_BUILD_CORE  -c ./Modules/signalmo
      dule.c -o Modules/signalmodule.o
      In file included from ./Include/Python.h:85:0,
                       from ./Modules/signalmodule.c:6:
      ./Modules/signalmodule.c: In function ‘fill_siginfo’:
      ./Modules/signalmodule.c:960:60: error: ‘siginfo_t {aka struct <anonymous>}’ has
       no member named ‘si_band’; did you mean ‘si_pid’?
           PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
                                                                  ^
      ./Include/tupleobject.h:62:75: note: in definition of macro ‘PyTuple_SET_ITEM’
       #define PyTuple_SET_ITEM(op, i, v) (((PyTupleObject *)(op))->ob_item[i] = v)
                                                                                 ^
      ./Modules/signalmodule.c:960:5: note: in expansion of macro ‘PyStructSequence_SE
      T_ITEM’
           PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
           ^~~~~~~~~~~~~~~~~~~~~~~~~
      make: *** [Makefile:1741: Modules/signalmodule.o] Error 1
    25. embray commented on Jan 31, 2017

      @embray
      Contributor

      Decorater, since this issue was already closed, could you open a new one? And when you do, please add me to the nosy list.

      I'm still planning to get a Cygwin built bot up for Python, I've just had other various priorities.

    26. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)end of lifebuildThe build process and cross-build

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions