Login | Register
My pages Projects Community openCollabNet

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Catacomb] Patch for Catacomb 0.9.3-dev to work with Apache 2.2.2



Hi,

With these changes I was able to get Catacomb 0.9.3-dev working on Apache 2.2.2. ( The changes include fixing some flags, replacing deprecated functions etc. ) The memory management problem was due to improper compile time flags.

--------------------START OF PATCH ---------------------------

Index: Makefile.in.so
===================================================================
--- Makefile.in.so      (.../vendor/catacomb/current)   (revision 156)
+++ Makefile.in.so      (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -31,7 +31,7 @@
 #DEFINES
 DEFS=-DVERSION=\"$(VERSION)\" @DEBUG@

-CFLAGS = `@apache_dir@/bin/apr-config --cflags` -Wall
+CFLAGS = `@apache_dir@/bin/apr-1-config --cflags --cppflags` -Wall

 #CPPFLAGS =  -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE

Index: dav_repos.h
===================================================================
--- dav_repos.h (.../vendor/catacomb/current)   (revision 156)
+++ dav_repos.h (.../catacomb/branches/work-with-apache2.2 )     (revision 156)
@@ -141,7 +141,7 @@
 extern const dav_hooks_repository dav_repos_hooks_repos;
 extern const dav_hooks_propdb     dav_repos_hooks_propdb;
 extern const dav_hooks_search     dav_repos_hooks_search;
-extern const dav_hooks_liveprop   dav_repos_hooks_liveprop;
+//extern const dav_hooks_liveprop   dav_repos_hooks_liveprop;
 extern const dav_hooks_vsn        dav_repos_hooks_vsn;
 extern const dav_hooks_locks      dav_repos_hooks_locks;
 extern const dav_hooks_acl        dav_repos_hooks_acl;
Index: dav/main/NWGNUmakefile
===================================================================
--- dav/main/NWGNUmakefile      (.../vendor/catacomb/current)   (revision 156)
+++ dav/main/NWGNUmakefile      (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -184,6 +184,9 @@
        $(OBJDIR)/liveprop.o \
        $(OBJDIR)/providers.o \
        $(OBJDIR)/std_liveprop.o \
+       $(OBJDIR)/methods.o \
+       $(OBJDIR)/principal.o \
+       $(OBJDIR)/acl.o \
        $(EOLIST)

 #
Index: dav/main/util.c
===================================================================
--- dav/main/util.c     (.../vendor/catacomb/current)   (revision 156)
+++ dav/main/util.c     (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -204,7 +204,7 @@
         /* ### not sure this works if the current request came in via https: */
         scheme = r->parsed_uri.scheme;
         if (scheme == NULL)
-            scheme = ap_http_method(r);
+            scheme = ap_http_scheme(r);

         /* insert a port if the URI did not contain one */
         if (comp.port == 0)
@@ -213,7 +213,9 @@
         /* now, verify that the URI uses the same scheme as the current.
            request. the port must match our port.
         */
-        apr_sockaddr_port_get(&port, r->connection->local_addr);
+
+       port = r->connection->local_addr->port;
+
         if (strcasecmp(comp.scheme, scheme) != 0
 #ifdef APACHE_PORT_HANDLING_IS_BUSTED
             || comp.port != port
Index: dav/main/Makefile
===================================================================
--- dav/main/Makefile   (.../vendor/catacomb/current)   (revision 156)
+++ dav/main/Makefile   (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -1,8 +1,8 @@
-top_srcdir   = /develop/httpd-2.0.49
-top_builddir = /develop/httpd-2.0.49
-srcdir       = /develop/httpd-2.0.49/modules/dav/main
-builddir     = /develop/httpd-2.0.49/modules/dav/main
-VPATH        = /develop/httpd-2.0.49/modules/dav/main
+top_srcdir   = /home/paritosh/httpd-2.2.2
+top_builddir = /home/paritosh/httpd-2.2.2
+srcdir       = /home/paritosh/httpd-2.2.2/modules/dav/main
+builddir     = /home/paritosh/httpd- 2.2.2/modules/dav/main
+VPATH        = /home/paritosh/httpd-2.2.2/modules/dav/main
 # a modules Makefile has no explicit targets -- they will be defined by
 # whatever modules are enabled. just grab special.mk to deal with this.
 include $(top_srcdir)/build/special.mk
Index: dav/main/modules.mk
===================================================================
--- dav/main/modules.mk (.../vendor/catacomb/current)   (revision 156)
+++ dav/main/modules.mk (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -1,5 +1,5 @@
-mod_dav.la: mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo acl.lo principal.lo methods.lo
-       $(MOD_LINK) mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo acl.lo principal.lo methods.lo
+libmod_dav.la: mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo methods.lo principal.lo acl.lo
+       $(MOD_LINK) mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo methods.lo principal.lo acl.lo $(MOD_DAV_LDADD)
 DISTCLEAN_TARGETS = modules.mk
-static =  mod_dav.la
+static =  libmod_dav.la
 shared =
Index: dav/fs/lock.c
===================================================================
--- dav/fs/lock.c       (.../vendor/catacomb/current)   (revision 156)
+++ dav/fs/lock.c       (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -632,7 +632,7 @@
                     apr_status_t rv;

                    /* if we don't see the file, then it's a locknull */
-                    rv = apr_lstat(&finfo, fname, APR_FINFO_MIN, p);
+                    rv = apr_stat(&finfo, fname, APR_FINFO_MIN, p);
                    if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) {
                        if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
                             /* ### push a higher-level description? */
Index: dav/fs/repos.c
===================================================================
--- dav/fs/repos.c      (.../vendor/catacomb/current)   (revision 156)
+++ dav/fs/repos.c      (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -1451,7 +1451,7 @@


         /* ### Optimize me, dirent can give us what we need! */
-        status = apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf,
+        status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf,
                            APR_FINFO_NORM, pool);
         if (status != APR_SUCCESS && status != APR_INCOMPLETE) {
             /* woah! where'd it go? */
Index: dav/fs/Makefile
===================================================================
--- dav/fs/Makefile     (.../vendor/catacomb/current)   (revision 156)
+++ dav/fs/Makefile     (.../catacomb/branches/work- with-apache2.2)     (revision 156)
@@ -1,8 +1,8 @@
-top_srcdir   = /develop/httpd-2.0.49
-top_builddir = /develop/httpd-2.0.49
-srcdir       = /develop/httpd-2.0.49/modules/dav/fs
-builddir     = /develop/httpd- 2.0.49/modules/dav/fs
-VPATH        = /develop/httpd-2.0.49/modules/dav/fs
+top_srcdir   = /home/paritosh/httpd-2.2.2
+top_builddir = /home/paritosh/httpd-2.2.2
+srcdir       = /home/paritosh/httpd-2.2.2/modules/dav/fs
+builddir     = /home/paritosh/httpd-2.2.2/modules/dav/fs
+VPATH        = /home/paritosh/httpd-2.2.2/modules/dav/fs
 # a modules Makefile has no explicit targets -- they will be defined by
 # whatever modules are enabled. just grab special.mk to deal with this.
 include $(top_srcdir)/build/special.mk
Index: dav/fs/modules.mk
===================================================================
--- dav/fs/modules.mk   (.../vendor/catacomb/current)   (revision 156)
+++ dav/fs/modules.mk   (.../catacomb/branches/work-with-apache2.2)     (revision 156)
@@ -1,5 +1,5 @@
-mod_dav_fs.la: mod_dav_fs.lo dbm.lo lock.lo repos.lo
-       $(MOD_LINK) mod_dav_fs.lo dbm.lo lock.lo repos.lo
+libmod_dav_fs.la: mod_dav_fs.lo dbm.lo lock.lo repos.lo
+       $(MOD_LINK) mod_dav_fs.lo dbm.lo lock.lo repos.lo $(MOD_DAV_FS_LDADD)
 DISTCLEAN_TARGETS = modules.mk
-static =  mod_dav_fs.la
+static =  libmod_dav_fs.la
 shared =
----------------------------- END OF PATCH --------------------------------------------------------


On 6/8/06, markus.litz@dlr.de <markus.litz@dlr.de> wrote:
Hi,

i know about that problem and think that it is a memory management problem with apache 2.2.x.
Until now, nobody had time to take a look, but it is a todo because we planed to use mod_dbd from apache 2.2 in catacomb.

Markus



Hi,

I am trying to run catacomb-0.9.2 on Apache 2.2.2 ( with mod_dav working  ) , but I get a segfault whenever the server receives a request on '/repos' ( default catacomb config ) . Following is the gdb backtrace:

(gdb) run -X -d ..
Starting program: /usr/local/apache2/bin/httpd -X -d ..
[Thread debugging using libthread_db enabled]
[New Thread -1210677024 (LWP 24368)]
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1210677024 (LWP 24368)]
0xb7d61a6c in dav_repos_no_trail (str=0x0) at util.c:727
727         int len = strlen(str);
(gdb) bt
#0  0xb7d61a6c in dav_repos_no_trail (str=0x0) at util.c:727
#1  0xb7d58f66 in dav_repos_get_resource (r=0x81a9c30, root_path=0x814ace8 "/repos", label=0x0, use_checked_in=0, result_resource=0x0) at repos.c:310
#2  0x08091caa in dav_get_resource (r=0x81a9c30, label_allowed=<value optimized out>, use_checked_in=0, res_p=0xbfe77430) at mod_dav.c:724
#3  0x08097127 in dav_handler (r=0x81a9c30) at mod_dav.c:1960
#4  0x08074b0f in ap_run_handler (r=0x81a9c30) at config.c:157
#5  0x08074e91 in ap_invoke_handler (r=0x81a9c30) at config.c:371
#6  0x0808c8ee in ap_process_request (r=0x81a9c30) at http_request.c:258
#7  0x08089fbc in ap_process_http_connection (c=0x8190748) at http_core.c:172
#8  0x0807b06f in ap_run_process_connection (c=0x8190748) at connection.c:43
#9  0x080afc64 in child_main (child_num_arg=<value optimized out>) at prefork.c:640
#10 0x080afeae in make_child (s=0x80e1038, slot=0) at prefork.c:680
#11 0x080b0ce3 in ap_mpm_run (_pconf=0x80dc0a8, plog=0x81201b8, s=0x80e1038) at prefork.c:956
#12 0x0806303b in main (argc=4, argv=0xbfe77874) at main.c:717





_______________________________________________
Catacomb mailing list
Catacomb@webdav.org
http://mailman.webdav.org/mailman/listinfo/catacomb

Index: Makefile.in.so
===================================================================
--- Makefile.in.so	(.../vendor/catacomb/current)	(revision 156)
+++ Makefile.in.so	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -31,7 +31,7 @@
 #DEFINES
 DEFS=-DVERSION=\"$(VERSION)\" @DEBUG@
 
-CFLAGS = `@apache_dir@/bin/apr-config --cflags` -Wall
+CFLAGS = `@apache_dir@/bin/apr-1-config --cflags --cppflags` -Wall
 
 #CPPFLAGS =  -DLINUX=2 -D_REENTRANT -D_XOPEN_SOURCE=500 -D_BSD_SOURCE -D_SVID_SOURCE
 
Index: dav_repos.h
===================================================================
--- dav_repos.h	(.../vendor/catacomb/current)	(revision 156)
+++ dav_repos.h	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -141,7 +141,7 @@
 extern const dav_hooks_repository dav_repos_hooks_repos;
 extern const dav_hooks_propdb     dav_repos_hooks_propdb;
 extern const dav_hooks_search     dav_repos_hooks_search;
-extern const dav_hooks_liveprop   dav_repos_hooks_liveprop;
+//extern const dav_hooks_liveprop   dav_repos_hooks_liveprop;
 extern const dav_hooks_vsn        dav_repos_hooks_vsn;
 extern const dav_hooks_locks      dav_repos_hooks_locks;
 extern const dav_hooks_acl        dav_repos_hooks_acl;
Index: dav/main/NWGNUmakefile
===================================================================
--- dav/main/NWGNUmakefile	(.../vendor/catacomb/current)	(revision 156)
+++ dav/main/NWGNUmakefile	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -184,6 +184,9 @@
 	$(OBJDIR)/liveprop.o \
 	$(OBJDIR)/providers.o \
 	$(OBJDIR)/std_liveprop.o \
+	$(OBJDIR)/methods.o \
+	$(OBJDIR)/principal.o \
+	$(OBJDIR)/acl.o \
 	$(EOLIST)
 
 #
Index: dav/main/util.c
===================================================================
--- dav/main/util.c	(.../vendor/catacomb/current)	(revision 156)
+++ dav/main/util.c	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -204,7 +204,7 @@
         /* ### not sure this works if the current request came in via https: */
         scheme = r->parsed_uri.scheme;
         if (scheme == NULL)
-            scheme = ap_http_method(r);
+            scheme = ap_http_scheme(r);
 
         /* insert a port if the URI did not contain one */
         if (comp.port == 0)
@@ -213,7 +213,9 @@
         /* now, verify that the URI uses the same scheme as the current.
            request. the port must match our port.
         */
-        apr_sockaddr_port_get(&port, r->connection->local_addr);
+        
+	port = r->connection->local_addr->port;
+	
         if (strcasecmp(comp.scheme, scheme) != 0
 #ifdef APACHE_PORT_HANDLING_IS_BUSTED
             || comp.port != port
Index: dav/main/Makefile
===================================================================
--- dav/main/Makefile	(.../vendor/catacomb/current)	(revision 156)
+++ dav/main/Makefile	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -1,8 +1,8 @@
-top_srcdir   = /develop/httpd-2.0.49
-top_builddir = /develop/httpd-2.0.49
-srcdir       = /develop/httpd-2.0.49/modules/dav/main
-builddir     = /develop/httpd-2.0.49/modules/dav/main
-VPATH        = /develop/httpd-2.0.49/modules/dav/main
+top_srcdir   = /home/paritosh/httpd-2.2.2
+top_builddir = /home/paritosh/httpd-2.2.2
+srcdir       = /home/paritosh/httpd-2.2.2/modules/dav/main
+builddir     = /home/paritosh/httpd-2.2.2/modules/dav/main
+VPATH        = /home/paritosh/httpd-2.2.2/modules/dav/main
 # a modules Makefile has no explicit targets -- they will be defined by
 # whatever modules are enabled. just grab special.mk to deal with this.
 include $(top_srcdir)/build/special.mk
Index: dav/main/modules.mk
===================================================================
--- dav/main/modules.mk	(.../vendor/catacomb/current)	(revision 156)
+++ dav/main/modules.mk	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -1,5 +1,5 @@
-mod_dav.la: mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo acl.lo principal.lo methods.lo
-	$(MOD_LINK) mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo acl.lo principal.lo methods.lo
+libmod_dav.la: mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo methods.lo principal.lo acl.lo
+	$(MOD_LINK) mod_dav.lo props.lo util.lo util_lock.lo liveprop.lo providers.lo std_liveprop.lo methods.lo principal.lo acl.lo $(MOD_DAV_LDADD)
 DISTCLEAN_TARGETS = modules.mk
-static =  mod_dav.la
+static =  libmod_dav.la
 shared = 
Index: dav/fs/lock.c
===================================================================
--- dav/fs/lock.c	(.../vendor/catacomb/current)	(revision 156)
+++ dav/fs/lock.c	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -632,7 +632,7 @@
                     apr_status_t rv;
 
 		    /* if we don't see the file, then it's a locknull */
-                    rv = apr_lstat(&finfo, fname, APR_FINFO_MIN, p);
+                    rv = apr_stat(&finfo, fname, APR_FINFO_MIN, p);
 		    if (rv != APR_SUCCESS && rv != APR_INCOMPLETE) {
 			if ((err = dav_fs_remove_locknull_member(p, fname, &buf)) != NULL) {
                             /* ### push a higher-level description? */
Index: dav/fs/repos.c
===================================================================
--- dav/fs/repos.c	(.../vendor/catacomb/current)	(revision 156)
+++ dav/fs/repos.c	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -1451,7 +1451,7 @@
 
 
         /* ### Optimize me, dirent can give us what we need! */
-        status = apr_lstat(&fsctx->info1.finfo, fsctx->path1.buf, 
+        status = apr_stat(&fsctx->info1.finfo, fsctx->path1.buf, 
                            APR_FINFO_NORM, pool);
         if (status != APR_SUCCESS && status != APR_INCOMPLETE) {
             /* woah! where'd it go? */
Index: dav/fs/Makefile
===================================================================
--- dav/fs/Makefile	(.../vendor/catacomb/current)	(revision 156)
+++ dav/fs/Makefile	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -1,8 +1,8 @@
-top_srcdir   = /develop/httpd-2.0.49
-top_builddir = /develop/httpd-2.0.49
-srcdir       = /develop/httpd-2.0.49/modules/dav/fs
-builddir     = /develop/httpd-2.0.49/modules/dav/fs
-VPATH        = /develop/httpd-2.0.49/modules/dav/fs
+top_srcdir   = /home/paritosh/httpd-2.2.2
+top_builddir = /home/paritosh/httpd-2.2.2
+srcdir       = /home/paritosh/httpd-2.2.2/modules/dav/fs
+builddir     = /home/paritosh/httpd-2.2.2/modules/dav/fs
+VPATH        = /home/paritosh/httpd-2.2.2/modules/dav/fs
 # a modules Makefile has no explicit targets -- they will be defined by
 # whatever modules are enabled. just grab special.mk to deal with this.
 include $(top_srcdir)/build/special.mk
Index: dav/fs/modules.mk
===================================================================
--- dav/fs/modules.mk	(.../vendor/catacomb/current)	(revision 156)
+++ dav/fs/modules.mk	(.../catacomb/branches/work-with-apache2.2)	(revision 156)
@@ -1,5 +1,5 @@
-mod_dav_fs.la: mod_dav_fs.lo dbm.lo lock.lo repos.lo
-	$(MOD_LINK) mod_dav_fs.lo dbm.lo lock.lo repos.lo
+libmod_dav_fs.la: mod_dav_fs.lo dbm.lo lock.lo repos.lo
+	$(MOD_LINK) mod_dav_fs.lo dbm.lo lock.lo repos.lo $(MOD_DAV_FS_LDADD)
 DISTCLEAN_TARGETS = modules.mk
-static =  mod_dav_fs.la
+static =  libmod_dav_fs.la
 shared =