You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Gustavo Niemeyer <ni...@conectiva.com> on 2002/09/09 21:08:26 UTC

libneon/subversion bug

I'm not sure if this is a bug in libneon (0.23.3) or subversion (3140),
but a command like "svn co https://INEXISTANT/foo /foo/bar" has
segfaulted inside libneon.

Here's a backtrace:

#0  0x401fd190 in ne_addr_first (addr=0x80a0430) at ne_socket.c:635
#1  0x401f773d in do_connect (req=0x809de88, host=0x8091a30, err=0x4020459b "Could not connect to server")
    at ne_request.c:1323
#2  0x401f790d in open_connection (req=0x809de88) at ne_request.c:1390
#3  0x401f6ced in send_request (req=0x809de88, request=0x80a1030) at ne_request.c:954
#4  0x401f736e in ne_begin_request (req=0x809de88) at ne_request.c:1166
#5  0x401f75a9 in ne_request_dispatch (req=0x809de88) at ne_request.c:1249
#6  0x40201ab2 in propfind (handler=0x809c9d8, results=0x4011e610 <svn_ra_dav__get_activity_collection+516>,
    userdata=0xbffff430) at ne_props.c:134
#7  0x40201c2a in ne_propfind_named (handler=0x809c9d8, props=0x401224b4,
    results=0x4011e610 <svn_ra_dav__get_activity_collection+516>, userdata=0xbffff430) at ne_props.c:175
#8  0x4011e959 in svn_ra_dav__get_props () from /usr/lib/libsvn_ra_dav-1.so.0
#9  0x4011ea72 in svn_ra_dav__get_props_resource () from /usr/lib/libsvn_ra_dav-1.so.0
#10 0x4011ec09 in svn_ra_dav__get_starting_props () from /usr/lib/libsvn_ra_dav-1.so.0
#11 0x4011ecc0 in svn_ra_dav__get_baseline_info () from /usr/lib/libsvn_ra_dav-1.so.0
#12 0x4011b544 in svn_ra_dav__get_commit_editor () from /usr/lib/libsvn_ra_dav-1.so.0
#13 0x4011bdbe in svn_ra_dav__do_checkout () from /usr/lib/libsvn_ra_dav-1.so.0
#14 0x40019f92 in svn_client_checkout () from /usr/lib/libsvn_client-1.so.0
#15 0x0804aa4b in svn_handle_warning ()
#16 0x0804d686 in svn_handle_warning ()
#17 0x40350d7f in __libc_start_main () from /lib/libc.so.6

And some debugging in frame 0:

(gdb) list
632     ne_inet_addr *ne_addr_first(ne_sock_addr *addr)
633     {
634     #ifdef USE_GETADDRINFO
635         addr->cursor = addr->result->ai_next;
636         return addr->result;
637     #else
638         addr->cursor = 0;
639         return &addr->addrs[0];
(gdb) print addr->result
$3 = (struct addrinfo *) 0x0

I hope it helps.

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

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

Re: libneon/subversion bug

Posted by Gustavo Niemeyer <ni...@conectiva.com>.
Hi again Joe!

Thanks for your quick answer!

> > I'm not sure if this is a bug in libneon (0.23.3) or subversion (3140),
> > but a command like "svn co https://INEXISTANT/foo /foo/bar" has
> > segfaulted inside libneon.
> 
> Thanks for the backtrace - does the patch below fix it? (If so, ra_dav

Yes, it fixes the problem completely.

> must treat a request failure as non-fatal at some point, and carry on
> using the session; this is a legitimate use of the neon API but might
> produce strange behaviour, since failing DNS lookups will be retried on
> each request in the current implementation)

Hummm.. I see. Your patch seems to implement the behavior that is
currently expected by subversion. Look:

[niemeyer@matrix neon-0.23.3]$ svn co https://repos/foo/bar /tmp/foo
svn: RA layer request failed
svn: PROPFIND of /: Could not resolve hostname `repos': Host not found

I'm not sure if subversion should treat something like this as
non-fatal, since a host failure is usually something definitive, and
kills any further actions.

Maybe subversion should just detect this error in some other way then?

> (BTW, can you CC suspected neon bugs to neon@webdav.org?)

Oh.. I'm sorry. I should have done this before.

Thank you!

-- 
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

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

Re: libneon/subversion bug

Posted by Joe Orton <jo...@manyfish.co.uk>.
On Mon, Sep 09, 2002 at 06:08:26PM -0300, Gustavo Niemeyer wrote:
> I'm not sure if this is a bug in libneon (0.23.3) or subversion (3140),
> but a command like "svn co https://INEXISTANT/foo /foo/bar" has
> segfaulted inside libneon.

Thanks for the backtrace - does the patch below fix it? (If so, ra_dav
must treat a request failure as non-fatal at some point, and carry on
using the session; this is a legitimate use of the neon API but might
produce strange behaviour, since failing DNS lookups will be retried on
each request in the current implementation)

(BTW, can you CC suspected neon bugs to neon@webdav.org?)

Index: src/ne_request.c
===================================================================
RCS file: /home/cvs/neon/src/ne_request.c,v
retrieving revision 1.103
diff -u -r1.103 ne_request.c
--- src/ne_request.c	9 Sep 2002 21:27:43 -0000	1.103
+++ src/ne_request.c	9 Sep 2002 21:32:32 -0000
@@ -1134,6 +1134,8 @@
 	ne_set_error(sess, _("Could not resolve hostname `%s': %s"), 
 		     info->hostname,
 		     ne_addr_error(info->address, buf, sizeof buf));
+	ne_addr_destroy(info->address);
+	info->address = NULL;
 	return NE_LOOKUP;
     } else {
 	return NE_OK;
Index: test/request.c
===================================================================
RCS file: /home/cvs/neon/test/request.c,v
retrieving revision 1.76
diff -u -r1.76 request.c
--- test/request.c	25 Aug 2002 10:25:32 -0000	1.76
+++ test/request.c	9 Sep 2002 21:37:13 -0000
@@ -1216,6 +1216,17 @@
     return fail_noserver("no.such.domain", 7777, NE_LOOKUP);
 }
 
+/* neon <= 0.23.3: if a nameserver lookup failed, subsequent requests
+ * on the session would crash. */
+static int fail_double_lookup(void)
+{
+     ne_session *sess = ne_session_create("http", "nohost.example.com", 80);
+     any_request(sess, "/foo");
+     any_request(sess, "/bar");
+     ne_session_destroy(sess);
+     return OK;
+}
+
 static int fail_connect(void)
 {
     return fail_noserver("localhost", 7777, NE_CONNECT);
@@ -1388,6 +1399,7 @@
     T(fail_eof_headers),
     T(read_timeout),
     T(fail_lookup),
+    T(fail_double_lookup),
     T(fail_connect),
     T(proxy_no_resolve),
     T(fail_chunksize),


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