delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/09/16:25:33

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,RCVD_IN_DNSWL_LOW,TW_RX
X-Spam-Check-By: sourceware.org
Message-ID: <4BBF8D1B.3010203@cwilson.fastmail.fm>
Date: Fri, 09 Apr 2010 16:24:59 -0400
From: Charles Wilson <cygwin AT cwilson DOT fastmail DOT fm>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.23) Gecko/20090812 Thunderbird/2.0.0.23 Mnenhy/0.7.6.666
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: nl_langinfo returning null?
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019