X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:reply-to:cc:from :message-id:date:mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=KgGYXvSprmOzK2TK PQSLfSQT3F+EvOfKdab/sSfpMFIah9FKv8C9BFmYYKQrYEOL1WXbJGZxFD/3fuX6 nR1JFi3eH7PlSOdJVrG23nO4CepmlPN6kOlgNY75PH3OBwAmP3A5vqej/XxooGZT iJwx6Mt+3WprBgQ8rIRo6pza4sc= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:reply-to:cc:from :message-id:date:mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=iS5ShYCF5WLIBlbO5DIxVg /IgXc=; b=vTsa8qVpfPidlRHu9XZ36bgXizb5J0/A7TYYjZ7N19auWLyt/6kunC 0nUeSd0PAZ+AImFhdN00ZzeWjbGUPvMXMJc86zZtYa5fjgFQ290TTs6nHEx4RYJD JH62GLufQ+pgGwBHqft9nUqBzJYYPOmVa8q5l9PsfezDnO/Nk3Dl4= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: 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 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 X-HELO: out1-smtp.messagingengine.com Subject: Re: Seg Fault in strftime To: cygwin AT cygwin DOT com References: Reply-To: cygwin AT cygwin DOT com Cc: mike AT kmcardiff DOT com From: Jon TURNEY Message-ID: <55BB6F59.8060905@dronecode.org.uk> Date: Fri, 31 Jul 2015 13:51:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 31/07/2015 01:16, Michael Enright wrote: > The tznam is set from the tmzone member and when this happens that > member is garbage. This member is garbage POSSIBLY because of a > configuration option in libmozjs. The calling code is in prmjtime.cpp > fills in a struct tm from Spidermonkey's own broken-down time > structure, 'a', and then if the configuration enables, it makes > *another* struct tm with more fields filled in in order to get > a.tm_zone's proper value. My guess is that the path is not enabled but > the bits delivered to me do not disclose whether this righteous code > path is enabled. __cygwin_gettzname is evidently compiled to expect > the tm_zone member to exist because GDB shows it does exist. Thanks for this investigation and analysis. > So did any aspect of this change recently? The application and library > were getting along okay before I did cygwin updates. The last time I > had tried to run this code was early June, at which time I was running > it dozens of times a day. [1] looks like a highly relevant change and [2] is the associated discussion It would be very helpful if you could tweak the testcase there and produce one which reproduces your problem. [1] https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commitdiff;h=75d5f68aabf62c42884ff935f888b12bbcd00001 [2] https://sourceware.org/ml/newlib/2015/msg00321.html > Also it appears that the tm_zone member is an extension. I haven't > been able to find POSIX guidance about how applications are supposed > use struct tm in compliance in the presence of implementation-defined > fields. POSIX example code shows a usage that does access the 'at > least' fields. The language allows for implementation-defined fields. > No mechanism is provided within POSIX to allow an application to > discover additional fields and take care of them. It seems to me that > an application can then assume that when it provides a struct tm as > input, filling in the time and date reasonably, it is always > sufficient to fill in the 'at least' fields and the implementation is > the one who has to assume that the rest of the fields might not be > filled in. Yeah, this seems a bit of an under-specified area. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple