Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug kamailio_pcscf using gdb #347

Open
lglhust opened this issue Aug 5, 2024 · 3 comments
Open

How to debug kamailio_pcscf using gdb #347

lglhust opened this issue Aug 5, 2024 · 3 comments

Comments

@lglhust
Copy link

lglhust commented Aug 5, 2024

Hi herlesupreeth:
I use "kamailio -f /etc/kamailio_pcscf/kamailio_pcscf.cfg -P /kamailio_pcscf.pid -DD -E -e" to load kamailio_pcscf .
I don't how to debug kamailio_pcscf with gdb.

Thanks. 
@herlesupreeth
Copy link
Owner

You can use the below diff

diff --git a/ims_base/kamailio_init.sh b/ims_base/kamailio_init.sh
index d48ad37..5618fe6 100755
--- a/ims_base/kamailio_init.sh
+++ b/ims_base/kamailio_init.sh
@@ -42,10 +42,11 @@ elif [[ "$COMPONENT_NAME" =~ ^(scscf-[[:digit:]]+$) ]]; then
        kamailio -f /etc/kamailio_scscf/kamailio_scscf.cfg -P /kamailio_scscf.pid -DD -E -e
 elif [[ "$COMPONENT_NAME" =~ ^(pcscf-[[:digit:]]+$) ]]; then
        echo "Deploying component: '$COMPONENT_NAME'"
+       apt-get install -y gdb && \
        /mnt/pcscf/pcscf_init.sh && \
        mkdir -p /var/run/kamailio_pcscf && \
        rm -f /kamailio_pcscf.pid && \
-       kamailio -f /etc/kamailio_pcscf/kamailio_pcscf.cfg -P /kamailio_pcscf.pid -DD -E -e
+       gdb --args kamailio -f /etc/kamailio_pcscf/kamailio_pcscf.cfg -P /kamailio_pcscf.pid -DD -E -e
 elif [[ "$COMPONENT_NAME" =~ ^(smsc-[[:digit:]]+$) ]]; then
        echo "Deploying component: '$COMPONENT_NAME'"
        /mnt/smsc/smsc_init.sh && \

@NUCLEAR-WAR
Copy link

Hi @lglhust,

If your plan is to open a Ticket in Kamailio repo, then you need to do this in the Container terminal :

docker exec -it kamailio_container /bin/bash

ulimit -c unlimited
sysctl -w kernel.core_pattern=core

the coredump will be in the root /

make sure that gdb tool is installed

after that you need to read teh coredump on the conainer, sending teh coredump to someone will not help, it must be done on the same machine with the same problematic code that need to be debugged:
like that

gdb
bt full
and copy the whole output

Best regards

@lglhust
Copy link
Author

lglhust commented Aug 7, 2024

Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants