pkgsrc-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: pkg/51903
The following reply was made to PR pkg/51903; it has been noted by GNATS.
From: "David H. Gutteridge" <dhgutteridge%sympatico.ca@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc:
Subject: Re: pkg/51903
Date: Mon, 23 Jan 2017 17:13:54 -0500
On Mon, 2017-01-23 at 18:05 +0000, David Holland wrote:
> The following reply was made to PR pkg/51903; it has been noted by
> GNATS.
>
> From: David Holland <dholland-pbugs%netbsd.org@localhost>
> To: gnats-bugs%NetBSD.org@localhost
> Cc:Â
> Subject: Re: pkg/51903
> Date: Mon, 23 Jan 2017 18:03:37 +0000
> Â
> Â Check for warnings during the build? Given the symptoms there must
> be
> Â something wrong with the Perl <-> C glue. I remember fixing this
> some
> Â in the past; it probably needs more.
There are compiler warnings that reference pointers being cast to int,
which seems an obvious culprit. I'd started looking at fixing that the
other day. I haven't resolved all of it, and I have zero experience
with Perl XS code, but I've made progress. That is, when each of the
test scripts is invoked manually, two of the three now complete
successfully where all three triggered segfaults before. Unfortunately,
sablot.t still faults exactly the same way. (With what I've done so
far, I was also able to get my package submission PR pkg/51906 to use
this as a dependency without faulting, where it would immediately
fault previously.)
I added more changes to your existing patch to Processor/Processor.h,
and also patched two more files. (There's separate confusion about
function signatures indicating an int return value where the variable
is actually unsigned long, I made those size_t as well for
consistency.)
What I've tried so far is:
(Most of this patch is pre-existing, I adjusted more int and unsigned
long use to size_t.)
--- Processor/Processor.h.orig 2004-06-04 09:20:40.000000000
-0400
+++ Processor/Processor.h
@@ -119,7 +119,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs(sv_2mortal(newSViv(severity)));
     XPUSHs(sv_2mortal(newSViv(facility)));
     XPUSHs(sv_2mortal(newSViv(code)));
@@ -167,7 +167,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs(sv_2mortal(newSViv(code)));
     XPUSHs(sv_2mortal(newSViv(level)));
     foo = fields;
@@ -215,7 +215,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs(sv_2mortal(newSViv(code)));
     XPUSHs(sv_2mortal(newSViv(level)));
     foo = fields;
@@ -250,7 +250,7 @@
   GV *gv;
   unsigned long ret = 0;
   SV *value;
-Â Â unsigned int len;
+Â Â size_t len;
Â
   wrapper = (SV*)userData;
Â
@@ -270,7 +270,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs(sv_2mortal(newSVpv((char*) scheme, strlen(scheme))));
     XPUSHs(sv_2mortal(newSVpv((char*) rest, strlen(rest))));
Â
@@ -309,14 +309,14 @@
   return ret;
 }
Â
-int SchemeHandlerOpenStub(void *userData, void *processor,
-Â Â Â Â const char *scheme, const char *rest, int *handle) {
+size_t SchemeHandlerOpenStub(void *userData, void *processor,
+Â Â Â Â const char *scheme, const char *rest, size_t *handle) {
Â
   SV *wrapper;
   SV * processor_obj;
   HV *stash;
   GV *gv;
-Â Â unsigned long ret = 0;
+Â Â size_t ret = 0;
   SV *value;
Â
   wrapper = (SV*)userData;
@@ -337,7 +337,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs(sv_2mortal(newSVpv((char*) scheme, strlen(scheme))));
     XPUSHs(sv_2mortal(newSVpv((char*) rest, strlen(rest))));
Â
@@ -351,7 +351,7 @@
     if ( SvOK(value) ) {
       ret = 0;
       SvREFCNT_inc(value);
-Â Â Â Â Â Â *handle = (int) value;
+Â Â Â Â Â Â *handle = (size_t)value;
     } else {
       ret = 100;
       *handle = 0;
@@ -366,16 +366,16 @@
   return ret;
 }
Â
-int SchemeHandlerGetStub(void *userData, void *processor,
-Â Â Â Â int handle, char *buffer, int *byteCount) {
+size_t SchemeHandlerGetStub(void *userData, void *processor,
+Â Â Â Â size_t handle, char *buffer, int *byteCount) {
Â
   SV *wrapper;
   SV * processor_obj;
   HV *stash;
   GV *gv;
-Â Â unsigned long ret = 0;
+Â Â size_t ret = 0;
   SV *value;
-Â Â unsigned int len;
+Â Â size_t len;
Â
   wrapper = (SV*)userData;
Â
@@ -395,7 +395,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs((SV*)handle);
     XPUSHs(sv_2mortal(newSViv(*byteCount)));
     PUTBACK;
@@ -425,14 +425,14 @@
   return ret;
 }
Â
-int SchemeHandlerPutStub(void *userData, void *processor,
-Â Â Â Â int handle, const char *buffer, int *byteCount) {
+size_t SchemeHandlerPutStub(void *userData, void *processor,
+Â Â Â Â size_t handle, const char *buffer, int *byteCount) {
Â
   SV *wrapper;
   SV * processor_obj;
   HV *stash;
   GV *gv;
-Â Â unsigned long ret = 0;
+Â Â size_t ret = 0;
   SV *value;
Â
   wrapper = (SV*)userData;
@@ -453,7 +453,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs((SV*) handle);
     XPUSHs(sv_2mortal(newSVpv((char*) buffer, *byteCount)));
     PUTBACK;
@@ -479,14 +479,14 @@
   return ret;
 }
Â
-int SchemeHandlerCloseStub(void *userData, void *processor,
-Â Â Â Â int handle) {
+size_t SchemeHandlerCloseStub(void *userData, void *processor,
+Â Â Â Â size_t handle) {
Â
   SV *wrapper;
   SV * processor_obj;
   HV *stash;
   GV *gv;
-Â Â unsigned long ret = 0;
+Â Â size_t ret = 0;
Â
   wrapper = (SV*)userData;
Â
@@ -506,7 +506,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs((SV*) handle);
Â
     PUTBACK;
@@ -553,7 +553,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         PUTBACK;
        Â
@@ -593,7 +593,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) name, strlen(name))));
         att = (char**)atts;
@@ -639,7 +639,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) name, strlen(name))));
Â
@@ -680,7 +680,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) prefix, strlen(prefix))));
         XPUSHs(sv_2mortal(newSVpv((char*) uri, strlen(uri))));
