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
alarm broken on cygwin #17650
Comments
comment:1
Should it be considered as a PPL bug that the methods are not defined in the header? Or a cython bug that this suffices to break the interrupts mechanism? Or a cygwin bug since it does not seem to be a problem on other platforms? |
comment:2
The PPL code seems to be correct, I am stuck on this one... |
Upstream: Reported upstream. No feedback yet. |
Changed upstream from Reported upstream. No feedback yet. to none |
This comment has been minimized.
This comment has been minimized.
Branch: u/gouezel/alarm_broken_on_cygwin |
New commits:
|
Changed keywords from none to ppl |
Commit: |
This comment has been minimized.
This comment has been minimized.
Author: Sebastien Gouezel |
comment:8
What I don't like about this ticket is that it's not clear that the "ppl watchdog" is not needed. What does it do and why does Sage not need it? |
comment:9
Excellent question. There is essentially no documentation on this ppl watchdog that I could find. It seems to be a classical watchdog mechanism, i.e., it detects if some computation loops forever, and in this case it interrupts it automatically and resets things to a nicer state. In particular, it should not play any role in non-buggy situations. It is not necessary to PPL (since it is disabled on some platforms, those which don't have |
comment:11
Replying to @sagetrac-gouezel:
For me, that's actually a reason to be against this patch. Either we need it and we shouldn't disable it on Cygwin, or we don't need it and we can just disable it everywhere. |
comment:12
I get your point. Unfortunately, I can't say for sure that watchdog is not helpful to ppl in rare situations (for instance, maybe it uses some algorithms whose termination is not guaranteed, counting on watchdog to exit bad situations), so I would rather keep watchdog wherever possible (i.e., not on cygwin, where setitimer is not fully functional). I leave the ticket as |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:14
I'm just posting random links potentially related: According to #10039 comment:49 there used to be a I guess we should open a bug on ppl bugtracker (if one exists). Unfortunately it seems cygwin does not ship ppl anymore, so we cannot look at what they would have done.
|
comment:15
The post does indeed look related. I don't understand why it was posted on PPL-devel, since it seems to have nothing to do with PPL really.
That would be great, especially to send to the upstream bug trackers (PPL and/or Cygwin). |
comment:16
Replying to @jpflori:
I just tried, but unfortunately I was not able to reproduce the issue with plain C or C++ files (for instance, taking the file in the link you give and adding ppl headers and initialization does not break the itimer mechanism). For the record, steps to reproduce the issue using python: File
File
File
File
Compile the extension with
Then Commenting out the header inclusion in |
comment:19
duplicate of #21190 |
comment:20
Closing tickets in the sage-duplicate/invalid/wontfix module with positive_review (i.e. someone has confirmed they should be closed). |
On cygwin (32 and 64), the alarm mechanism is broken:
instead of the expected interrupt.
I traced the bug by dichotomy to a ppl component named watchdog. Its role is similar to alarm, involving signals and interrupts. I guess that, due to the peculiarities of cygwin's implementation of signals, watchdog somehow intercepts the python signals and does dot send them back.
watchdog is not an optional component of ppl, so it can not be disabled by a configure flag. However, it is disabled on systems that don't have
setitimer
. Cygwin hassetitimer
, but a simple hack of ppl's makefile can hide it, thereby disabling watchdog and fixing the sage alarm mechanism. This is done in the proposed patch.A better fix would be to dig into the ppl and cygwin signal mechanism, of course...
CC: @vbraun @jpflori
Component: porting: Cygwin
Keywords: ppl
Author: Sebastien Gouezel
Branch/Commit: u/gouezel/alarm_broken_on_cygwin @
457bfa5
Issue created by migration from https://trac.sagemath.org/ticket/17650
The text was updated successfully, but these errors were encountered: