diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-08 19:52:03 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-10-08 19:52:03 +0000 |
commit | 5b989dda451bc094fdadb128c7e6fa0cc539f776 (patch) | |
tree | c18794d3935ff2321152d75fd8603bb8d9830f5e /main/frame.c | |
parent | 50fe660be860997026e963d3e397d918da303dc4 (diff) |
Merged revisions 222878 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r222878 | russell | 2009-10-08 14:45:47 -0500 (Thu, 08 Oct 2009) | 44 lines
Make filestream frame handling safer by isolating frames before returning them.
This patch is related to a number of issues on the bug tracker that show
crashes related to freeing frames that came from a filestream. A number of
fixes have been made over time while trying to figure out these problems, but
there re still people seeing the crash. (Note that some of these bug reports
include information about other problems. I am specifically addressing
the filestream frame crash here.)
I'm still not clear on what the exact problem is. However, what is _very_
clear is that we have seen quite a few problems over time related to unexpected
behavior when we try to use embedded frames as an optimization. In some cases,
this optimization doesn't really provide much due to improvements made in other
areas.
In this case, the patch modifies filestream handling such that the embedded frame
will not be returned. ast_frisolate() is used to ensure that we end up with a
completely mallocd frame. In reality, though, we will not actually have to malloc
every time. For filestreams, the frame will almost always be allocated and freed
in the same thread. That means that the thread local frame cache will be used.
So, going this route doesn't hurt.
With this patch in place, some people have reported success in not seeing the
crash anymore.
(SWP-150)
(AST-208)
(ABE-1834)
(issue #15609)
Reported by: aragon
Patches:
filestream_frisolate-1.4.diff2.txt uploaded by russell (license 2)
Tested by: aragon, russell
(closes issue #15817)
Reported by: zerohalo
Tested by: zerohalo
(closes issue #15845)
Reported by: marhbere
Review: https://reviewboard.asterisk.org/r/386/
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222880 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/frame.c')
-rw-r--r-- | main/frame.c | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/main/frame.c b/main/frame.c index 7b8a3cc9f..1b8dead2a 100644 --- a/main/frame.c +++ b/main/frame.c @@ -336,8 +336,6 @@ static void __frame_free(struct ast_frame *fr, int cache) ast_translate_frame_freed(fr); } else if (ast_test_flag(fr, AST_FRFLAG_FROM_DSP)) { ast_dsp_frame_freed(fr); - } else if (ast_test_flag(fr, AST_FRFLAG_FROM_FILESTREAM)) { - ast_filestream_frame_freed(fr); } if (!fr->mallocd) @@ -426,7 +424,6 @@ struct ast_frame *ast_frisolate(struct ast_frame *fr) } else { ast_clear_flag(fr, AST_FRFLAG_FROM_TRANSLATOR); ast_clear_flag(fr, AST_FRFLAG_FROM_DSP); - ast_clear_flag(fr, AST_FRFLAG_FROM_FILESTREAM); out = fr; } |