-
Notifications
You must be signed in to change notification settings - Fork 584
BBC: Async-Interrupt-1.25 does not compile anymore since perl 5.31.6 #17392
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
Comments
Module has build-time failure. Excerpt from
Bisecting with the following invocation:
... points to this commit:
@iabyn, can you take a look? Thank you very much. |
On Thu, Dec 26, 2019 at 06:41:36PM -0800, James E Keenan wrote:
> The compilation of MLEHMANN/Async-Interrupt-1.25.tar.gz fails with bleadperl with a error message like this:
>
> ```
> Interrupt.xs:209:29: error: too many arguments to function call, expected 1, have 3
This will almost certainly be a side-effect of my merge commit shown
below. It turned a broken mess into a slightly less broken mess, and as a
side-effect, affects how many args low-level (i.e. OS) signal handlers need
to be declared and/or called with. Async-Interrupt will have to be updated
to handle the new reality.
commit 116e19a
Merge: 42d0f81 b466a94
Author: David Mitchell <[email protected]>
AuthorDate: Mon Nov 18 10:20:54 2019 +0000
Commit: David Mitchell <[email protected]>
CommitDate: Mon Nov 18 10:20:54 2019 +0000
[MERGE] fixup perl's OS signal handling
First some background:
UNIXy OSes support two types of signal handler function:
Signal_t handler1(int sig);
Signal_t handler3(int sig, siginfo_t *info, void *uap);
The original one-argument handler was set using the signal(2) system
call. The newer sigaction(2) system call allows either a 1-arg or
3-arg handler to be specified:
act.sa_handler = handler1;
sigaction(sig, act, NULL);
act.sa_sigaction = handler3;
act.sa_sa_flags |= SA_SIGINFO;
sigaction(sig, act, NULL);
The current behaviour in perl core is that, in the presence of
HAS_SIGACTION and SA_SIGINFO, the signal handler type and function are
both declared as 3-arg, but perl still tells the kernel that the
supplied signal handler function takes one arg. This means that whenever
the kernel calls the handler, args 2 and 3 are whatever garbage the OS
and architecture cause them to happen to be.
Note that POSIX.xs *does* allow a 3-arg signal handler to be specified
by passing the SA_SIGINFO flag, and a couple of tests check for this.
Recently, gcc-8 has (quite reasonably) been warning that we're passing
around 3-arg function pointers where a 1-arg function pointer is
expected.
This branch fixes things up by declaring the signal handler type as
1-arg to match reality. It also introduces a new type, Siginfo_t, which
is a wrapper for those platforms which have siginfo_t, and a dummy
implementation for those which don't.
In addition it adds new explicit handler functions with a known
number of args, e.g. Perl_sighandler1() and Perl_sighandler3(), which
can be used by POSIX.xs when it wants to use a specific handler type.
It also adds a new function, Perl_perly_sighandler(), which is called by
the underlying OS signal handler to do the actual perl-level call to
$SIG{FOO}, and which has an extra arg to indicate whether it is being
called via a safe signal path or not.
…--
Overhead, without any fuss, the stars were going out.
-- Arthur C Clarke
|
Do you think this patch for the upstream module would suffice?
It passes all tests -- but the test coverage for that distro is not high. (And it would need guards for Perl versions.) Thank you very much. |
On Thu, Jan 02, 2020 at 03:17:58PM -0800, James E Keenan wrote:
> On Thu, Dec 26, 2019 at 06:41:36PM -0800, James E Keenan wrote: > The compilation of MLEHMANN/Async-Interrupt-1.25.tar.gz fails with bleadperl with a error message like this: > > ``` > Interrupt.xs:209:29: error: too many arguments to function call, expected 1, have 3
> This will almost certainly be a side-effect of my merge commit shown below. It turned a broken mess into a slightly less broken mess, and as a side-effect, affects how many args low-level (i.e. OS) signal handlers need to be declared and/or called with. Async-Interrupt will have to be updated to handle the new reality.
Do you think this patch for the upstream module would suffice?
I don't know. Signals are hard; making them portable is harder. And any
change would need to work against older versions of perl.
But since this is a Marc Lehmann module, I'm not going to devote any
effort to fix it. Even submitting correct fixes to him is likely to be
rewarded with a stream of invective, which I can do without.
…--
Counsellor Troi states something other than the blindingly obvious.
-- Things That Never Happen in "Star Trek" #16
|
It looks to me like it would break on perls before this change. It's probably a better idea to make it use the |
I don't think that making comments like these will make that situation any better |
On 1/4/20 5:04 PM, Leon Timmermans wrote:
But since this is a Marc Lehmann module, I'm not going to devote any
effort to fix it. Even submitting correct fixes to him is likely to be
rewarded with a stream of invective, which I can do without.
I don't think that making comments like these will make that situation
any better
I don't think that makeing comments like those would make that situation
any worse either
|
If someone wants to give me the patch, I'll be happy to let him vent at me. |
On Mon, Feb 17, 2020 at 11:38:12AM -0800, Todd Rinaldo wrote:
If someone wants to give me the patch, I'll be happy to let him vent at me.
I have no desire to write such a patch.
…--
This is a great day for France!
-- Nixon at Charles De Gaulle's funeral
|
I cannot ask Dave to write such a patch if he is not interested in it. He experienced enough to step back and not get involved. I understand and support it. @tonycoz, do you think there's enough information here for you to try and come up with a patch for it? Todd will be handling the communication with the author. |
In any case, we still need to determine if this is a blocker. I think it should stay a blocker and forces us to revert if we cannot resolve it one way or the other. Considering we haven't reached out to the author yet, we need to do that first. (Hopefully with a patch.) |
The following patch fixes the issue (tested on 5.24.0 and 5.31.10):
|
With @Leont's patch, I was able to install Async::Interrupt on unthreaded builds on Linux for the following production versions and also on a post-5.31.10 blead.
With that patch I was also able to install Async::Interrupt against a threaded post-5.31.10 build on FreeBSD-11. Thank you very much. |
Also was able to install Async::Interrupt on NetBSD-8.0 and OpenBSD-6.6. Example:
|
Is there a reason not to apply this? |
It has to be applied upstream on CPAN. It's not patching blead, nor does Async-Interrupt ship with core. |
Looks simple. Does everything work above 5.31.6? what are we disabling? Was he overriding a core perl function there? |
It appears so.
Two arguments that are only used for unsafe signals, not for safe signals.
Yes, the handler for safe signals. |
@toddr Can you submit this to the author? |
yep |
@toddr I cannot find a ticket for this, nor is there a new version of |
Marc doesn't do RT. However It appears to have already been reported to him here in January by Andreas. http://lists.schmorp.de/pipermail/anyevent/2020q1/000893.html |
I have sent him an email. Let's give it a few days for a response. |
And a lovely response in return, finding an opportunity to bash p5p. sigh I'm keeping this issue open for observation, but it is no longer a blocker for 5.32.0. |
Marc has released the patch provided by @Leont. cpantesters already shows it is passing on 5.31.10. I think we're all done here. Closing case. |
The compilation of MLEHMANN/Async-Interrupt-1.25.tar.gz fails with bleadperl with a error message like this:
Overview of test reports: http://matrix.cpantesters.org/?dist=Async-Interrupt+1.25
A sample report with this compilation failure:
The text was updated successfully, but these errors were encountered: