[Home]

Summary:ASTERISK-01544: [patch] Asterisk stops
Reporter:Tomica Crnek (tcrnek)Labels:
Date Opened:2004-05-06 03:17:23Date Closed:2008-01-15 14:54:35.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) backtrace-gdb.txt
( 1) chan_zap.c.diff
Description:I have updated my Asterisk installation from CVS few days ago and since then I have noticed that after some time the Asterisk is up and running something happens and no more calls can be established. In that moment you can not connect to Asterisk console either, you get this:

[root@ceres root]# asterisk -rvvvvvvvvvvvvvv
 == Parsing '/etc/asterisk/asterisk.conf': Found
Asterisk CVS-01/30/04-12:28:49, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer <markster@digium.com>
=========================================================================
Broken pipe


****** ADDITIONAL INFORMATION ******

This usually happens after few hours Asterisk is running. In that moment, if you call from PSTN via E1 PRI interface you get "ERROR IN CONNECTION", like when PRI is down. On the other side, if you call from H.323 or SIP or internal PRI lines no calls can be established.

After this happens I have to restart Asterisk and then it works for few hours again.
Comments:By: zoa (zoa) 2004-05-06 03:26:31

Upgrade to a more recent CVS version, yours is very old.

Therefor, i'll close out this bug, if you can reproduce it with the lastest cvs, reopen the bug, and  look at www.voip-info.org on how do debug deadlocks and post the results here, or find a bugmarshal on #asterisk-bugs.

By: Tomica Crnek (tcrnek) 2004-05-06 09:36:41

I have updated it from CVS and it happened again with the same error, it was working ok for 6 hours.

[root@ceres root]# asterisk -rvvvvvvvvvvv
 == Parsing '/etc/asterisk/asterisk.conf': Found
Asterisk CVS-01/30/04-12:28:49, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer <markster@digium.com>
=========================================================================
Broken pipe
[root@ceres root]#

I don't know why it says that CVS is from 01/30/04???? I have deleted all files from my server before updating and downloaded everything again from CVS.

By: Mark Spencer (markster) 2004-05-06 09:58:59

As I said in e-mail, I will need access via ssh to figure out where the file descriptor leak is.  We haven't seen this leak in other systems.  Do you have any non-standard patches, applications, channel drivers, etc. included that are not with the standard asterisk distribution?

In any case, find me on IRC (kram).

By: Brian West (bkw918) 2004-05-06 10:01:57

you didn't update.. go to /usr/src/asterisk and do make update

Your version didn't update and WHY are you trying ot start asterisk with -rvvvvvvv


Try asterisk -vvvgc

bkw

By: Tomica Crnek (tcrnek) 2004-05-06 10:28:51

When I "make update" in asterisk source directory /usr/local/src/asterisk I got this:

[root@ceres asterisk]# make update
Updating from CVS...
[root@ceres asterisk]#

... so, it seams there is nothing to update

Why -rvvv? When Asterisk is running and this happens it doesn't crash, the process stil runs but you can not connect to it and no new calls can be established.

By: Tomica Crnek (tcrnek) 2004-05-06 10:33:28

No, I don't have any new non-standard software included in Asterisk. The only non-asterisk software is oh323-0.5.9, but this is included from the very first moment and it was working fine.

By: Mark Spencer (markster) 2004-05-06 11:39:31

My previous comments here were mistakenly made because i thought this was cybershield's bug report.  I'll remove them.

I still believe this system is running out of file descriptors.  Find me on IRC if you want to work on it.

By: Brian West (bkw918) 2004-05-06 18:36:57

accually I think their is a bug in oh323-0.5.9 that will cause asterisk to segfault and the author is working on it.

bkw

By: twisted (twisted) 2004-05-06 19:00:38

tcrnek: do this, and this exactly:

cd /usr/src
mv asterisk asterisk-oldstuff
export CVSROOT=:pserver:anoncvs@cvs.digium.com:/usr/cvsroot
cvs login
(password is anoncvs)
cvs co astersik
cd asterisk
make
(if it completes without errors, make install)

THAT will update your cvs.  Apparently you're not updating properly.
Do this, then post back here, or find one of us on IRC (bkw_ or twisted)

By: twisted (twisted) 2004-05-06 19:02:53

by the way, your configs will not be overwritten unless you do make samples

also, if this compiles and installs fine, you can rm -rf /usr/src/asterisk-oldstuff afterwards

By: cybershield (cybershield) 2004-05-07 08:03:12

For markster:

I don't know if we have a bugs group that overlapping, but i've the same problem...
Today is happen exactly the tcrnek's problem: when i try to open remote asterisk console with command 'asterisk -r' i receive this:


Asterisk CVS-HEAD-05/05/04-19:37:00, Copyright (C) 1999-2004 Digium.
Written by Mark Spencer <markster@digium.com>
=========================================================================
Broken pipe


Moreover asterisk box don't accept incoming call from ISDN-pri

In message log i've founded only this:

May  7 12:04:26 ERROR[16386]: Unable to spawn thread to handle connection
May  7 12:04:38 ERROR[16386]: Unable to spawn thread to handle connection

Your hack added in chan_zap don't appear in log.


Morever, yesterday I have changed E1 4span tor2 with 2 E100P and I check the same problem the I had previously.

In attach gdb backtrace.

