[Home]

Summary:ASTERISK-06309: not dumping core when run as non-root
Reporter:puzzled (puzzled)Labels:
Date Opened:2006-02-13 16:11:22.000-0600Date Closed:2006-02-13 20:08:48.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:On an RS6000 32bit PPC box I was never able to make Asterisk-1.2.x dump core. Used ulimit -c unlimited and started asterisk with asterisk -c -vvvv -dddd -g -U asterisk -G asterisk. On the openpbx-dev mailinglist a small patch was posted by Armin that would fix this. Perhaps this is needed for Asterisk too?

> --- openpbx/trunk/corelib/openpbx.c   2006-02-13 15:29:09 UTC (rev 1370)
> +++ openpbx/trunk/corelib/openpbx.c   2006-02-13 15:47:38 UTC (rev 1371)
> @@ -72,6 +72,7 @@
>  #include <grp.h>
>  #include <pwd.h>
>  #include <sys/stat.h>
> +#include <sys/prctl.h>
>  #include <regex.h>
>  
>  #if  defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS)
> @@ -2138,6 +2139,14 @@
>  
>  #endif
>  
> +     /* after set*id() the dumpable flag is deleted,
> +        so we set it again to get core dumps */
> +     if (option_dumpcore) {
> +             if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) == -1) {
> +                     opbx_log(LOG_ERROR, "Unable to set dumpable flag: %s\n", strerror(errno));
> +             }
> +     }
> +
>       opbx_term_init();
>       printf(opbx_term_end());
>       fflush(stdout);
Comments:By: BJ Weschke (bweschke) 2006-02-13 19:46:05.000-0600

Fixed in /trunk SVN r9844

By: BJ Weschke (bweschke) 2006-02-13 20:08:48.000-0600

merged with 1.2.x