You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Joachim Feise <jf...@ics.uci.edu> on 2003/05/19 18:19:45 UTC

mod_dav_svn segfaults on MKACTIVITY

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I am trying to use mod_dav_svn without autoversioning.
The svn book says (in appendix D) that svn commit is mapped to
MKACTIVITY, CHECKOUT, PUT.

I did find, however, that MKACTIVITY with any URI results in
an Apache segfault.
I am following the example in RFC 3253:
     MKACTIVITY /svn/repos/test-23 HTTP/1.1
     Host: localhost

The error log:
[Sun May 18 18:01:50 2003] [notice] child pid 27824 exit signal Segmentation fault (11)

I am using Apache 2.0.45 with svn 0.23.0 (but it happened with 0.22.2 as well.)

- -Joe
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (MingW32)

iD8DBQE+ySBHKc8oZ1MoTeoRAsZiAKCPxENIvgbkSJTzi080aFKPOKZhRwCfW20b
ghitHI2q5jlnjkhjp5e0gj0=
=DZcF
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: mod_dav_svn segfaults on MKACTIVITY

Posted by Joachim Feise <jf...@ics.uci.edu>.
Ben Collins-Sussman wrote:
> Joachim Feise <jf...@ics.uci.edu> writes:
> 
> 
>>>Are you issuing a direct MKACTIVITY with some non-svn client?  
>>
>>Yes.
>>
> 
> 
> Do you have a tool for doing that?  I'd like to reproduce the segfault
> locally, but cadaver only allows me to issue WebDAV requests, not
> DeltaV ones.

Well, nothing fit for use yet. I am maintaining DAV Explorer (a Java
WebDAV client), and want to get it to support DeltaV. I have an undergrad
class working on that.
In any case, I was able to reproduce it by just telnetting to the server.

-Joe


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: mod_dav_svn segfaults on MKACTIVITY

Posted by Ben Collins-Sussman <su...@collab.net>.
Joachim Feise <jf...@ics.uci.edu> writes:

> Ben Collins-Sussman wrote:
> > Joachim Feise <jf...@ics.uci.edu> writes:
> > 
> > 
> >>>Are you issuing a direct MKACTIVITY with some non-svn client?  
> >>
> >>Yes.
> >>
> > 
> > 
> > Do you have a tool for doing that?  I'd like to reproduce the segfault
> > locally, but cadaver only allows me to issue WebDAV requests, not
> > DeltaV ones.
> 
> 
> here is a backtrace.
> MKACTIVITY without any body is enough to reproduce it.

OK, an arbitrary MKACTIVITY now returns an error.  I committed the
change in r5988.  Thanks for finding this!

Here's the mod_dav_svn patch, if you want to apply it locally:

Index: subversion/mod_dav_svn/version.c
===================================================================
--- subversion/mod_dav_svn/version.c	(revision 5987)
+++ subversion/mod_dav_svn/version.c	(revision 5988)
@@ -799,8 +799,16 @@
   const char *txn_name;
   dav_error *err;
 
-  /* ### need to check some preconditions? */
-
+  /* sanity check:  make sure the resource is a valid activity, in
+     case an older mod_dav doesn't do the check for us. */
+  if (! dav_svn_can_be_activity(resource))
+    return dav_new_error_tag(resource->pool, HTTP_FORBIDDEN,
+                             SVN_ERR_APMOD_MALFORMED_URI,
+                             "Activities cannot be created at that location; "
+                             "query the DAV:activity-collection-set property.",+                             SVN_DAV_ERROR_NAMESPACE,
+                             SVN_DAV_ERROR_TAG);
+   
   err = dav_svn_create_activity(resource->info->repos, &txn_name,
                                 resource->pool);
   if (err != NULL)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: mod_dav_svn segfaults on MKACTIVITY

Posted by Joachim Feise <jf...@ics.uci.edu>.
Ben Collins-Sussman wrote:
> Joachim Feise <jf...@ics.uci.edu> writes:
> 
> 
>>>Are you issuing a direct MKACTIVITY with some non-svn client?  
>>
>>Yes.
>>
> 
> 
> Do you have a tool for doing that?  I'd like to reproduce the segfault
> locally, but cadaver only allows me to issue WebDAV requests, not
> DeltaV ones.


here is a backtrace.
MKACTIVITY without any body is enough to reproduce it.

-Joe

telnet localhost 8081
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
MKACTIVITY /svn/test1 HTTP/1.1
Host: localhost


(gdb) run -X -f /home/jfeise/source/httpd.conf
Starting program: /usr/local/apache2/bin/httpd -X -f /home/jfeise/source/httpd.conf

