Date: Fri, 18 Nov 2005 11:53:07 +0100 From: Corinna Vinschen To: newlib AT sources DOT redhat DOT com Cc: cygwin AT cygwin DOT com Subject: Re: Core dump calling strptime() Message-ID: <20051118105307.GC3462@calimero.vinschen.de> Reply-To: newlib AT sources DOT redhat DOT com Mail-Followup-To: newlib AT sources DOT redhat DOT com, cygwin AT cygwin DOT com References: <437D8A59 DOT 3020200 AT pobox DOT com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <437D8A59.3020200@pobox.com> User-Agent: Mutt/1.4.2i Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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 > > 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/