[asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread Danny Dias
Hello Asterisk community,

We are having some problems with crashes in Asterisk, my asterisk
versions are 1.4.24.1 and 1.4.23.2. I have found this:

~/work/asterisk-branch-1.4$ svn log -c 260345

r260345 | mmichelson | 2010-04-30 22:08:15 +0200 (Fri, 30 Apr 2010) | 18 lines

Fix potential crash from race condition due to accessing channel data
without the channel locked.

In res_musiconhold.c, there are several places where a channel's
stream's existence is checked prior to calling ast_closestream on it. The issue
here is that in several cases, the channel was not locked while checking the
stream. The result was that if two threads checked the state of the channel's
stream at approximately the same time, then there could be a situation where
both threads attempt to call ast_closestream on the channel's stream. The result
here is that the refcount for the stream would go below 0, resulting in a crash.

I have added proper channel locking to res_musiconhold.c to ensure that
we do not try to check chan-stream without the channel locked. A
Digium customer has been using this patch for several weeks and has not
 had any crashes since applying the patch.

ABE-2147


How can i apply this patch on my asterisk versions: 1.4.24.1 and
1.4.23.2? do i have to apply this patch manually?

Thanks in advance for your help

-- 
Ing. Danny Dias
www.DannTEL.net

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread John Novack
Hasn't this been fixed in later versions?
1.4.37 is current, or at least it was in the last few days.

Upgrading with no reason isn't suggested, but in this case you have a 
good reason, and if you dig deep enough you may find the fix is already 
in place.

John Novack


Danny Dias wrote:
 Hello Asterisk community,

 We are having some problems with crashes in Asterisk, my asterisk
 versions are 1.4.24.1 and 1.4.23.2. I have found this:

 ~/work/asterisk-branch-1.4$ svn log -c 260345
 
 r260345 | mmichelson | 2010-04-30 22:08:15 +0200 (Fri, 30 Apr 2010) | 18 lines

 Fix potential crash from race condition due to accessing channel data
 without the channel locked.

 In res_musiconhold.c, there are several places where a channel's
 stream's existence is checked prior to calling ast_closestream on it. The 
 issue
 here is that in several cases, the channel was not locked while checking the
 stream. The result was that if two threads checked the state of the channel's
 stream at approximately the same time, then there could be a situation where
 both threads attempt to call ast_closestream on the channel's stream. The 
 result
 here is that the refcount for the stream would go below 0, resulting in a 
 crash.

 I have added proper channel locking to res_musiconhold.c to ensure that
 we do not try to check chan-stream without the channel locked. A
 Digium customer has been using this patch for several weeks and has not
   had any crashes since applying the patch.

 ABE-2147
 

 How can i apply this patch on my asterisk versions: 1.4.24.1 and
 1.4.23.2? do i have to apply this patch manually?

 Thanks in advance for your help



-- 

Dog is my Co-pilot


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread Danny Dias
Hello John,

What i am asking is if i can apply this patch manually or something like
this without making any upgrade of Asterisk, has anyone done this before?

Or i have to upgrade my Asterisk versions...i don't really want to do
this...

Thanks in Advance!

2010/11/22 John Novack jnov...@stromberg-carlson.org

 Hasn't this been fixed in later versions?
 1.4.37 is current, or at least it was in the last few days.

 Upgrading with no reason isn't suggested, but in this case you have a good
 reason, and if you dig deep enough you may find the fix is already in place.

 John Novack



 Danny Dias wrote:

 Hello Asterisk community,

 We are having some problems with crashes in Asterisk, my asterisk
 versions are 1.4.24.1 and 1.4.23.2. I have found this:

 ~/work/asterisk-branch-1.4$ svn log -c 260345
 
 r260345 | mmichelson | 2010-04-30 22:08:15 +0200 (Fri, 30 Apr 2010) | 18
 lines

 Fix potential crash from race condition due to accessing channel data
 without the channel locked.

 In res_musiconhold.c, there are several places where a channel's
 stream's existence is checked prior to calling ast_closestream on it. The
 issue
 here is that in several cases, the channel was not locked while checking
 the
 stream. The result was that if two threads checked the state of the
 channel's
 stream at approximately the same time, then there could be a situation
 where
 both threads attempt to call ast_closestream on the channel's stream. The
 result
 here is that the refcount for the stream would go below 0, resulting in a
 crash.

 I have added proper channel locking to res_musiconhold.c to ensure that
 we do not try to check chan-stream without the channel locked. A
 Digium customer has been using this patch for several weeks and has not
  had any crashes since applying the patch.

 ABE-2147
 

 How can i apply this patch on my asterisk versions: 1.4.24.1 and
 1.4.23.2? do i have to apply this patch manually?

 Thanks in advance for your help




 --

 Dog is my Co-pilot




-- 
Ing. Danny Dias
www.DannTEL.net
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread John Novack



Danny Dias wrote:

Hello John,

What i am asking is if i can apply this patch manually or something 
like this without making any upgrade of Asterisk, has anyone done this 
before?



I can't answer that question.
Or i have to upgrade my Asterisk versions...i don't really want to do 
this...



Why not? MANY fixes have been included in the upgrades.
Improved security at the least. There are 10-15 versions between where 
you are operating and what is current


John Novack


Thanks in Advance!

2010/11/22 John Novack jnov...@stromberg-carlson.org 
mailto:jnov...@stromberg-carlson.org


Hasn't this been fixed in later versions?
1.4.37 is current, or at least it was in the last few days.

Upgrading with no reason isn't suggested, but in this case you
have a good reason, and if you dig deep enough you may find the
fix is already in place.

John Novack



Danny Dias wrote:

Hello Asterisk community,

We are having some problems with crashes in Asterisk, my asterisk
versions are 1.4.24.1 and 1.4.23.2. I have found this:

~/work/asterisk-branch-1.4$ svn log -c 260345

r260345 | mmichelson | 2010-04-30 22:08:15 +0200 (Fri, 30 Apr
2010) | 18 lines

Fix potential crash from race condition due to accessing
channel data
without the channel locked.

In res_musiconhold.c, there are several places where a channel's
stream's existence is checked prior to calling ast_closestream
on it. The issue
here is that in several cases, the channel was not locked
while checking the
stream. The result was that if two threads checked the state
of the channel's
stream at approximately the same time, then there could be a
situation where
both threads attempt to call ast_closestream on the channel's
stream. The result
here is that the refcount for the stream would go below 0,
resulting in a crash.

I have added proper channel locking to res_musiconhold.c to
ensure that
we do not try to check chan-stream without the channel locked. A
Digium customer has been using this patch for several weeks
and has not
 had any crashes since applying the patch.

ABE-2147


How can i apply this patch on my asterisk versions: 1.4.24.1 and
1.4.23.2? do i have to apply this patch manually?

Thanks in advance for your help



-- 


Dog is my Co-pilot




--
Ing. Danny Dias
www.DannTEL.net http://www.DannTEL.net


--

Dog is my Co-pilot

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread Danny Dias
2010/11/22 John Novack jnov...@stromberg-carlson.org



 Danny Dias wrote:

 Hello John,

  What i am asking is if i can apply this patch manually or something like
 this without making any upgrade of Asterisk, has anyone done this before?

  I can't answer that question.



ummm why not? is something wrong?


  Or i have to upgrade my Asterisk versions...i don't really want to do
 this...

  Why not? MANY fixes have been included in the upgrades.
 Improved security at the least. There are 10-15 versions between where you
 are operating and what is current


I'm sure that the upgrade will fix this, but if applying the patch without
making any upgrade will be better for me, my asterisk servers are working
with many calls, realtime, fop etc...and an upgrade could make something
happen...


 John Novack


  Thanks in Advance!

 2010/11/22 John Novack jnov...@stromberg-carlson.org

 Hasn't this been fixed in later versions?
 1.4.37 is current, or at least it was in the last few days.

 Upgrading with no reason isn't suggested, but in this case you have a good
 reason, and if you dig deep enough you may find the fix is already in place.

 John Novack



 Danny Dias wrote:

 Hello Asterisk community,

 We are having some problems with crashes in Asterisk, my asterisk
 versions are 1.4.24.1 and 1.4.23.2. I have found this:

 ~/work/asterisk-branch-1.4$ svn log -c 260345
 
 r260345 | mmichelson | 2010-04-30 22:08:15 +0200 (Fri, 30 Apr 2010) | 18
 lines

 Fix potential crash from race condition due to accessing channel data
 without the channel locked.

 In res_musiconhold.c, there are several places where a channel's
 stream's existence is checked prior to calling ast_closestream on it. The
 issue
 here is that in several cases, the channel was not locked while checking
 the
 stream. The result was that if two threads checked the state of the
 channel's
 stream at approximately the same time, then there could be a situation
 where
 both threads attempt to call ast_closestream on the channel's stream. The
 result
 here is that the refcount for the stream would go below 0, resulting in a
 crash.

 I have added proper channel locking to res_musiconhold.c to ensure that
 we do not try to check chan-stream without the channel locked. A
 Digium customer has been using this patch for several weeks and has not
  had any crashes since applying the patch.

 ABE-2147
 

 How can i apply this patch on my asterisk versions: 1.4.24.1 and
 1.4.23.2? do i have to apply this patch manually?

 Thanks in advance for your help




 --

  Dog is my Co-pilot




 --
 Ing. Danny Dias
 www.DannTEL.net


 --

 Dog is my Co-pilot




-- 
Ing. Danny Dias
www.DannTEL.net
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread Danny Nicholas
Application of a patch to any one-or-more-off version of asterisk can be a
Russian roulette proposition; If you're applying 1-off you're pretty
safe.  The more versions between the patch and where you are, the more
bullets you are loading into the gun.

 

The best (IMO) procedure for this or any other 'more-than-1-off' patch you
want to apply is

#1. create a backup copy of the module you're patching

#2  apply the patch

#3  do a native gcc compile of the module for any obvious gotcha's

#4  if nothing happened in step 3,  do your make and make install on
asterisk to install the patch and check it out.

#5  if it works, you're done, if not, put the file back from the backup in
step 1 and repeat step 4.

 

FWIW

Danny Nicholas

 

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] res_musiconhold.c Bug - Patch to solve?

2010-11-22 Thread Mark Deneen
On Mon, Nov 22, 2010 at 9:50 AM, Danny Dias ing.diasda...@gmail.com wrote:
 2010/11/22 John Novack jnov...@stromberg-carlson.org


 Danny Dias wrote:

 Hello John,
 What i am asking is if i can apply this patch manually or something like
 this without making any upgrade of Asterisk, has anyone done this before?

 I can't answer that question.


 ummm why not? is something wrong?


 Or i have to upgrade my Asterisk versions...i don't really want to do
 this...

 Why not? MANY fixes have been included in the upgrades.
 Improved security at the least. There are 10-15 versions between where you
 are operating and what is current


 I'm sure that the upgrade will fix this, but if applying the patch without
 making any upgrade will be better for me, my asterisk servers are working
 with many calls, realtime, fop etc...and an upgrade could make something
 happen...

I would look at a svn diff between the two revisions and see how
different they are.

-M

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users