http://qs321.pair.com?node_id=1165159

runrig has asked for the wisdom of the Perl Monks concerning the following question:

Looking for help...trying to install Coro 6.49 on perl 5.24. Have applied this patch. Getting this error on make:
State.xs: In function 'coro_sig_copy': State.xs:1140:3: warning: return makes integer from pointer without a +cast [enabled by default] State.xs: In function 'runops_trace': State.xs:1426:27: error: 'struct block_sub' has no member named 'argar +ray' make[1]: *** [State.o] Error 1 make[1]: Leaving directory `/home/runrig/.cpanm/work/1465404756.14128/ +Coro-6.49/Coro' make: *** [subdirs] Error 2
I know p5p might have been a better place to go with this...

Replies are listed 'Best First'.
Re: Coro woes
by dave_the_m (Monsignor) on Jun 08, 2016 at 17:33 UTC
    Coro hasn't been ported to 5.24.0 yet.

    Dave.

Re: Coro woes
by ikegami (Patriarch) on Jun 08, 2016 at 19:37 UTC

    The problem is related to this change.

    I think you also need this patch.

    Fixed patch: (The linked ones had line breaks inserted.)

    diff --git a/Coro-6.49/Coro/State.xs b/Coro-6.49/Coro/State.xs index 6d631bd..c2cbe7b 100644 --- a/Coro-6.49/Coro/State.xs +++ b/Coro-6.49/Coro/State.xs @@ -1395,7 +1395,18 @@ runops_trace (pTHX) PUSHMARK (SP); PUSHs (&PL_sv_yes); PUSHs (fullname); - PUSHs (CxHASARGS (cx) ? sv_2mortal (newRV_i +nc ((SV *)cx->blk_sub.argarray)) : &PL_sv_undef); + { + AV *aa; +# if PERL_VERSION_ATLEAST(5,23,8) + aa = ((AV*)(AvARRAY(MUTABLE_AV( + PadlistARRAY(CvPADLIST(cx->blk_su +b.cv))[ + CvDEPTH(cx->blk_sub.cv)]))[0])); +#else + aa = cx->blk_sub.argarray; +#endif + + PUSHs (CxHASARGS (cx) ? sv_2mortal (newRV +_inc ((SV *)aa)) : &PL_sv_undef); + } PUTBACK; cb = hv_fetch ((HV *)SvRV (coro_current), " +_trace_sub_cb", sizeof ("_trace_sub_cb") - 1, 0); if (cb) call_sv (*cb, G_KEEPERR | G_EVAL | +G_VOID | G_DISCARD);

    I tested with:

    cd /tmp curl -sSL 'http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/Coro-6 +.49.tar.gz' | tar xz cd Coro-6.49 curl -sSL 'http://markmail.org/download.xqy?id=a5n4rqivzbn5zsqp&number +=1' | patch -p1 curl -sSL 'http://www.perlmonks.org/?abspart=1;displaytype=displaycode +;node_id=1165171;part=1' | patch -p2 perl Makefile.PL make test

    I now get:

    ... t/07_eval.t ........... 1/5 *** glibc detected *** /home/ikegami/usr/p +erlbrew/perls/5.24.0t/bin/perl: realloc(): invalid next size: 0x00000 +00000a476d0 *** ...
      I think you also need this patch
      Note that that patch of mine was purely a blind proof of concept: the minimum required to make Coro compile under 5.24.0. I made no promise that it was either correct or sufficient.

      Dave.

Re: Coro woes
by ikegami (Patriarch) on Jun 08, 2016 at 18:58 UTC

    I think this patch (by Father Chrysostomos) is the one you want.

      That said, I get the same error you do with that patch.

      cd /tmp curl -sSL 'http://search.cpan.org/CPAN/authors/id/M/ML/MLEHMANN/Coro-6 +.49.tar.gz' | tar xz cd Coro-6.49 curl -sSL 'http://markmail.org/download.xqy?id=a5n4rqivzbn5zsqp&number +=1' | patch -p1 perl Makefile.PL make test
      ... State.xs: In function 'coro_sig_copy': State.xs:1144:3: warning: return makes integer from pointer without a +cast [enabled by default] State.xs: In function 'runops_trace': State.xs:1430:27: error: 'struct block_sub' has no member named 'argar +ray' make[1]: *** [State.o] Error 1 make[1]: Leaving directory `/home/ikegami/tmp2/Coro-6.49/Coro' make: *** [subdirs] Error 2

      Coro's author doesn't use a public RT, so I can't tell if anyone's addressed this already.

Re: Coro woes
by runrig (Abbot) on Jun 08, 2016 at 22:22 UTC
    Thanks everyone. I have for now decided to install perl 5.20.3 where Coro last built okay as is. I hope the issues get sorted out, as coroutines are an awesome feature, so hopefully we won't have to go long without them.
      coroutines are an awesome feature

      Do you have a (brief) example of how you use them please?


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.
        My only example is turning a callback interface into a iterative interface (see Spreadsheet::ParseExcel::Stream). If the callback interface is too much trouble to completely rewrite, then coroutines are an option.