This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Seg Fault in strftime
- From: Michael Enright <mike at kmcardiff dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 3 Aug 2015 08:52:25 -0700
- Subject: Re: Seg Fault in strftime
- Authentication-results: sourceware.org; auth=none
- References: <CAOC2fq9A1DSjy=7Af=wVCkNEsttpd4Fj-0w_nNwnSb76WFt5WA at mail dot gmail dot com> <loom dot 20150801T233913-448 at post dot gmane dot org> <CAOC2fq9Uv77EuBDBP=Eywht4DqmZZm05WPhnp4dU1V7cD+CE_g at mail dot gmail dot com> <20150803083634 dot GE17917 at calimero dot vinschen dot de> <CAOC2fq-xQh8ThcvJBOMkWMfz0Y7b7FnhuHgBLaLSufLQY4qXGA at mail dot gmail dot com> <20150803134223 dot GB18434 at calimero dot vinschen dot de>
On Mon, Aug 3, 2015 at 6:42 AM, Corinna Vinschen wrote:
> Hang on. So you suggest that Glibc, Cygwin, as well as any other
> implementation based on the localtime.c code from Arthur David Olson,
> stop using the additional struct members? Despite them doing the right
> thing where the POSIX implementation is lacking? Because there's one
> lib you need which doesn't work as expected, rather than rebuilding it
> with a matching fix? That doesn't sound overly convincing to me.
It's not just one library that I use that has tripped over this. My
brief research into workarounds led me to the glibc guys shrugging off
another project's report. I bet there has been plenty of time spent on
this on the application side that has not left a trail for me to find.
>
> Other than that, you didn't answer the question: How is a library
> supposed to know that the non-NULL pointer value is just garbage?
I think that is the wrong question. The problem is when there is
nothing telling anyone anything until something crashes. There is
nothing in the official documentation of the API to inform a user that
they must prepare the struct any particular way. There are two ways
the library would not find itself crashing from structs it didn't
like: Not use undocumented members that are pointers that can be
garbage, **OR** tell everyone how to initialize the structs, through
the POSIX spec or through man pages.
>
> I'm firmly with the GLibc guys here...
>
As far as I can tell the Glibc guys did not solve anyone's problem.
I'm interested in a solution at the libmozjs level and I'm interested
in getting struct tm in line with its documentation one way or the
other.
--
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