Program received signal SIGSEGV, Segmentation fault.
0x40286c03 in dav_svn_store_activity (repos=0x81b79b8, activity_id=0x0,
    txn_name=0x81b7d00 "1i") at ./subversion/mod_dav_svn/activity.c:98
98        key.dsize = strlen(activity_id) + 1;  /* null-term'd */
(gdb) backtrace
#0  0x40286c03 in dav_svn_store_activity (repos=0x81b79b8, activity_id=0x0,
    txn_name=0x81b7d00 "1i") at ./subversion/mod_dav_svn/activity.c:98
#1  0x4028dcff in dav_svn_make_activity (resource=0x81b7930)
    at ./subversion/mod_dav_svn/version.c:809
#2  0x8091e2a in dav_method_make_activity (r=0x81b5f68) at mod_dav.c:4074
#3  0x80925fa in dav_handler (r=0x81b5f68) at mod_dav.c:4571
#4  0x80b0f5c in ap_run_handler (r=0x81b5f68) at config.c:194
#5  0x80b140a in ap_invoke_handler (r=0x81b5f68) at config.c:401
#6  0x808c292 in ap_process_request (r=0x81b5f68) at http_request.c:288
#7  0x80882cf in ap_process_http_connection (c=0x81a7128) at http_core.c:293
#8  0x80b93f8 in ap_run_process_connection (c=0x81a7128) at connection.c:85
#9  0x80b963c in ap_process_connection (c=0x81a7128, csd=0x81a7070) at connection.c:211
#10 0x80afdbf in child_main (child_num_arg=0) at prefork.c:696
#11 0x80afe63 in make_child (s=0x810e570, slot=0) at prefork.c:736
#12 0x80aff39 in startup_children (number_to_start=5) at prefork.c:808
#13 0x80b021e in ap_mpm_run (_pconf=0x810a4c0, plog=0x814a5c0, s=0x810e570)
    at prefork.c:1024
#14 0x80b4f24 in main (argc=4, argv=0xbffffb98) at main.c:660
(gdb)


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

RE: mod_dav_svn segfaults on MKACTIVITY

Posted by Sander Striker <st...@apache.org>.
> From: sussman@collab.net [mailto:sussman@collab.net]
> Sent: Monday, May 19, 2003 11:02 PM

> Joachim Feise <jf...@ics.uci.edu> writes:
> 
> > > 
> > > Are you issuing a direct MKACTIVITY with some non-svn client?  
> > 
> > Yes.
> > 
> 
> Do you have a tool for doing that?  I'd like to reproduce the segfault
> locally, but cadaver only allows me to issue WebDAV requests, not
> DeltaV ones.

telnet localhost 80

will generally do the trick ;).


Sander

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: mod_dav_svn segfaults on MKACTIVITY

Posted by Ben Collins-Sussman <su...@collab.net>.
Joachim Feise <jf...@ics.uci.edu> writes:

> > 
> > Are you issuing a direct MKACTIVITY with some non-svn client?  
> 
> Yes.
> 

Do you have a tool for doing that?  I'd like to reproduce the segfault
locally, but cadaver only allows me to issue WebDAV requests, not
DeltaV ones.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: mod_dav_svn segfaults on MKACTIVITY

Posted by Joachim Feise <jf...@ics.uci.edu>.
Ben Collins-Sussman wrote:
> Joachim Feise <jf...@ics.uci.edu> writes:
> 
> 
>>     MKACTIVITY /svn/repos/test-23 HTTP/1.1
>>     Host: localhost
>>
>>The error log:
>>[Sun May 18 18:01:50 2003] [notice] child pid 27824 exit signal
>>Segmentation fault (11)
> 
> 
> Are you issuing a direct MKACTIVITY with some non-svn client?  

Yes.

> 
> You can't just create an activity anywhere you want.
> 
> The svn client requests the DAV:activity-collection-set property
> first, so it knows where it's allowed to create new activities.  Look
> at section 13.7 of RFC 3253.

If I would have gotten an error, I would have adjusted my code as
neccessary. I am concerned about the segfault. I can fix things in my
code later.

-Joe


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: mod_dav_svn segfaults on MKACTIVITY

Posted by Ben Collins-Sussman <su...@collab.net>.
Joachim Feise <jf...@ics.uci.edu> writes:

>      MKACTIVITY /svn/repos/test-23 HTTP/1.1
>      Host: localhost
> 
> The error log:
> [Sun May 18 18:01:50 2003] [notice] child pid 27824 exit signal
> Segmentation fault (11)

Are you issuing a direct MKACTIVITY with some non-svn client?  

You can't just create an activity anywhere you want.

The svn client requests the DAV:activity-collection-set property
first, so it knows where it's allowed to create new activities.  Look
at section 13.7 of RFC 3253.

Still, we shouldn't segfault, we should error.  :-)
I'll take a look at that.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org