Skip Menu |

This queue is for tickets about the Socket CPAN distribution.

Report information
The Basics
Id: 124063
Status: resolved
Priority: 0/
Queue: Socket

People
Owner: Nobody in particular
Requestors: zefram [...] fysh.org
Cc:
AdminCc:

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



Subject: missing croak_sv() breaks Perl version portability
Date: Fri, 12 Jan 2018 15:06:48 +0000
To: bug-Socket [...] rt.cpan.org
From: Zefram <zefram [...] fysh.org>
Socket-2.026 is broken on Perls 5.13.0 and earlier, if a current ExtUtils::Constant is used, because it uses croak_sv() in the AUTOLOAD xsub in const-xs.inc but croak_sv() isn't defined. You need to have a backup definition of croak_sv() for Perls that don't provide it as part of the API. -zefram
On Fri Jan 12 10:07:08 2018, zefram@fysh.org wrote: Show quoted text
> Socket-2.026 is broken on Perls 5.13.0 and earlier, if a current > ExtUtils::Constant is used, because it uses croak_sv() in the AUTOLOAD > xsub in const-xs.inc but croak_sv() isn't defined. You need to have a > backup definition of croak_sv() for Perls that don't provide it as part > of the API.
Oops. Yes I did sortof wonder why it was there. It was removed for RT122830. I forgot about the older perls. Attached patch reïmplements it, properly this time. -- Paul Evans
Subject: rt124063.patch
=== modified file 'Socket.xs' --- Socket.xs 2018-01-11 22:58:10 +0000 +++ Socket.xs 2018-01-12 16:55:14 +0000 @@ -186,6 +186,10 @@ #endif /* __GNU__ */ #endif /* !SvPVx_nolen */ +#ifndef croak_sv +# define croak_sv(sv) croak("%s", SvPVx_nolen(sv)) +#endif + #ifndef hv_stores # define hv_stores(hv, keystr, val) \ hv_store(hv, ""keystr"", sizeof(keystr)-1, val, 0)
Subject: Re: [rt.cpan.org #124063] missing croak_sv() breaks Perl version portability
Date: Fri, 12 Jan 2018 18:17:18 +0000
To: Paul Evans via RT <bug-Socket [...] rt.cpan.org>
From: Zefram <zefram [...] fysh.org>
Paul Evans via RT wrote: Show quoted text
>+# define croak_sv(sv) croak("%s", SvPVx_nolen(sv))
That's an improvement on the previous backup implementation, but it's not really correct, even for the limited use made of it by const-xs.inc, because it'll lose the SvUTF8ness of the SV. A proper implementation would be # define croak_sv(sv) (sv_setsv(ERRSV, (sv)), croak(NULL)) -zefram