### Description

Calling functions from the `dialplan` module in 5.8 (`dp_translate()`, 
`dp_match()`) results in the following line being logged:

```
WARNING: <core> [core/mem/q_malloc.c:520]: qm_free(): WARNING: free(0) called 
from dialplan: dp_db.c: pcre2_free(206)
```

Is this a functional problem, or just a case of overly aggressive logging?

### Troubleshooting

#### Reproduction
Reproducible with the following kamailio config:

```
#!KAMAILIO

loadmodule "pv"
loadmodule "db_sqlite"
loadmodule "xlog"
loadmodule "dialplan"

disable_tcp = true
force_rport = true

!!define DBFILE /etc/kamailio/kamailio.sqlite

modparamx("db_sqlite","db_set_readonly", "$def(DBFILE)")

modparamx("dialplan","db_url", "sqlite:///$def(DBFILE)")
modparam("dialplan", "attrs_pvar", "$avp(dp_attrs)")

request_route {
    if ( $rm == "ACK" ) {
        exit;
    }

    xinfo("$ci New request\n");

    dp_match("1", "$rU");
    exit;
}
```

The warning log is issued in 5.8 but not 5.7.  Reproduced by sending a request 
with SIPp:

```
sipp -sn uac  -m 1 -s 15554445555 localhost
```

### Possible Solutions

Not sure if this is just a case of logging being overly aggressive, or an issue 
with the module's memory management.

### Additional Information

  * **Kamailio Version** - output of `kamailio -v`

```
version: kamailio 5.8.1 (x86_64/linux)
flags: USE_TCP, USE_TLS, USE_SCTP, TLS_HOOKS, USE_RAW_SOCKS, DISABLE_NAGLE, 
USE_MCAST, DNS_IP_HACK, SHM_MMAP, PKG_MALLOC, MEM_JOIN_FREE, Q_MALLOC, 
F_MALLOC, TLSF_MALLOC, DBG_SR_MEMORY, USE_FUTEX, FAST_LOCK-ADAPTIVE_WAIT, 
USE_DNS_CACHE, USE_DNS_FAILOVER, USE_NAPTR, USE_DST_BLOCKLIST, HAVE_RESOLV_RES, 
TLS_PTHREAD_MUTEX_SHARED
ADAPTIVE_WAIT_LOOPS 1024, MAX_RECV_BUFFER_SIZE 262144, MAX_SEND_BUFFER_SIZE 
262144, MAX_URI_SIZE 1024, BUF_SIZE 65535, DEFAULT PKG_SIZE 8MB
poll method support: poll, epoll_lt, epoll_et, sigio_rt, select.
id: unknown
compiled with gcc 12.2.0
```

Tested using docker `debian:12-slim` using the official packages from 
`http://deb.kamailio.org/kamailio58`


* **Operating System**:

Docker debian:12-slim,  but also observed in Alpine Linux/



-- 
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3851
You are receiving this because you are subscribed to this thread.

Message ID: <kamailio/kamailio/issues/3...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org

Reply via email to