You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@perl.apache.org by Joe Schaefer <jo...@sunstarsys.com> on 2004/06/12 23:59:49 UTC

minor type changes for debian amd64

Debian seems to have finally sorted out their 
amd64 port (well, everything but the name :-).
Rebuilding mp2 on that arch yields a few type
mismatches (mainly because ints aren't the
same size as pointers, I think).  Here's a
patch that eliminates all such warnings for
me (all tests still pass):

Index: src/modules/perl/modperl_global.c
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_global.c,v
retrieving revision 1.8
diff -u -r1.8 modperl_global.c
--- src/modules/perl/modperl_global.c   4 Mar 2004 06:01:07 -0000       1.8
+++ src/modules/perl/modperl_global.c   12 Jun 2004 21:59:00 -0000
@@ -165,7 +165,7 @@

 MP_GLOBAL_IMPL(pconf, apr_pool_t *);
 MP_GLOBAL_IMPL(server_rec, server_rec *);
-MP_GLOBAL_IMPL(threaded_mpm, int);
+MP_GLOBAL_IMPL(threaded_mpm, IV);

 #if MP_THREADED
 static apr_status_t modperl_tls_cleanup(void *data)

Index: src/modules/perl/modperl_global.h
===================================================================
RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_global.h,v
retrieving revision 1.5
diff -u -r1.5 modperl_global.h
--- src/modules/perl/modperl_global.h   4 Mar 2004 06:01:07 -0000       1.5
+++ src/modules/perl/modperl_global.h   12 Jun 2004 21:59:00 -0000
@@ -59,7 +59,7 @@

 MP_GLOBAL_DECL(pconf, apr_pool_t *);
 MP_GLOBAL_DECL(server_rec, server_rec *);
-MP_GLOBAL_DECL(threaded_mpm, int);
+MP_GLOBAL_DECL(threaded_mpm, IV);

 apr_status_t modperl_tls_create(apr_pool_t *p, modperl_tls_t **key);
 apr_status_t modperl_tls_get(modperl_tls_t *key, void **data);

