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

[CRASH] Executing mi("lb_reload") at timer_route #3488

Closed
apsaras opened this issue Oct 4, 2024 · 1 comment
Closed

[CRASH] Executing mi("lb_reload") at timer_route #3488

apsaras opened this issue Oct 4, 2024 · 1 comment
Assignees
Labels

Comments

@apsaras
Copy link

apsaras commented Oct 4, 2024

Hello

I use timer_route to check every 10sec the status of a remote registrar server and when is down I execute queries to registrant and load_balancer DB Tables to re-register and re-route traffic to a secondary registrant server. When mi("reg_reload") is executed, it works. When mi("lb_reload") is executed service is crashing.

To reproduce.

  1. Create a timer_route
  2. Include mi("lb_reload");

Relevant System Logs

INFO:load_balancer:mi_lb_reload: "lb_reload" MI command received!
ERROR:core:db_use_table: invalid parameter value (nil), 0x7f460766d070
CRITICAL:core:sig_usr: segfault in process pid: 2900851, id: 8
INFO:core:handle_sigs: child process 2900851 exited by a signal 11
kernel: [8474889.624724] opensips[2900851]: segfault at 8 ip 00007f4607f06ab4 sp 00007ffc1bae4da8 error 6 in db_postgres.so[7f4607f04000+9000] likely on CPU 1 (core 0, socket 2)

OS/environment information

  • Operating System: Debian 12
  • OpenSIPS installation: packages
  • other relevant information:

opensips -V
version: opensips 3.4.8 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
git revision: 78cdea9
main.c compiled on with gcc 12

@bogdan-iancu
Copy link
Member

@apsaras , this is (unfortunately) a known issue - the load_balancer modules does not need DB connections from the SIP worker processes at runtime, as it is not performing any runtime DB ops. All DB ops are done at startup or in the MI processes (for reload).
But with this new mi_script module, you may end up with having MI cmds called from a non MI processes, but from a regular SIP worker which has no DB con.
I recall @razvancrainea having a similar problem, I will check if there was any conclusion.

@razvancrainea razvancrainea self-assigned this Oct 17, 2024
razvancrainea added a commit that referenced this issue Oct 17, 2024
This ensures that the `mi("lb_reload")` command runs properly from
whatever process the job is dispatched from.

Many thanks to Antonis Psaras (@apsaras on GitHub) for reporting it.
Close #3488

(cherry picked from commit 3df04c7)
razvancrainea added a commit that referenced this issue Oct 17, 2024
This ensures that the `mi("lb_reload")` command runs properly from
whatever process the job is dispatched from.

Many thanks to Antonis Psaras (@apsaras on GitHub) for reporting it.
Close #3488

(cherry picked from commit 3df04c7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants