Bug 265977 - net/asterisk18: kill the process last forever
Summary: net/asterisk18: kill the process last forever
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-21 16:49 UTC by O. Hartmann
Modified: 2022-09-14 00:17 UTC (History)
1 user (show)

See Also:
madpilot: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2022-08-21 16:49:36 UTC
For almost five years for now I'm operating a small routing/pbx/firewall appliance comprised with the recent "STABLE" FreeBSD, which is for now 13-STABLE for testing purposes. It has been observed over this time, that restarting "asterisk" (in this case it is 18.3.0, but this is also the case for 16 and back to 13 I guess ...) via "service restart" or trying to stop via "service asterisk stop", the process hangs forever. Below I've typed "Ctrl-t" to check the current state, I doubt it helps, but anyway ...

[...]
# service asterisk restart
Stopping asterisk.
load: 0.34  cmd: asterisk 15604 [select] 9.64r 0.02u 0.01s 0% 12844k
mi_switch+0xbf sleepq_catch_signals+0x30c sleepq_timedwait_sig+0x12 _cv_timedwait_sig_sbt+0xfd seltdwait+0x6f kern_poll_kfds+0x4a7 kern_poll+0x9f sys_poll+0x50 amd64_syscall+0xf5 fast_syscall_common+0xf8
Comment 1 Guido Falsi freebsd_committer freebsd_triage 2022-08-21 19:35:52 UTC
Hi,

Thanks for reporting.

Unluckily I'm not seeing this here. But there are many factors. Maybe I'm not using some asterisk module that you're using that is causing the issue.

The output of crtl-t is not enough to understand what is going on. I see it is polling the kernel, but there is no indication of which part of asterisk is doing that.

First thing to try is seeing if asterisk has any output. The asterisk rc script to stop asterisk simply runs "core stop now" in the asterisk console.

SO you could try running this in the asterisk console:

# core set verbose 99
# core stop now

Ad post the output of that, maybe it can give some indication.

There are also other variation of the core stop command, you could try some of those.

Failing that the only simple way to diagnose this that comes to mind is to start disabling asterisk modules one by one and see when the issue disappears. Obviously to test this you'll need to kill asterisk from the console manually.

Another thing worth trying could be forcing reinstallation of some asterisk dependencies, just in case some ABI incompatibility slipped in.

Hope this helps.
Comment 2 Josmar Calin De Pierri 2022-09-14 00:17:24 UTC
(In reply to O. Hartmann from comment #0)

I maintain a bunch of PBX based on asterisk with thousands of IP stations on them and never see this happen, neither with 13 nor 18.

Did you install your Asterisk using pkg install or compiled it from ports?
If you used ports, did you change the configuration options? Which ones?

That hang also happens if you issue a 'core stop now' directly in the Asterisk console?

Are you using any database connection? (for realtime, CDR ...)