Skip Menu |

This queue is for tickets about the Coro-Multicore CPAN distribution.

Report information
The Basics
Id: 124131
Status: open
Priority: 0/
Queue: Coro-Multicore

People
Owner: Nobody in particular
Requestors: ppisar [...] redhat.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)



Subject: Fails to build on threaded Perl 5.26.1
Build fails on threaded Perl 5.26.1 because of not passing perl context. Attached patch fixes it.
Subject: Coro-Multicore-0.03-Fix-passing-context.patch
From 07268b8259f5d58a6d13fce14295a193c43ad396 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 19 Jan 2018 09:45:10 +0100 Subject: [PATCH] Fix passing context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Coro-Multicore-0.03, build fails with threaded Perl 5.26.1: In file included from Multicore.xs:4:0: Multicore.xs: In function 'pmapi_acquire': /usr/lib64/perl5/CORE/perl.h:176:16: error: 'my_perl' undeclared (first use in this function); did you mean 'my_fork'? # define aTHX my_perl ^ /usr/lib64/perl5/CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX' # define vTHX aTHX ^~~~ /usr/lib64/perl5/CORE/embedvar.h:335:22: note: in expansion of macro 'vTHX' #define PL_top_env (vTHX->Itop_env) ^~~~ /usr/lib64/perl5/CORE/cop.h:131:6: note: in expansion of macro 'PL_top_env' if (PL_top_env->je_prev) \ ^~~~~~~~~~ Multicore.xs:251:5: note: in expansion of macro 'JMPENV_JUMP' JMPENV_JUMP (jeret); ^~~~~~~~~~~ MultiCore.xs defines PERL_NO_GET_CONTEXT, thus pmapi_acquire() function needs explicit context argument to be have it available when calling JMPENV_JUMP() macro. See <http://blogs.perl.org/users/nick_wellnhofer/2015/03/writing-xs-like-a-pro---perl-no-get-context-and-static-functions.html>. Signed-off-by: Petr Písař <ppisar@redhat.com> --- Multicore.xs | 2 +- perlmulticore.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Multicore.xs b/Multicore.xs index 288e7bf..0c42a3d 100644 --- a/Multicore.xs +++ b/Multicore.xs @@ -219,7 +219,7 @@ pmapi_release (void) } static void -pmapi_acquire (void) +pmapi_acquire (pTHX) { int jeret; struct tctx *ctx = X_TLS_GET (current_key); diff --git a/perlmulticore.h b/perlmulticore.h index 00ae152..0f6b920 100644 --- a/perlmulticore.h +++ b/perlmulticore.h @@ -153,7 +153,7 @@ START_EXTERN_C struct perl_multicore_api { void (*pmapi_release)(void); - void (*pmapi_acquire)(void); + void (*pmapi_acquire)(pTHX); }; static void perl_multicore_init (void); @@ -165,11 +165,11 @@ static struct perl_multicore_api *perl_multicore_api = (struct perl_multicore_api *)&perl_multicore_api_init; #define perlinterp_release() perl_multicore_api->pmapi_release () -#define perlinterp_acquire() perl_multicore_api->pmapi_acquire () +#define perlinterp_acquire() perl_multicore_api->pmapi_acquire (aTHX) /* this is the release/acquire implementation used as fallback */ static void -perl_multicore_nop (void) +perl_multicore_nop (pTHX) { } -- 2.13.6
Dne Pá 19.led.2018 03:59:03, ppisar napsal(a): Show quoted text
> Build fails on threaded Perl 5.26.1 because of not passing perl > context. Attached patch fixes it.
Coro-MultiCore-1.04 needs a similar fix on a different place. A cumulative patch is attached.
Subject: Coro-Multicore-1.04-Fix-passing-context.patch
From 8a9801c581700bc0d707c70da16b19f4a47ff378 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppisar@redhat.com> Date: Fri, 19 Jan 2018 09:45:10 +0100 Subject: [PATCH] Fix passing context MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since Coro-Multicore-0.03, build fails with threaded Perl 5.26.1: In file included from Multicore.xs:4:0: Multicore.xs: In function 'pmapi_acquire': /usr/lib64/perl5/CORE/perl.h:176:16: error: 'my_perl' undeclared (first use in this function); did you mean 'my_fork'? # define aTHX my_perl ^ /usr/lib64/perl5/CORE/embedvar.h:38:18: note: in expansion of macro 'aTHX' # define vTHX aTHX ^~~~ /usr/lib64/perl5/CORE/embedvar.h:335:22: note: in expansion of macro 'vTHX' #define PL_top_env (vTHX->Itop_env) ^~~~ /usr/lib64/perl5/CORE/cop.h:131:6: note: in expansion of macro 'PL_top_env' if (PL_top_env->je_prev) \ ^~~~~~~~~~ Multicore.xs:251:5: note: in expansion of macro 'JMPENV_JUMP' JMPENV_JUMP (jeret); ^~~~~~~~~~~ MultiCore.xs defines PERL_NO_GET_CONTEXT, thus pmapi_acquire() function needs an explicit context argument to be available when calling JMPENV_JUMP() macro. A similar issue emerged in Coro-MultiCore-1.04 with eval_pv() macro. See <http://blogs.perl.org/users/nick_wellnhofer/2015/03/writing-xs-like-a-pro---perl-no-get-context-and-static-functions.html>. Signed-off-by: Petr Písař <ppisar@redhat.com> --- Multicore.xs | 11 ++++++----- perlmulticore.h | 10 +++++----- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/Multicore.xs b/Multicore.xs index ba819c6..625a3a5 100644 --- a/Multicore.xs +++ b/Multicore.xs @@ -187,7 +187,7 @@ X_THREAD_PROC(thread_proc) } static void -start_thread (void) +start_thread (pTHX) { xthread_t tid; @@ -207,7 +207,7 @@ start_thread (void) } static void -pmapi_release (void) +pmapi_release (pTHX) { if (! ((thread_enable ? thread_enable : global_enable) & 1)) { @@ -232,7 +232,7 @@ pmapi_release (void) X_LOCK (release_m); if (idle <= min_idle) - start_thread (); + start_thread (aTHX); tctxs_put (&releasers, ctx); X_COND_SIGNAL (release_c); @@ -247,7 +247,7 @@ pmapi_release (void) } static void -pmapi_acquire (void) +pmapi_acquire (pTHX) { int jeret; struct tctx *ctx = X_TLS_GET (current_key); @@ -311,9 +311,10 @@ BOOT: I_CORO_API ("Coro::Multicore"); if (0) { /*D*/ + dTHX; X_LOCK (release_m); while (idle < min_idle) - start_thread (); + start_thread (aTHX); X_UNLOCK (release_m); } diff --git a/perlmulticore.h b/perlmulticore.h index 7ad38a4..b009311 100644 --- a/perlmulticore.h +++ b/perlmulticore.h @@ -185,8 +185,8 @@ START_EXTERN_C /* contain only the two function pointers for release/acquire */ struct perl_multicore_api { - void (*pmapi_release)(void); - void (*pmapi_acquire)(void); + void (*pmapi_release)(pTHX); + void (*pmapi_acquire)(pTHX); }; static void perl_multicore_init (void); @@ -197,12 +197,12 @@ static const struct perl_multicore_api perl_multicore_api_init static struct perl_multicore_api *perl_multicore_api = (struct perl_multicore_api *)&perl_multicore_api_init; -#define perlinterp_release() perl_multicore_api->pmapi_release () -#define perlinterp_acquire() perl_multicore_api->pmapi_acquire () +#define perlinterp_release() perl_multicore_api->pmapi_release (aTHX) +#define perlinterp_acquire() perl_multicore_api->pmapi_acquire (aTHX) /* this is the release/acquire implementation used as fallback */ static void -perl_multicore_nop (void) +perl_multicore_nop (pTHX) { } -- 2.21.0
Subject: Re: [rt.cpan.org #124131] Fails to build on threaded Perl 5.26.1
Date: Wed, 4 Dec 2019 08:37:18 +0100
To: Petr Pisar via RT <bug-Coro-Multicore [...] rt.cpan.org>
From: Marc Lehmann <schmorp [...] schmorp.de>
Hi! Please send your bug report to the official contact/author address for the module in question (or send it to rt.cpan.org@schmorp.de, that's fine as well). What follows is the rationale for this request, you don't have to read it if you don't care. Why is this necessary? rt.cpan.org has many deficiencies which makes it tedious and hard to use, increasing the workload on the people who provide all the perl modules you probably appreciate (and that is really to be avoided - module authors should be able to invest all their time into improving their modules and not fighting with rt.cpan.org's bugs). Still, for some people, rt.cpan.org is useful to have, and some people even like it and really want to use it. That is fine, too. Unfortunately, the designers of rt.cpan.org didn't make their "service" optional - you can neither opt-in nor opt-out of rt.cpan.org as a module author. Just like a spammer, rt.cpan.org forces its "service" (whether wanted or unwanted) on everybody. Just like a spammer, they don't care for the people they actively hurt. Just like a spammer, they don't don't care to fix these issues and make their "service" ethically acceptable. You cannot even configure it to redirect tickets to somewhere else. Unfortunately, ignoring rt.cpan.org is not an option either: for people reporting possible bugs there is no indication that their report will be ignored, and for module authors it means they miss potentially vital bug reports such as yours (and of course it's a great impression if rt.cpan.org has lots of bug reports that are unanswered, making a module look unmaintained when in fact the opposite might be true). I am sorry that this wasted a bit of your time, but please understand that I am just as much a victim as you are - the problem is the unethical stance of the rt.cpan.org providers who force their "service" on everybody. Please redirect your bug report as stated in the beginning of this mail, and please consider petitioning the rt.cpan.org providers to stop their unethical behaviour and allow opt-in, opt-out, or some redirect option. One last issue: many people mail me that this can be "fixed" by including the bugtracker element in my module meta file. This is not true: 1. This field only affects search.cpan.org and maybe similar services. (Many people confuse rt.cpan.org with search.cpan.org for some reason). 2. It doesn't even work (there are still links to rt.cpan.org displayed). 3. Even if search.cpan.org does no longer display the link, it doesn't actually affect rt.cpan.org (and tests have shown that people go to rt.cpan.org regardless) Even *iff* rt.cpan.org would start listening on the bugtracker field, however, it's still wrong. I have a lot of modules, and each time a service like rt.cpan.org comes out, I would have to make dummy releases for all my modules. This not only creates a lot of extra work for me (I take releases very seriously) but also users, who would wonder why there is a new release. Thanks a lot, Marc Lehmann <rt.cpan.org@schmorp.de> Last updated: 2012-04-22
Dne Út 03.pro.2019 07:16:15, ppisar napsal(a): Show quoted text
> Dne Pá 19.led.2018 03:59:03, ppisar napsal(a):
> > Build fails on threaded Perl 5.26.1 because of not passing perl > > context. Attached patch fixes it.
> > Coro-MultiCore-1.04 needs a similar fix on a different place. A > cumulative patch is attached.
1.05 without my patch builds and the tests pass, but in contrast to my patch, 1.05 emits this warning: Multicore.xs: In function 'thread_proc': Multicore.xs:187:1: warning: control reaches end of non-void function [-Wreturn-type]