<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
Running an application that sends out ENUM queries using getdns
(v1.0.0b2) and libevent2 on CentOS 6, runs fine for a low amount of
requests.<br>
However, when sending ~50 requests per second, a segmenation fault
occurs in _getdns_rbtree_insert() (some runs the Segv occurs in the
compare function), after a few minutes.<br>
<br>
<blockquote type="cite">Program terminated with signal 11,
Segmentation fault.<br>
#0 _getdns_rbtree_insert (rbtree=0x104a518, data=0x7f80f8004cc0)
at util/rbtree.c:240<br>
240 if ((r = rbtree->cmp(data->key,
node->key)) == 0) {<br>
</blockquote>
<br>
<blockquote type="cite">#0 _getdns_rbtree_insert (rbtree=0x104a518,
data=0x7f80f8004cc0) at util/rbtree.c:240<br>
#1 0x00007f80cc1dc0ef in _getdns_context_track_outbound_request
(dnsreq=0x7f80f8004cc0)<br>
at ./context.c:3080<br>
#2 0x00007f80cc1c9fed in getdns_general_ns (context=0x10493e0,
loop=0x1024940, <br>
name=<value optimized out>, request_type=35,
extensions=<value optimized out>, <br>
userarg=0x7f80f8006b50, return_netreq_p=0x7f809c5cbb88, <br>
callbackfn=0x7f80cc44f7d0 <enum_lclient_callback>,
internal_cb=0, usenamespaces=0)<br>
at ./general.c:452<br>
#3 0x00007f80cc1ca3f1 in _getdns_general_loop (context=<value
optimized out>, <br>
loop=<value optimized out>, name=<value optimized
out>, request_type=<value optimized out>, <br>
extensions=<value optimized out>, userarg=<value
optimized out>, netreq_p=0x7f809c5cbb88, <br>
callback=0x7f80cc44f7d0 <enum_lclient_callback>,
internal_cb=0) at ./general.c:517<br>
#4 0x00007f80cc1ca454 in getdns_general (context=<value
optimized out>, <br>
name=<value optimized out>, request_type=<value
optimized out>, <br>
extensions=<value optimized out>, userarg=<value
optimized out>, <br>
transaction_id=0x7f80f8006b78, callbackfn=0x7f80cc44f7d0
<enum_lclient_callback>)<br>
at ./general.c:674<br>
</blockquote>
<br>
I suspect this to be a threading issue: the rbtree being accessed
for both insert and delete from different threads. The call to <i>getdns_general</i><i>()</i>
is protected by a mutex in my application, so only one thread issues
a query at a time. However, the event base runs in its own thread,
as usual with libevent, so the problem probably lies in entries
being deleted from the rbtree when the response is handled.<br>
<br>
Is it supposed to be possible with getdns to run the event base in
its own thread?<br>
<br>
Thanks,<br>
Robert<br>
</body>
</html>