By: cybershield (cybershield) 2004-05-12 04:21:33

Yesterday i have installed fedora.
I have update asterisk with CVS-HEAD-05/11/04-18:51:38
The problem continue with broken pipe and PRI E1 block

Change the error write into message log:
May 12 09:26:22 ERROR[-1084359760]: asterisk.c:325 listener: Unable to
spawn thread to handle connection: Cannot allocate memory
May 12 09:26:25 ERROR[-1084359760]: asterisk.c:325 listener: Unable to
spawn thread to handle connection: Cannot allocate memory
May 12 09:26:27 ERROR[-1084359760]: asterisk.c:325 listener: Unable to
spawn thread to handle connection: Cannot allocate memory
May 12 09:26:31 ERROR[-1084359760]: asterisk.c:325 listener: Unable to
spawn thread to handle connection: Cannot allocate memory
May 12 09:26:33 ERROR[-1084359760]: asterisk.c:325 listener: Unable to
spawn thread to handle connection: Cannot allocate memory

My system have P4 3.0GHz HyperThread with 512MB Ram (I have used also a backup asterisk box but the problem continues).
It seems to be memory leak (or pthread resource leak) a problem is introduced habitually after a sure time

By: Mark Spencer (markster) 2004-05-12 13:51:45

So are you really running out of memory?  Are you seeing Asterisk's footprint increase in size substantially over time?  You can use ps auxww | grep asterisk to look and see how bit it is.

By: cybershield (cybershield) 2004-05-12 14:11:28

When start
root     11188  0.8  1.2 185616 6292 pts/1   S    20:05   0:00 asterisk -vvvg -c

After little hour
root     21098  0.6 25.8 3093604 32672 ?     S    13:01   0:25 asterisk -vvvg -c

By: Mark Spencer (markster) 2004-05-12 18:02:19

But that's not even the same asterisk process ID...  Something is bizarre about that.

By: Tomica Crnek (tcrnek) 2004-05-13 03:11:27

Just a thought if this might be related with oh323, as Mark said. 10 days ago, when I have reported this issue, was the first time it happened. Before that I was using oh323 and I had never any problems with that. As I red on devel list there are some changes in Asterisk API (gethostbyname). With new Asterisk downloaded from CVS oh323 can't be compiled, it reports error - something about gethostbyname. An old chan_oh323.so module is active in Asterisk and I just thought there might be a problem with this old module calling functions from Asterisk.

By: Tomica Crnek (tcrnek) 2004-05-13 06:49:42

output from 13/5/2004 9:11 AM

[root@ceres root]# ps auxww |grep asterisk
root      5461  0.0  0.1  4188 1136 ?        S    May12   0:00 /bin/sh /usr/sbin/safe_asterisk
root      5463  0.1  1.5 581892 16448 ?      S    May12   1:02 asterisk -vvvg -c


output from 13/5/2004 12:40 PM

[root@ceres src]# ps auxww |grep asterisk
root      5461  0.0  0.1  4188 1136 ?        S    May12   0:00 /bin/sh /usr/sbin/safe_asterisk
root      5463  0.1  2.5 2098244 25952 ?     S    May12   1:39 asterisk -vvvg -c


The second one is taken in the moment when asterisk stopped, and here is output from console in this moment

May 13 12:28:00 WARNING[1200884528]: chan_zap.c:6491 pri_dchannel: Unable to start PBX on channel 10, span 2
   -- Channel 1, span 1 got hangup
   -- Channel 1, span 1 got hangup
May 13 12:29:52 WARNING[1192491824]: chan_zap.c:6421 pri_dchannel: Ring requested on channel 1 already in use on span 1.  Hanging up owner.
May 13 12:29:52 WARNING[1192491824]: pbx.c:1933 ast_pbx_start: Failed to create new channel thread
May 13 12:29:52 WARNING[1192491824]: chan_zap.c:4132 zt_new: Unable to start PBX on Zap/31-1

By: cybershield (cybershield) 2004-05-13 08:31:29

I have fixed the error.

I have found the attribute of pthread used in overlap dial for simple switch (function ss_thread) not initialized. This cause a pthread resource leak.
Use my patch's file (chan_zap.c.diff) to fix the problem.

I completed tests on my asterisk.

modificata il: 05-13-04 07:31

By: Mark Spencer (markster) 2004-05-13 15:54:03

Patch didn't apply but I put the smae thing in.  tcrnek: can you confirm the patch fixes it for you, too?

By: Tomica Crnek (tcrnek) 2004-05-13 16:14:29

I have patched it, I'll let you know in few hours or tomorrow when people start calling

By: twisted (twisted) 2004-05-15 00:21:52

tcrnek, can we get an update?

By: Tomica Crnek (tcrnek) 2004-05-15 14:06:26

sorry for delay. it seams it is ok. asterisk didn't fail whole day

By: Mark Spencer (markster) 2004-05-15 14:51:42

Fixed in CVS!

By: Digium Subversion (svnbot) 2008-01-15 14:54:35.000-0600

Repository: asterisk
Revision: 2955

U   trunk/channels/chan_zap.c

------------------------------------------------------------------------
r2955 | markster | 2008-01-15 14:54:34 -0600 (Tue, 15 Jan 2008) | 2 lines

Make sure we initialize attributes properly on thread (bug ASTERISK-1544)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=2955