@@ -722,7 +722,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) prefix, strlen(prefix))));
Â
@@ -763,7 +763,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) contents,
strlen(contents))));
Â
@@ -804,7 +804,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) target, strlen(target))));
         XPUSHs(sv_2mortal(newSVpv((char*) contents,
strlen(contents))));
@@ -846,7 +846,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         XPUSHs(sv_2mortal(newSVpv((char*) contents, length)));
Â
@@ -886,7 +886,7 @@
         if (processor_obj)Â
             XPUSHs(processor_obj);
         else
-Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
Â
         PUTBACK;
        Â
@@ -931,7 +931,7 @@
     if (processor_obj)Â
       XPUSHs(processor_obj);
     else
-Â Â Â Â Â Â XPUSHs(&sv_undef);
+Â Â Â Â Â Â XPUSHs(&PL_sv_undef);
     XPUSHs(sv_2mortal(newSVpv((char*) contentType,
strlen(contentType))));
     XPUSHs(sv_2mortal(newSVpv((char*) encoding, strlen(encoding))));
--- Processor/Handler_stubs.h.orig 2003-02-21 09:17:32.000000000
-0500
+++ Processor/Handler_stubs.h
@@ -67,22 +67,22 @@
Â
 Declare
 (
- int SchemeHandlerOpenStub(void *userData, void *processor, const char
*scheme, const char *rest, int *handle);
+ size_t SchemeHandlerOpenStub(void *userData, void *processor, const
char *scheme, const char *rest, size_t *handle);
 )
Â
 Declare
 (
- int SchemeHandlerGetStub(void *userData, void *processor, int handle,
char *buffer, int *byteCount);Â
+ size_t SchemeHandlerGetStub(void *userData, void *processor, size_t
handle, char *buffer, int *byteCount);Â
 )
Â
 Declare
 (
- int SchemeHandlerPutStub(void *userData, void *processor, int handle,
const char *buffer, int *byteCount);
+ size_t SchemeHandlerPutStub(void *userData, void *processor, size_t
handle, const char *buffer, int *byteCount);
 )
Â
 Declare
 (
- int SchemeHandlerCloseStub(void *userData, void *processor, int
handle);
+ size_t SchemeHandlerCloseStub(void *userData, void *processor, size_t
handle);
 )
Â
 /* SAX-like handler */
--- Situation/Situation.xsh.orig 2003-02-21 09:17:32.000000000
-0500
+++ Situation/Situation.xsh
@@ -42,13 +42,13 @@
 PROTOTYPES: ENABLE
 ##############################################################
Â
-int
+size_t
 _getNewSituationHandle(object)
         SV*      object
         CODE:
         SablotSituation sit;
         SablotCreateSituation(&sit);
-Â Â Â Â Â Â Â Â RETVAL = (int)sit;
+Â Â Â Â Â Â Â Â RETVAL = (size_t)sit;
         OUTPUT:
         RETVAL
Â
Home |
Main Index |
Thread Index |
Old Index