Hi,
It seems to me that there is a possible race condition in dialog module
that can potentially cause segfault. Let me explain my thinking.
In the dlg_timer routine we call get_expired_dlgs (line 4). This function
returns a list of dlg_tl's that have expired. This code is executed in the
timer process and I can't see any reason why if a dialog is terminated
(user hangs up) at the same time as the expiry timer fires that the dialog
can't be nuked between lines 4 and 5 below. This will ultimately result in
segfault in the later lines (5 and onwards) or in the specific timer_hdl
callback function where the dialog is retrieved using some pointer
arithmetic....
1. void dlg_timer_routine(unsigned int ticks , void * attr)
2. {
3. struct dlg_tl *tl, *ctl;
4. tl = get_expired_dlgs( ticks );
5. while (tl) {
6. ctl = tl;
7. tl = tl->next;
8. ctl->next = NULL;
9. LM_DBG("tl=%p next=%p\n", ctl, tl);
10. timer_hdl( ctl );
11. }
12. }
I would imagine we should look at incrementing ref for every dlg that goes
into the tl. Then unref when removed or when fired.... (but at quick glance
it looks like there could be a few locking issues with this solution)
Cheers
Jason
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#333 - avpops: avp_check, allow avp as second parameter on re operation
User who did this - Daniel-Constantin Mierla (miconda)
----------
Few remarks:
- i think the pkg malloc for compiling the re from PV at runtime can be avoided by using a local variable. Let the pkg malloc only for fixup when the parameter is a string (like it was in the fixup function)
- runtime constructed re needs to be regfree(...) to avoid leaks
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=333#comment1053
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
The following task has a new comment added:
FS#332 - add arbitrary params in Path header
User who did this - Daniel-Constantin Mierla (miconda)
----------
Thanks for the patch. I wonder if really makes sense to restrict the parameter to be an AVP. XAVP is similar, but any other pseudo-variable can do it. Have you had any specific reason to stick to avp only?
----------
More information can be found at the following URL:
https://sip-router.org/tracker/index.php?do=details&task_id=332#comment1052
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
THIS IS AN AUTOMATED MESSAGE, DO NOT REPLY.
A new Flyspray task has been opened. Details are below.
User who did this - Víctor Seva (linuxmaniac)
Attached to Project - sip-router
Summary - avpops: avp_check, allow avp as second parameter on re operation
Task Type - Improvement
Category - Module
Status - Unconfirmed
Assigned To -
Operating System - All
Severity - Low
Priority - Normal
Reported Version - Development
Due in Version - Undecided
Due Date - Undecided
Details - I don't know if this is the best way to implement this. But it's a start.
Example:
#!ifdef WITH_AVPOPS
$avp(s:foo) = "sip:nono@bar.net";
$avp(s:test_re) = "sip:.*@bar.net";
$avp(s:test_re) = "sip:.*@ar.net";
if(avp_check("$avp(s:foo)","re/sip:.*@bar.net/g"))
{
xlog("L_INFO", "[0] found!\n");
}
if(avp_check("$avp(s:foo)","re/$avp(s:test_re)/g"))
{
xlog("L_INFO", "[1] found!\n");
}
$avp(s:foo) = "sip:yes@tar.net";
$avp(s:test_re) = "sip:yes@.*";
if(avp_check("$avp(s:foo)","re/sip:.*@tar.net/g"))
{
xlog("L_INFO", "[2] found!\n");
}
if(avp_check("$avp(s:foo)","re/$avp(s:test_re)/g"))
{
xlog("L_INFO", "[3] found!\n");
}
One or more files have been attached.
More information can be found at the following URL:
http://sip-router.org/tracker/index.php?do=details&task_id=333
You are receiving this message because you have requested it from the Flyspray bugtracking system. If you did not expect this message or don't want to receive mails in future, you can change your notification settings at the URL shown above.
Module: sip-router
Branch: master
Commit: ee7dcac57501cd0563c69ae967ba785cec035062
URL: http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=ee7dcac…
Author: Elena-Ramona Modroiu <ramona(a)asipto.com>
Committer: Elena-Ramona Modroiu <ramona(a)asipto.com>
Date: Mon Aug 19 16:48:01 2013 +0200
htable: lifted limit for max number of slots to 2^31
- there can be systems with large amount of memory
- clarification in docs about the case when the value is out of exected
range
---
modules/htable/README | 4 ++--
modules/htable/doc/htable_admin.xml | 4 ++--
modules/htable/ht_api.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/modules/htable/README b/modules/htable/README
index 3324807..fe0c37f 100644
--- a/modules/htable/README
+++ b/modules/htable/README
@@ -299,8 +299,8 @@ if(is_present_hf("Authorization"))
* size - number specifying the size of hash table. Larger value means
less collisions. The number of entries (aka slots or buckets) in
the table is 2^size. The possible range for this value is from 2 to
- 14, smaller or larger values will be increased or decreased
- respectivly.
+ 31, smaller or larger values will be increased to 3 (8 slots) or
+ decreased to 14 (16384 slots).
* autoexpire -time in seconds to delete an item from hash table if no
update was done to it. If is missing or set to 0, the items won't
expire.
diff --git a/modules/htable/doc/htable_admin.xml b/modules/htable/doc/htable_admin.xml
index c38e555..3331bff 100644
--- a/modules/htable/doc/htable_admin.xml
+++ b/modules/htable/doc/htable_admin.xml
@@ -236,8 +236,8 @@ if(is_present_hf("Authorization"))
<emphasis>size</emphasis> - number specifying the size of hash
table. Larger value means less collisions. The number of entries
(aka slots or buckets) in the table is 2^size. The possible range
- for this value is from 2 to 14, smaller or larger values will be
- increased or decreased respectivly.
+ for this value is from 2 to 31, smaller or larger values will be
+ increased to 3 (8 slots) or decreased to 14 (16384 slots).
</para>
</listitem>
<listitem>
diff --git a/modules/htable/ht_api.c b/modules/htable/ht_api.c
index 84eb2e0..3dd96cc 100644
--- a/modules/htable/ht_api.c
+++ b/modules/htable/ht_api.c
@@ -248,7 +248,7 @@ int ht_add_table(str *name, int autoexp, str *dbtable, int size, int dbmode,
if(size<=1)
ht->htsize = 8;
- else if(size>14)
+ else if(size>31)
ht->htsize = 1<<14;
else ht->htsize = 1<<size;
ht->htid = htid;