Core dump calling strptime()

David Arnstein arnstein@pobox.com
Fri Nov 18 08:37:00 GMT 2005


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;
}
-- 
David Arnstein
arnstein@pobox.com
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20051118/f323262a/attachment.ksh>
-------------- next part --------------
--
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