Core dump calling strptime()
Corinna Vinschen
corinna-cygwin@cygwin.com
Fri Nov 18 12:56:00 GMT 2005
On Nov 18 00:01, David Arnstein wrote:
> Here is a very short test program that causes a "core dump." Please
> compile it using the command
> gcc -Wall testspt.c -o testspt
>
> Run the resulting executable testspt.exe with no arguments. Core dump
> ensues.
>
> The attached file cygcheck.out is the output from the command
> cygcheck -s -v -r
> from the computer where I compiled and executed testspt.exe.
>
> In case anyone cares, I get this problem when I compile and use
> newsyslog in Cygwin. Newsyslog calls strptime() several times on the
> same message string, trying to find a parsing method that it recognizes.
> It is to be expected that strptime() will fail often, but it is NOT
> reasonable to core dump, in my opinion.
>
> File testspt.c:
> --------------
> #include <time.h>
>
> int main (int argc, char* argv[])
> {
> char* retval;
> struct tm tms;
> char message[] =
> "INFO Nov 17 09:31:01 [67284]: Initializing tinyproxy ...";
>
> retval = strptime (message, "%c", &tms);
>
> return 0;
> }
This is a newlib problem. I've redirected to the newlib mailing list
and set the reply-to accordingly.
Newlib's strptime function doesn't implement the 'c' and the 'Z'(*)
format specifiers. If it encounters one of the non-implemented format
specifiers it calls the abort() function which then results in the core
dump.
I guess patches are thoughtfully considered on the newlib list ;-)
Corinna
(*) Z? I don't see this format specifier defined on Linux, nor in the
SUSv3 man pages. What's its job?
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Project Co-Leader cygwin AT cygwin DOT com
Red Hat, Inc.
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list