[kamailio/kamailio] Fixed segfault when using kazoo_query in kazoo mod (PR #4002)
A response to the amqp query caused a segfault in libc - Refactored parts of the code to be more readable and DRY - Split up functions for 3/4/5 arguments passed - Tested in 8.5.2 #### Pre-Submission Checklist - [x] Commit message has the format required by CONTRIBUTING guide - [x] Commits are split per component (core, individual modules, libs, utils, ...) - [x] Each component has a single commit (if not, squash them into one commit) - [x] No commits to README files for modules (changes must be done to docbook files in `doc/` subfolder, the README file is autogenerated) #### Type Of Change - [x] Small bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds new functionality) - [ ] Breaking change (fix or feature that would change existing functionality) #### Checklist: <!-- Go over all points below, and after creating the PR, tick the checkboxes that apply --> - [x] PR should be backported to stable branches - [x] Tested changes locally - [ ] Related to issue #XXXX (replace XXXX with an open issue number) #### Description The current state of the module was not usable anymore as everything up from 5.5.x caused a segfault when the kazoo_query method was executed. Refactored the module a bit to make sure it is works again 5.8.x You can view, comment on, or merge this pull request online at: https://github.com/kamailio/kamailio/pull/4002 -- Commit Summary -- * Fixed segfault when using kazoo_query in kazoo mod -- File Changes -- M src/modules/kazoo/kazoo.c (10) M src/modules/kazoo/kz_amqp.c (67) M src/modules/kazoo/kz_amqp.h (9) -- Patch Links -- https://github.com/kamailio/kamailio/pull/4002.patch https://github.com/kamailio/kamailio/pull/4002.diff -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002@github.com>
Commit message hasn't the format required by CONTRIBUTING guide -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-2422849179 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c2422849179@github.com>
@linuxmaniac Thanks, fixed the commit message -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-2425976247 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c2425976247@github.com>
@linuxmaniac requested changes on this pull request. you need to format the code with clang-format and amend
@@ -846,17 +846,17 @@ void kz_amqp_channel_close(kz_amqp_conn_ptr rmq, amqp_channel_t channel) kz_amqp_error("closing channel", amqp_channel_close(rmq->conn, channel, AMQP_REPLY_SUCCESS)); } -#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
why are you removing this part? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#pullrequestreview-2381363036 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381363036@github.com>
@remcovanvugt pushed 1 commit. 3c8126974f03c9a297e10e5db5d9b5fcbfd797aa kazoo: fixed segfault when using kazoo_query -- View it on GitHub: https://github.com/kamailio/kamailio/pull/4002/files/38c8cc862d5cd4b441d7ab8... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/before/38c8cc862d5cd4b441d7ab8de55fd339b41cd1c1/after/3c8126974f03c9a297e10e5db5d9b5fcbfd797aa@github.com>
@remcovanvugt commented on this pull request.
@@ -846,17 +846,17 @@ void kz_amqp_channel_close(kz_amqp_conn_ptr rmq, amqp_channel_t channel) kz_amqp_error("closing channel", amqp_channel_close(rmq->conn, channel, AMQP_REPLY_SUCCESS)); } -#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
@linuxmaniac This was not supposed to be removed, fixed that -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#discussion_r1808390500 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381410616@github.com>
you need to format the code with clang-format and amend
Done -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-2426078366 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c2426078366@github.com>
@linuxmaniac commented on this pull request.
@@ -846,17 +846,17 @@ void kz_amqp_channel_close(kz_amqp_conn_ptr rmq, amqp_channel_t channel) kz_amqp_error("closing channel", amqp_channel_close(rmq->conn, channel, AMQP_REPLY_SUCCESS)); } -#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
not, really. The code is different. Please, put it back as it was. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#discussion_r1808393748 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381416227@github.com>
@remcovanvugt pushed 1 commit. 61fcd7d73a8fd2ed68435f81f18dad9c5a941928 kazoo: fixed segfault when using kazoo_query -- View it on GitHub: https://github.com/kamailio/kamailio/pull/4002/files/940293a8e53868aca618075... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/before/940293a8e53868aca618075bfa5c32baef948fa8/after/61fcd7d73a8fd2ed68435f81f18dad9c5a941928@github.com>
@remcovanvugt commented on this pull request.
@@ -846,17 +846,17 @@ void kz_amqp_channel_close(kz_amqp_conn_ptr rmq, amqp_channel_t channel) kz_amqp_error("closing channel", amqp_channel_close(rmq->conn, channel, AMQP_REPLY_SUCCESS)); } -#if AMQP_VERSION_MAJOR == 0 && AMQP_VERSION_MINOR < 13
Sorry about the extra work, I overlooked the commit between 5.8.2 and master. That's why this got accidentally removed. It should be as it was now. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#discussion_r1808421205 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381462066@github.com>
@linuxmaniac commented on this pull request. > @@ -888,8 +888,8 @@ int kz_amqp_connection_open_ssl(kz_amqp_conn_ptr rmq) amqp_ssl_socket_set_verify( rmq->socket, kz_amqps_verify_peer | kz_amqps_verify_hostname); #else - amqp_ssl_socket_set_verify_peer(rmq->socket, kz_amqps_verify_peer); not really. Still changes here. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#pullrequestreview-2381466112 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381466112@github.com>
@remcovanvugt pushed 1 commit. f8a1d2e86b2fe59c8d02a239dc7b893a4b92ee85 kazoo: fixed segfault when using kazoo_query -- View it on GitHub: https://github.com/kamailio/kamailio/pull/4002/files/61fcd7d73a8fd2ed68435f8... You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/before/61fcd7d73a8fd2ed68435f81f18dad9c5a941928/after/f8a1d2e86b2fe59c8d02a239dc7b893a4b92ee85@github.com>
@remcovanvugt commented on this pull request. > @@ -888,8 +888,8 @@ int kz_amqp_connection_open_ssl(kz_amqp_conn_ptr rmq) amqp_ssl_socket_set_verify( rmq->socket, kz_amqps_verify_peer | kz_amqps_verify_hostname); #else - amqp_ssl_socket_set_verify_peer(rmq->socket, kz_amqps_verify_peer); Formatted that back to what it was -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#discussion_r1808436621 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381486925@github.com>
@linuxmaniac approved this pull request. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#pullrequestreview-2381582991 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/review/2381582991@github.com>
waiting for comments from @lazedo for a bit -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-2426254753 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c2426254753@github.com>
Thanks, merging it. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-2485971659 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c2485971659@github.com>
Merged #4002 into master. -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#event-15351007809 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/issue_event/15351007809@github.com>
denyspozniak left a comment (kamailio/kamailio#4002) @miconda are there any plans to backport it to 5.8? -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-3767978984 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c3767978984@github.com>
denyspozniak left a comment (kamailio/kamailio#4002)
@miconda are there any plans to backport it to 5.8?
sorry for noice, here it is: https://github.com/kamailio/kamailio/commit/f8ec60e717ba27ab187bf9a0800b4673... -- Reply to this email directly or view it on GitHub: https://github.com/kamailio/kamailio/pull/4002#issuecomment-3768165364 You are receiving this because you are subscribed to this thread. Message ID: <kamailio/kamailio/pull/4002/c3768165364@github.com>
participants (4)
-
Daniel-Constantin Mierla -
Denys Pozniak -
Remco van Vugt -
Victor Seva