### Description
I have compiled Kamailio with google ASAN module and faced issue where the string PV with NULL value cannot be copied.
Using GDB I found this function call triggers error when Google ASAN is used, `value->s.s = NULL`, `value->s.len = 0`
```
memcpy(var->v.value.s.s, value->s.s, value->s.len);
```
[Link](https://github.com/kamailio/kamailio/blob/caccb13e29ee12166c8101efa0d…
This happens only when ASAN is used.
Without ASAN same function call with the same values does not trigger an error.
In my test case this function called from [`lost/functions.c:1285`](https://github.com/kamailio/kamailio/blob/caccb13e29ee12166c8101efa0d5ab2745876413/src/modules/lost/functions.c#L1285)
To compile with asan used extra flags
```
-fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fsanitize=float-divide-by-zero -fsanitize=float-cast-overflow -fno-sanitize=null -fno-sanitize=alignment
```
### Troubleshooting
#### Log Messages
```
0(913407) INFO: {1 1 INVITE 1-455779(a)172.21.0.84} lost [functions.c:891]: lost_function(): ### LOST urn [urn:sip:911@3.236.25.254:5060]
0(913407) INFO: {1 1 INVITE 1-455779(a)172.21.0.84} lost [functions.c:983]: lost_function(): ### LOST loc [<112233445566(a)jim.com>]
0(913407) ERROR: {1 1 INVITE 1-455779(a)172.21.0.84} lost [utilities.c:336]: lost_get_content(): could not get XML node content
pv_svar.c:137:3: runtime error: null pointer passed as argument 2, which is declared to never be null
```
### Additional Information
* **Kamailio Version** - output of `kamailio -v`
current master, test 375f86b69e11cf835ae919873d3cd56f32d589c8
* **Operating System**:
Centos 8
--
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/issues/2913
Module: kamailio
Branch: master
Commit: 6857234c321faf33573e1a034ab666dc158eb549
URL: https://github.com/kamailio/kamailio/commit/6857234c321faf33573e1a034ab666d…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: 2021-11-04T17:15:49+01:00
core: reorder fields of struct _cfg_group for better alignment
---
Modified: src/core/cfg/cfg_struct.h
---
Diff: https://github.com/kamailio/kamailio/commit/6857234c321faf33573e1a034ab666d…
Patch: https://github.com/kamailio/kamailio/commit/6857234c321faf33573e1a034ab666d…
---
diff --git a/src/core/cfg/cfg_struct.h b/src/core/cfg/cfg_struct.h
index e03024e700..03f38f322d 100644
--- a/src/core/cfg/cfg_struct.h
+++ b/src/core/cfg/cfg_struct.h
@@ -76,7 +76,6 @@ enum { CFG_GROUP_UNKNOWN = 0, CFG_GROUP_DYNAMIC, CFG_GROUP_STATIC };
/*! \brief linked list of registered groups */
#pragma pack(push, 1)
typedef struct _cfg_group {
- int num; /*!< number of variables within the group */
cfg_mapping_t *mapping; /*!< describes the mapping betweeen
the cfg variable definition and the memory block */
char *vars; /*!< pointer to the memory block where the values
@@ -85,6 +84,7 @@ typedef struct _cfg_group {
cfg_add_var_t *add_var; /*!< Additional instances of the variables.
This linked list is used only before the config is
shmized. */
+ int num; /*!< number of variables within the group */
int size; /*!< size of the memory block that has to be
allocated to store the values */
int meta_offset; /*!< offset of the group within the
@@ -100,9 +100,9 @@ typedef struct _cfg_group {
to temporary set the handle in the main process and
restore it later to its original value. */
- unsigned char dynamic; /*!< indicates whether the variables within the group
- are dynamically allocated or not */
struct _cfg_group *next;
+ unsigned int dynamic; /*!< indicates whether the variables within the group
+ are dynamically allocated or not */
int name_len;
char name[1];
} cfg_group_t;
Add mqueue_name and mqueue_size to define queues.
Updated doc.
<!-- Kamailio Pull Request Template -->
<!--
IMPORTANT:
- for detailed contributing guidelines, read:
https://github.com/kamailio/kamailio/blob/master/.github/CONTRIBUTING.md
- pull requests must be done to master branch, unless they are backports
of fixes from master branch to a stable branch
- backports to stable branches must be done with 'git cherry-pick -x ...'
- code is contributed under BSD for core and main components (tm, sl, auth, tls)
- code is contributed GPLv2 or a compatible license for the other components
- GPL code is contributed with OpenSSL licensing exception
-->
#### Pre-Submission Checklist
<!-- Go over all points below, and after creating the PR, tick all the checkboxes that apply -->
<!-- All points should be verified, otherwise, read the CONTRIBUTING guidelines from above-->
<!-- If you're unsure about any of these, don't hesitate to ask on sr-dev mailing list -->
- [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
- [ ] Small bug fix (non-breaking change which fixes an issue)
- [X] 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 -->
- [ ] PR should be backported to stable branches
- [X] Tested changes locally
- [ ] Related to issue #XXXX (replace XXXX with an open issue number)
#### Description
<!-- Describe your changes in detail -->
Add 2 new mqueue module parameters to simplify config queue definition.
You can view, comment on, or merge this pull request online at:
https://github.com/kamailio/kamailio/pull/2825
-- Commit Summary --
* mqueue: add two new module parameters
-- File Changes --
M src/modules/mqueue/doc/mqueue_admin.xml (58)
M src/modules/mqueue/mqueue_mod.c (38)
-- Patch Links --
https://github.com/kamailio/kamailio/pull/2825.patchhttps://github.com/kamailio/kamailio/pull/2825.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/2825