Module: kamailio
Branch: master
Commit: 839cf89b02f8817156487a960ff62013e3cde530
URL: https://github.com/kamailio/kamailio/commit/839cf89b02f8817156487a960ff6201…
Author: Phil Lavin <phil.lavin(a)synety.com>
Committer: Phil Lavin <phil.lavin(a)synety.com>
Date: 2016-07-27T15:04:26+01:00
presentity: don't update terminated presentity entries in the database
- Fixes a race condition caused by, for example, the call being answered
at almost exactly the same time as the caller cancels. This causes
a terminated state to change back to completed. The dialog is then
removed from the database and the presentity entry stays in place
until it expires.
- This fix explicitly prevents terminated entries being updated as the
state machine in RFC 4235 prohibits this behaviour.
---
Modified: modules/presence/presentity.c
---
Diff: https://github.com/kamailio/kamailio/commit/839cf89b02f8817156487a960ff6201…
Patch: https://github.com/kamailio/kamailio/commit/839cf89b02f8817156487a960ff6201…
presentity: don't update terminated presentity entries in the database
- This fix is pull requested based on the stuff in pull request #724. That is because the stuff done here builds on that earlier work. #724 probably wants to be merged before this one.
- Fixes a race condition caused by, for example, the call being answered at almost exactly the same time as the caller cancels. This causes a terminated state to change back to completed. The dialog is then removed from the database and the presentity entry stays in place until it expires.
- This fix explicitly prevents terminated entries being updated as the state machine in RFC 4235 prohibits this behaviour.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/726
-- Commit Summary --
* presence: Always check if a record exists for this dialog before inserting
* presence: fix memory leak introduced by last commit
* presence: log when presentity is deleted due to already existing
* presentity: don't update terminated presentity entries in the database
-- File Changes --
M modules/presence/presentity.c (297)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/726.patchhttps://github.com/kamailio/kamailio/pull/726.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/726
- The presence implementation is a little dubious, to say the least.
It probably wants re-writing at some stage. However, this fixes a
race condition that could have a number of causes in which the PUA
is unaware of the eTag at the point it sends the PUBLISH.
The mechanism is such that the PUA passes the eTag that should be updated in the database into a main Kamailio process via a header in the PUBLISH. It is made aware of the new eTag by the main Kamailio process in the 200 OK.
In the scenario when the PUA has not received the 200 OK for the `Trying` `PUBLISH` before it sends the `early` `PUBLISH`, it will send the `early` PUBLISH with no eTag. This results in both `Trying` and `early` being inserted into the database. Only the `early` is updated, as it is the most recent, meaning the `Trying` will stick around in the table until it expires.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/724
-- Commit Summary --
* presence: Always check if a record exists for this dialog before inserting
-- File Changes --
M modules/presence/presentity.c (134)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/724.patchhttps://github.com/kamailio/kamailio/pull/724.diff
---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/724
These small changes fix the bug shown below and another potential one.
kamailio[3062]: : <core> [mem/q_malloc.c:453]: qm_free(): BUG: qm_free: freeing already freed pointer (0x7facf958dc08), called from presence: hash.c: delete_shtable(316), first free presence: hash.c: free_subs_list(349) - aborting
It's the double free apocalypse day :)
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/754
-- Commit Summary --
* presence: fix multiple double free on shutdown caught with memlog=1
-- File Changes --
M modules/presence/hash.c (11)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/754.patchhttps://github.com/kamailio/kamailio/pull/754.diff
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/pull/754