Commit Graph

15 Commits

Author SHA1 Message Date
Sean Bright fd0ca1c3f9 Remove as much trailing whitespace as possible.
Change-Id: I873c1c6d00f447269bd841494459efccdd2c19c0
2017-12-22 09:23:22 -05:00
Corey Farrell 0bda39c668 DEBUG_FD_LEAKS: Add missing FD creators.
This adds FD tracking for the following functions:
* eventfd
* timerfd_create
* socketpair
* accept

ASTERISK-27404

Change-Id: Id6848fe904ade2d34eb39d2a20bd6b223e1111fc
2017-11-08 13:57:45 -05:00
Corey Farrell a6e5bae3ef Remove ASTERISK_REGISTER_FILE.
ASTERISK_REGISTER_FILE no longer has any purpose so this commit removes
all traces of it.

Previously exported symbols removed:
* __ast_register_file
* __ast_unregister_file
* ast_complete_source_filename

This also removes the mtx_prof static variable that was declared when
MTX_PROFILE was enabled.  This variable was only used in lock.c so it
is now initialized in that file only.

ASTERISK-26480 #close

Change-Id: I1074af07d71f9e159c48ef36631aa432c86f9966
2016-10-27 09:53:55 -04:00
Alexander Traud 0bf1a53db3 astfd: With RLIMIT_NOFILE only the current value is sensible.
With menuselect "DEBUG_FD_LEAKS" and CLI "core show fd", both the maximum max
and current max of possible file descriptors were shown. Both show the same
value always. Not to confuse users, just the current maximum is shown now.

ASTERISK-26097

Change-Id: I49cf7952d73aec9e3f6a88942842c39be18380fa
2016-06-10 10:13:20 +02:00
Alexander Traud 9200ad03a3 astfd: Adds a timestamp for each entry.
Now with menuselect "DEBUG_FD_LEAKS" and CLI "core show fd", a timestamp is
shown with each file descriptor. This helps to debug leaked UDP/TCP ports on
long-lived servers, for example.

ASTERISK-25405 #close

Change-Id: I968339e5155a512eba1032a5263f1ec8b5e1f80b
2015-09-19 19:52:36 +02:00
Walter Doekes 40274e3652 astfd: Fix buffer overflow in DEBUG_FD_LEAKS.
If DEBUG_FD_LEAKS was used and more file descriptors than the default of
1024 were available, some DEBUG_FD_LEAKS-patched functions would
overwrite memory past the fixed-size (1024) fdleaks buffer.

This change:
- adds bounds checks to __ast_fdleak_fopen and __ast_fdleak_pipe
- consistently uses ARRAY_LEN() instead of sizeof() or 1023 or 1024
- stores pointers to constants instead of copying the contents
- reorders the fdleaks struct for possibly tighter packing
- adds a tiny bit of documentation

ASTERISK-25212 #close

Change-Id: Iacb69e7701c0f0a113786bd946cea5b6335a85e5
2015-07-02 05:24:43 -05:00
Matt Jordan 4a58261694 git migration: Refactor the ASTERISK_FILE_VERSION macro
Git does not support the ability to replace a token with a version
string during check-in. While it does have support for replacing a
token on clone, this is somewhat sub-optimal: the token is replaced
with the object hash, which is not particularly easy for human
consumption. What's more, in practice, the source file version was often
not terribly useful. Generally, when triaging bugs, the overall version
of Asterisk is far more useful than an individual SVN version of a file. As a
result, this patch removes Asterisk's support for showing source file
versions.

Specifically, it does the following:

* Rename ASTERISK_FILE_VERSION macro to ASTERISK_REGISTER_FILE, and
  remove passing the version in with the macro. Other facilities
  than 'core show file version' make use of the file names, such as
  setting a debug level only on a specific file. As such, the act of
  registering source files with the Asterisk core still has use. The
  macro rename now reflects the new macro purpose.

* main/asterisk:
  - Refactor the file_version structure to reflect that it no longer
    tracks a version field.
  - Remove the "core show file version" CLI command. Without the file
    version, it is no longer useful.
  - Remove the ast_file_version_find function. The file version is no
    longer tracked.
  - Rename ast_register_file_version/ast_unregister_file_version to
    ast_register_file/ast_unregister_file, respectively.

