aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-08 19:54:20 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2009-10-08 19:54:20 +0000
commit5477b9bfa32e0551a72576c4c75a453d64dd1204 (patch)
tree3b4c74c3b34b61527cc913c52fac7383d9c44a28 /include/asterisk
parent3098c0182f1c152c573ce964bfbb1b3318af7725 (diff)
Merged revisions 222880 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r222880 | russell | 2009-10-08 14:52:03 -0500 (Thu, 08 Oct 2009) | 51 lines 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/branches/1.6.0@222881 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include/asterisk')
-rw-r--r--include/asterisk/file.h15
-rw-r--r--include/asterisk/frame.h4
2 files changed, 0 insertions, 19 deletions
diff --git a/include/asterisk/file.h b/include/asterisk/file.h
index ed75c1f9b..0f33b5340 100644
--- a/include/asterisk/file.h
+++ b/include/asterisk/file.h
@@ -315,21 +315,6 @@ off_t ast_tellstream(struct ast_filestream *fs);
*/
struct ast_frame *ast_readframe(struct ast_filestream *s);
-/*!\brief destroy a filestream using an ast_frame as input
- *
- * This is a hack that is used also by the ast_trans_pvt and
- * ast_dsp structures. When a structure contains an ast_frame
- * pointer as one of its fields. It may be that the frame is
- * still used after the outer structure is freed. This leads to
- * invalid memory accesses. This function allows for us to hold
- * off on destroying the ast_filestream until we are done using
- * the ast_frame pointer that is part of it
- *
- * \param fr The ast_frame that is part of an ast_filestream we wish
- * to free.
- */
-void ast_filestream_frame_freed(struct ast_frame *fr);
-
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
diff --git a/include/asterisk/frame.h b/include/asterisk/frame.h
index 9d90a083f..b1e7344d2 100644
--- a/include/asterisk/frame.h
+++ b/include/asterisk/frame.h
@@ -134,10 +134,6 @@ enum {
* The dsp cannot be free'd if the frame inside of it still has
* this flag set. */
AST_FRFLAG_FROM_DSP = (1 << 2),
- /*! This frame came from a filestream and is still the original frame.
- * The filestream cannot be free'd if the frame inside of it still has
- * this flag set. */
- AST_FRFLAG_FROM_FILESTREAM = (1 << 3),
};
/*! \brief Data structure associated with a single frame of data