Index: xs/APR/Bucket/APR__Bucket.h
===================================================================
RCS file: /home/cvspublic/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
retrieving revision 1.10
diff -u -r1.10 APR__Bucket.h
--- xs/APR/Bucket/APR__Bucket.h 9 Jun 2004 14:46:22 -0000       1.10
+++ xs/APR/Bucket/APR__Bucket.h 12 Jun 2004 21:59:01 -0000
@@ -19,7 +19,7 @@
                                         int offset, int len)
 {

-    int full_len;
+    STRLEN full_len;
     (void)SvPV(sv, full_len);

     if (len) {

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: minor type changes for debian amd64

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> 
>>Let me know if this patch works for you (committed already, so just
>>try the cvs). 
> 
> 
> It does.  Everything compiles cleanly, and the test results look
> to be the same as before.

thanks.

> What I mean by that is, with prefork the test suite runs successfully
> to completion, but with worker the t/protocol/echo_timeout.t test hangs
> (looking at `top`, a pair of httpd processes are running at full load,
> growing in size as time goes on).  I won't file a bug report yet
> because I'm using cvs HEAD everywhere (httpd-2.0, apr, mp2),

HEAD is not httpd-2.0, it's httpd-2.1. Same goes for apr. don't use HEAD, but 
the tag names explained here:
http://perl.apache.org/download/source.html#Development_mod_perl_2_0_Source_Distribution

>  and
> currently httpd-2.0 fails many of its own httpd-test tests. If
> the problem persists I'll try to investigate further; just thought 
> I'd mention this should it ring any bells.

Yes, someone mentioned that there are issues with 2.1, but 2.1 is not quite 
officially supported at the moment.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: minor type changes for debian amd64

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Joe Schaefer <jo...@sunstarsys.com> writes:
> 
> [...]
> 
> 
>>Correction: t/filter/in_init_basic.t is now failing with both
>>worker and prefork.  Investigating...
> 
> 
> The patch is fine; test itself is borked (too many qr's).  
> Here's the patch, the args also need to be reordered because
> Test.pm v1.24 deprecates using regexps in the first argument.
> 
> Index: t/filter/in_init_basic.t
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/t/filter/in_init_basic.t,v
> retrieving revision 1.4
> diff -u -r1.4 in_init_basic.t
> --- t/filter/in_init_basic.t    6 Aug 2003 07:06:23 -0000       1.4
> +++ t/filter/in_init_basic.t    13 Jun 2004 16:12:14 -0000
> @@ -13,4 +13,4 @@
> 
>  my $location = '/TestFilter__in_init_basic';
>  my $response = POST_BODY $location, content => $content;
> -ok t_cmp(qr/$expected/, qr/$response/, "test filter init functionality");
> +ok t_cmp($response, qr/$expected/, "test filter init functionality");

Thanks Joe, committed.


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: minor type changes for debian amd64

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

[...]

> Correction: t/filter/in_init_basic.t is now failing with both
> worker and prefork.  Investigating...

The patch is fine; test itself is borked (too many qr's).  
Here's the patch, the args also need to be reordered because
Test.pm v1.24 deprecates using regexps in the first argument.

Index: t/filter/in_init_basic.t
===================================================================
RCS file: /home/cvspublic/modperl-2.0/t/filter/in_init_basic.t,v
retrieving revision 1.4
diff -u -r1.4 in_init_basic.t
--- t/filter/in_init_basic.t    6 Aug 2003 07:06:23 -0000       1.4
+++ t/filter/in_init_basic.t    13 Jun 2004 16:12:14 -0000
@@ -13,4 +13,4 @@

 my $location = '/TestFilter__in_init_basic';
 my $response = POST_BODY $location, content => $content;
-ok t_cmp(qr/$expected/, qr/$response/, "test filter init functionality");
+ok t_cmp($response, qr/$expected/, "test filter init functionality");

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: minor type changes for debian amd64

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Joe Schaefer <jo...@sunstarsys.com> writes:

> Stas Bekman <st...@stason.org> writes:
> 
> [...]
> 
> > Let me know if this patch works for you (committed already, so just
> > try the cvs). 
> 
> It does.  Everything compiles cleanly, and the test results look
> to be the same as before.

Correction: t/filter/in_init_basic.t is now failing with both
worker and prefork.  Investigating...

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: minor type changes for debian amd64

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

[...]

> Let me know if this patch works for you (committed already, so just
> try the cvs). 

It does.  Everything compiles cleanly, and the test results look
to be the same as before.

What I mean by that is, with prefork the test suite runs successfully
to completion, but with worker the t/protocol/echo_timeout.t test hangs
(looking at `top`, a pair of httpd processes are running at full load,
growing in size as time goes on).  I won't file a bug report yet
because I'm using cvs HEAD everywhere (httpd-2.0, apr, mp2), and
currently httpd-2.0 fails many of its own httpd-test tests. If
the problem persists I'll try to investigate further; just thought 
I'd mention this should it ring any bells.

-- 
Joe Schaefer


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org


Re: minor type changes for debian amd64

Posted by Stas Bekman <st...@stason.org>.
Joe Schaefer wrote:
> Debian seems to have finally sorted out their 
> amd64 port (well, everything but the name :-).
> Rebuilding mp2 on that arch yields a few type
> mismatches (mainly because ints aren't the
> same size as pointers, I think).  Here's a
> patch that eliminates all such warnings for
> me (all tests still pass):
> 
> Index: src/modules/perl/modperl_global.c
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_global.c,v
> retrieving revision 1.8
> diff -u -r1.8 modperl_global.c
> --- src/modules/perl/modperl_global.c   4 Mar 2004 06:01:07 -0000       1.8
> +++ src/modules/perl/modperl_global.c   12 Jun 2004 21:59:00 -0000
> @@ -165,7 +165,7 @@
> 
>  MP_GLOBAL_IMPL(pconf, apr_pool_t *);
>  MP_GLOBAL_IMPL(server_rec, server_rec *);
> -MP_GLOBAL_IMPL(threaded_mpm, int);
> +MP_GLOBAL_IMPL(threaded_mpm, IV);
> 
>  #if MP_THREADED
>  static apr_status_t modperl_tls_cleanup(void *data)
> 
> Index: src/modules/perl/modperl_global.h
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/src/modules/perl/modperl_global.h,v
> retrieving revision 1.5
> diff -u -r1.5 modperl_global.h
> --- src/modules/perl/modperl_global.h   4 Mar 2004 06:01:07 -0000       1.5
> +++ src/modules/perl/modperl_global.h   12 Jun 2004 21:59:00 -0000
> @@ -59,7 +59,7 @@
> 
>  MP_GLOBAL_DECL(pconf, apr_pool_t *);
>  MP_GLOBAL_DECL(server_rec, server_rec *);
> -MP_GLOBAL_DECL(threaded_mpm, int);
> +MP_GLOBAL_DECL(threaded_mpm, IV);
> 
>  apr_status_t modperl_tls_create(apr_pool_t *p, modperl_tls_t **key);
>  apr_status_t modperl_tls_get(modperl_tls_t *key, void **data);

Yes, this part is because it has to be a pointer size. Thanks Joe, committed.

> Index: xs/APR/Bucket/APR__Bucket.h
> ===================================================================
> RCS file: /home/cvspublic/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
> retrieving revision 1.10
> diff -u -r1.10 APR__Bucket.h
> --- xs/APR/Bucket/APR__Bucket.h 9 Jun 2004 14:46:22 -0000       1.10
> +++ xs/APR/Bucket/APR__Bucket.h 12 Jun 2004 21:59:01 -0000
> @@ -19,7 +19,7 @@
>                                          int offset, int len)
>  {
> 
> -    int full_len;
> +    STRLEN full_len;
>      (void)SvPV(sv, full_len);
> 
>      if (len) {

this one needs to have a complete adjustement of the arguments, to be 
apr_size_t and apr_off_t (which requires a change in several other APIs). The 
int type is almost never right, when read/write is involved.

Let me know if this patch works for you (committed already, so just try the cvs).

Index: src/modules/perl/modperl_bucket.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_bucket.c,v
retrieving revision 1.10
diff -u -r1.10 modperl_bucket.c
--- src/modules/perl/modperl_bucket.c	21 May 2004 18:33:05 -0000	1.10
+++ src/modules/perl/modperl_bucket.c	13 Jun 2004 04:53:42 -0000
@@ -77,7 +77,8 @@
  static apr_bucket *modperl_bucket_sv_make(pTHX_
                                            apr_bucket *bucket,
                                            SV *sv,
-                                          int offset, int len)
+                                          apr_off_t offset,
+                                          apr_size_t len)
  {
      modperl_bucket_sv_t *svbucket;

@@ -107,7 +108,8 @@
      return bucket;
  }

-apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, int offset, int len)
+apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, apr_off_t offset,
+                                     apr_size_t len)
  {
      apr_bucket *bucket;

Index: src/modules/perl/modperl_bucket.h
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_bucket.h,v
retrieving revision 1.2
diff -u -r1.2 modperl_bucket.h
--- src/modules/perl/modperl_bucket.h	4 Mar 2004 06:01:06 -0000	1.2
+++ src/modules/perl/modperl_bucket.h	13 Jun 2004 04:53:42 -0000
@@ -16,6 +16,7 @@
  #ifndef MODPERL_BUCKET_H
  #define MODPERL_BUCKET_H

-apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, int offset, int len);
+apr_bucket *modperl_bucket_sv_create(pTHX_ SV *sv, apr_off_t offset,
+                                     apr_size_t len);

  #endif /* MODPERL_BUCKET_H */
Index: xs/APR/Bucket/APR__Bucket.h
===================================================================
RCS file: /home/cvs/modperl-2.0/xs/APR/Bucket/APR__Bucket.h,v
retrieving revision 1.10
diff -u -r1.10 APR__Bucket.h
--- xs/APR/Bucket/APR__Bucket.h	9 Jun 2004 14:46:22 -0000	1.10
+++ xs/APR/Bucket/APR__Bucket.h	13 Jun 2004 04:53:43 -0000
@@ -16,10 +16,10 @@
  #include "modperl_bucket.h"

  static apr_bucket *mpxs_APR__Bucket_new(pTHX_ SV *classname, SV *sv,
-                                        int offset, int len)
+                                        apr_off_t offset, apr_size_t len)
  {

-    int full_len;
+    apr_size_t full_len;
      (void)SvPV(sv, full_len);

      if (len) {




-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org