* main/manager: Remove value from the Version key of the ModuleCheck
  Action. The actual key itself has not been removed, as doing so would
  absolutely constitute a backwards incompatible change. However, since
  the file version is no longer tracked, there is no need to attempt to
  include it in the Version key.

* UPGRADE: Add notes for:
  - Modification to the ModuleCheck AMI Action
  - Removal of the "core show file version" CLI command

Change-Id: I6cf0ff280e1668bf4957dc21f32a5ff43444a40e
2015-04-13 03:48:57 -04:00
Corey Farrell 3ddd92902a Replace most uses of ast_register_atexit with ast_register_cleanup.
Since 'core stop now' and 'core restart now' do not stop modules,
it is unsafe for most of the core to run cleanups.  Originally all
cleanups used ast_register_atexit, and were only changed when it
was shown to be unsafe.  ast_register_atexit is now used only when
absolutely required to prevent corruption and close child processes.

Exceptions that need to use ast_register_atexit:
* CDR: Flush records.
* res_musiconhold: Kill external applications.
* AstDB: Close the DB.
* canary_exit: Kill canary process.

ASTERISK-24142 #close
Reported by: David Brillert

ASTERISK-24683 #close
Reported by: Peter Katzmann

ASTERISK-24805 #close
Reported by: Badalian Vyacheslav

ASTERISK-24881 #close
Reported by: Corey Farrell

Review: https://reviewboard.asterisk.org/r/4500/
Review: https://reviewboard.asterisk.org/r/4501/
........

Merged revisions 433495 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 433497 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@433498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-26 22:24:26 +00:00
Kinsey Moore 63134ea011 Unregister CLI commands on exit
This patch ensures that CLI commands enabled by DEBUG_FD_LEAKS and
DEBUG_THREADLOCALS are cleaned up properly on exit.

(closes issue ASTERISK-22238)
Reported by: Corey Farrell
Tested by: Corey Farrell
Patches:
    debug_cli_unregister.patch uploaded by Corey Farrell
........

Merged revisions 397106 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 397107 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@397110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2013-08-20 15:36:10 +00:00
Andrew Latham fd98835f1f Doxygen Updates Janitor Work
* Whitespace, doc-blocks, spelling, case, missing and incorrect tags.
* Add cleanup to Makefile for the Doxygen configuration update
* Start updating Doxygen configuration for cleaner output
* Enable inclusion of configuration files into documentation
* remove mantisworkflow...
* update documentation README
* Add markup to Tilghman's email and talk with him about updating his email, he knows...
* no code changes on this commit other than the mentioned Makefile change

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@373384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-22 20:43:30 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Tilghman Lesher f03d56a84d On some platforms, O_RDONLY is not a flag to be checked, but merely the absence of O_RDWR and O_WRONLY.
The POSIX specification does not mandate how these 3 flags must be specified,
only that one of the three must be specified in every call.
........

Merged revisions 363209 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 363212 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-23 16:08:33 +00:00
David Vossel 71a29c3ffc Merged revisions 228338 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228338 | dvossel | 2009-11-06 09:41:41 -0600 (Fri, 06 Nov 2009) | 5 lines
  
  fixes crash in astfd.c
  
  (closes issue #15981)
  Reported by: slavon
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 15:42:46 +00:00
Tilghman Lesher 59aebb76b4 Merged revisions 211274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r211274 | tilghman | 2009-08-09 10:41:01 -0500 (Sun, 09 Aug 2009) | 2 lines
  
  Small oops.  Clear the flags which have been checked.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-09 15:42:02 +00:00
Tilghman Lesher 8f28bfc63e Merged revisions 187300-187301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187300 | tilghman | 2009-04-08 23:31:38 -0500 (Wed, 08 Apr 2009) | 3 lines
  
  Add debugging mode for diagnosing file descriptor leaks.
  (Related to issue #14625)
........
  r187301 | tilghman | 2009-04-08 23:32:40 -0500 (Wed, 08 Apr 2009) | 2 lines
  
  Oops, missed this file in the last commit.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 04:59:05 +00:00