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