[Asterisk-Dev] Re: The '%' char and vs[n]printf at logger.c
Tony Mountifield
tony at softins.clara.co.uk
Tue May 31 06:34:23 MST 2005
In article <429C622C.2060803 at inaccessnetworks.com>,
Michael Manousos <manousos at inaccessnetworks.com> wrote:
>
> I'm getting spurious crashes of Asterisk (stable) all with the following
> backtrace:
>
> #0 0xb7e1550d in vfprintf () from /lib/libc.so.6
> #1 0xb7e11cf3 in vfprintf () from /lib/libc.so.6
> #2 0xb7e3064c in vsnprintf () from /lib/libc.so.6
> #3 0x08053e03 in ast_log (level=5, file=0x80cd439 "logger.c", line=645,
> function=0x80cd4e8 "ast_verbose",
> fmt=0x80eeaa0 " -- Executing GotoIf(\"SIP/xxxxxxxx\",
> \"0?unauthenticated|%232107788861|1\") in new stack\n") at logger.c:562
> #4 0x0805406e in ast_verbose (fmt=0x80d5be0 " -- Executing
> %s(\"%s\", \"%s\") %s\n") at logger.c:645
> #5 0x0807d3a4 in pbx_extension_helper (c=0xb50a4d78, context=0xb50a4ed0
> "XXXXXXXX", exten=0xb50a4fc4 "%232107788861", priority=2,
> callerid=0xb50a4fc4 "%232107788861", action=-1107306556) at utils.h:20
> #6 0x080773ab in ast_pbx_run (c=0xb50a4d78) at pbx.c:1757
> #7 0x0807da81 in pbx_thread (data=0xbdff6710) at pbx.c:1980
> #8 0xb7f9adfe in pthread_start_thread () from /lib/libpthread.so.0
> #9 0xb7e899aa in clone () from /lib/libc.so.6
>
> The backtrace looked too weird until I noticed that there is a '%' char
> at the format argument, passed to vsnprintf, without the intension to
> act as a conversion specifier (it is just the number called by a SIP
> user). I'm not able to duplicate the crash on a different box but it
> seems as a bug to me.
Hi Michael,
That must be an old version you are using on that box.
The bug was fixed in -stable on 27 Dec 2004:
[root at softins asterisk]# cvs diff -r1.45.2.2 -r1.45.2.3 logger.c | less
Index: logger.c
===================================================================
RCS file: /usr/cvsroot/asterisk/logger.c,v
retrieving revision 1.45.2.2
retrieving revision 1.45.2.3
diff -u -r1.45.2.2 -r1.45.2.3
--- logger.c 15 Nov 2004 02:30:32 -0000 1.45.2.2
+++ logger.c 27 Dec 2004 22:34:25 -0000 1.45.2.3
@@ -649,7 +649,7 @@
} /* else
fprintf(stdout, stuff + opos); */
- ast_log(LOG_VERBOSE, stuff);
+ ast_log(LOG_VERBOSE, "%s", stuff);
if (fmt[strlen(fmt)-1] != '\n')
replacelast = 1;
[root at softins asterisk]#
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
More information about the asterisk-dev
mailing list