public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* nl_langinfo returning null?
@ 2010-04-09 20:25 Charles Wilson
  2010-04-09 21:16 ` Corinna Vinschen
  0 siblings, 1 reply; 6+ messages in thread
From: Charles Wilson @ 2010-04-09 20:25 UTC (permalink / raw)
  To: cygwin

I've noticed that bsdtar.exe has been coredumping occasionally. I've
tracked it down to a behavioral change in recent cygwin DLLs.  This line
in bsdtar.c:

          bsdtar->day_first = (*nl_langinfo(D_MD_ORDER) == 'd');

causes a segfault, because nl_langinfo returns null.  However, according
to POSIX:

http://www.opengroup.org/onlinepubs/009695399/functions/nl_langinfo.html:

"In a locale where langinfo data is not defined, nl_langinfo() shall
return a pointer to the corresponding string in the POSIX locale. In all
locales, nl_langinfo() shall return a pointer to an empty string if item
contains an invalid setting."

Now, this doesn't always happen; I only see it when I run bsdtar.exe in
mintty, but not if I run it in rxvt-unicode, rxvt, cmd/bash, ...

So, it seems to be a weird interaction with something mintty is doing,
and the i18n stuff, but...regardless, cygwin's nl_langinfo() should
never return null.

FWIW, I've put a workaround in bsdtar.c, and will be uploading a new
version shortly.

--
Chuck

--
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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-04-10  5:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-09 20:25 nl_langinfo returning null? Charles Wilson
2010-04-09 21:16 ` Corinna Vinschen
2010-04-09 21:26   ` Corinna Vinschen
2010-04-10  0:05     ` Charles Wilson
2010-04-10  5:15       ` Christopher Faylor
2010-04-10  5:22       ` Charles Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).