develooper Front page | perl.perl5.porters | Postings from June 2015

Re: 5.22 breaks Coro-6.42

Thread Previous | Thread Next
Max Maischein
June 8, 2015 18:46
Re: 5.22 breaks Coro-6.42
Message ID:
Hello Daniel,

thank you for the description which I think should enable me to make the 
changes to Coro.

Am 31.05.2015 um 22:13 schrieb bulk88:
> Max Maischein wrote:
>> I did some spelunking in git history and some comparing between 5.20
>> and 5.22-RC2, and here are my findings (as on irc):
>> There are two errors. One can be easily fixed by reverting the patch
>> c910fead7893fe9700031ee59de6b904260b5d69 :
>> State.xs:3472:9: error: assignment of member 'svt_get' in read-only
>> object
>>          orig_sigelem_get = PL_vtbl_sigelem.svt_get;
>> PL_vtbl_sigelem.svt_get
>>  = coro_sigelem_get;
>>          ^
 >> [...]
> Since I wrote that patch the solution is make your own magic vtable
> (struct mgvtbl), copy the function pointers you want from the core's
> vtable RO vtable to your RW vtable in your XS module. Then call
> mg_findext to get the core created MG *, and assign your vtable to
> mg->mg_virtual replacing the core one.

I think this approach is problematic since it will only replace the 
existing magic for elements in %SIG that exist at patching time. 
Elements added to %SIG after Coro has loaded will get the original Perl 
sigelem magic and not the changed magic, at least that is how I 
interpret the C code and data. As the main purpose of this vtable 
switching is to provide custom setters and getters for $SIG{__DIE__} and 
$SIG{__WARN__}, I think there needs to be more magic added to %SIG such 
that it attaches the correct kind of magic to elements stored in

Is the above interpretation correct or am I overlooking something?


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About