Summary:ASTERISK-07397: asterisk -rx "show queues" occasionally causes segfault
Reporter:damin (damin)Labels:
Date Opened:2006-07-25 14:29:54Date Closed:2006-09-06 15:10:15
Versions:Frequency of
Environment:Attachments:( 0) bug-7592-bt.txt
Description:Every now and then, when we attempt to look at the status of our queues, Asterisk seg faults. I have attached a backtrace to see if anyone can figure this out. This happens on a production box on a fairly regular basis, so I have instructed my guys to stop using the "show queues" command until we can get this sorted out.
Comments:By: Clod Patry (junky) 2006-07-26 09:25:18

i upgraded to 1.2.10, and im getting deadlocks, so queues and agents are no longer working then that happens.
I've some external script which are doing show queues via the AMI too.
This is some infos related to my deadlocks.

Attachment is: right after some ppl at the customer services noticed me the problem i've been able to do a show channels, but after few minutse, show channels returns me nothing at all.

By: Russell Bryant (russell) 2006-07-26 23:57:01

I've been looking through the code to figure out the situation that causes this.  Are you using realtime queues?

By: Russell Bryant (russell) 2006-07-27 00:02:07

junky, if you are having issues with deadlocks, then that is not the same issue that Damin has reported here.  Please create a new bug for your problem.

By: damin (damin) 2006-07-27 00:07:28

In my case, no. I am NOT using real-time queues.

By: Jared Smith (jsmith) 2006-07-27 13:06:44

I'm seeing something similar with queues on 1.2.10.  Mine isn't causing Asterisk to segfault, but Asterisk stops accepting calls or new CLI connections.  Also, Asterisk stops responding to CLI commands on existing CLI connections.  I can reproduce this at will with a small queue (around 5 agents, no more than 5 simultaneous calls).

Trying with trunk to see if it's any better...

By: Clod Patry (junky) 2006-07-27 16:48:46

so jsmith has the same problem as me apparently.
Does your debug looks like mine?

By: Jared Smith (jsmith) 2006-07-27 18:54:01

Junky -- mine isn't crashing Asterisk, so I don't have a backtrace.  Asterisk just stops respondinig :-(

I've also tried this with the latest -TRUNK from today, and while it takes longer to lock up, it still locks up after around 30 minutes.

By: Clod Patry (junky) 2006-07-27 19:25:40

mine is not crashing neither, see my previous note.
even if it not crashing, you can see whats going on, and what's causing the deadlocks.

By: Russell Bryant (russell) 2006-07-27 20:20:03

jsmith and junky:  As I noted before, if you are having a deadlock problem, then it is not the same bug being reported here.  Please open a new issue to track this different problem.

If either of you would like to catch me while I'm on IRC, I would be happy to log in and try to debug the deadlock.  To prepare a machine for deadlock debugging in Asterisk 1.2, please edit the Makefile and find where it says "-DDEBUG_THREADS".  Enable this, run a "make clean", and then run "make dont-optimize" which will build a copy of asterisk without optimizations and install it.

By: Jared Smith (jsmith) 2006-07-28 08:28:56

I've moved the deadlock issue to bug 7604, where I've turned on debug_threads and dont-optimize.  I'll continue working on the deadlock issue there.

By: Clod Patry (junky) 2006-07-30 02:46:33

When show queues aren't use on a regular basics, do you still get segfaults?
And it looks like your member has been set to NULL.

By: damin (damin) 2006-07-30 06:21:45

Junky: The system runs stable when we do not use "show queueus". We have been using FOP to monitor Queue status via Manager Events as an interim solution, which seems to work just fine. However, we still need to get this fixed.

As for the member being set to NULL, if that is what the backtrace shows, then that is what is happening. The queues are relatively simple, with static, dedicated agents.

By: Serge Vecher (serge-v) 2006-09-06 09:52:05

damin: any development here?

By: damin (damin) 2006-09-06 10:01:48

Nope.. no updates.. Our solution was to use the FOP to see the status of people in queue and not run the "show queues" command at all. I do not have the resources to track it any further.

By: Clod Patry (junky) 2006-09-06 15:09:27

And related to deadlocks, ASTERISK-7409, i dont have access anymore on that system, so im closing that one, if you need to re-open, for any reason, feel free to pass by #asterisk-bugs on FreeNode.