delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/08/25/06:03:58

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:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; q=dns; s=default; b=uc/WgkuKZJ2c4jHzCT4ZexQD1qET
xcHQ0dvfNBdNvcSLrF7mDFpip/F6dVq7WMDCKoelHVGycehl9b8jsQV5eKiLkM4H
0j2V6QzbbhPZ5nLu442EnXERDQsBLYP7Pi1UlWkWzZgsv64lmqmfzUEa9WFjxEGj
de3wPVBrYp1Nzm8=
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:content-type:mime-version:subject:from
:in-reply-to:date:content-transfer-encoding:message-id
:references:to; s=default; bh=UFrjQMie0vCYBNy/qWIlfXX6dfI=; b=UQ
Zp8R5V57E+1ZLD1f17hnUtLuGBnBo0mhpLzjCtgpCTtOVTymEKBgIsXLRN06NQsR
w9A0FnWkSfMysw623didXx2ewC+z6RtDeDbxwmbIBqOBls4g8kAIX0nv5eP/tFt/
vSwPU1MxQyKdSf0OijmKYZaW51A5m/58kxy4P2k38=
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
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 spammy=$0x1, movzbl, H*r:ip*192.168.0.11, H*F:U*cygwin
X-HELO: smtp5-g21.free.fr
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
Subject: Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12
From: Denis Excoffier <cygwin AT Denis-Excoffier DOT org>
In-Reply-To: <20160824172057.GB9783@calimero.vinschen.de>
Date: Thu, 25 Aug 2016 12:03:25 +0200
Message-Id: <C5F0D698-B091-4F7E-92B3-1268A776338C@Denis-Excoffier.org>
References: <announce DOT 20160823165646 DOT GB2261 AT calimero DOT vinschen DOT de> <3C55C207-0928-4835-84EE-B0F34FAAD647 AT Denis-Excoffier DOT org> <20160824172057 DOT GB9783 AT calimero DOT vinschen DOT de>
To: cygwin AT cygwin DOT com
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id u7PA3pw9020926

> On 2016-08-24 19:20, Corinna Vinschen wrote:
> 
> Thanks for the report and especially for providing a testcase!
> 
Hello Corinna,

Please find hereafter another testcase (from file-5.28).

Of course, if the uselocale() function is not used, everything is ok.
The problem seems to occur because of the braces.

I use 2.6.0-0.12 under CYGWIN_NT-6.1-WOW, with your fix to __localeconv_l
(https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;a=commitdiff;h=a703d64ad7edac344e4959e8d624ce1d8012678b)

Regards,

Denis Excoffier.


% cat gugu.c
#include <stdio.h>
#include <locale.h>
#include <regex.h>

int main() {
//
  locale_t locale = newlocale (LC_ALL_MASK, "C", (locale_t) 0);
  if (!locale) return 1;
  locale_t old = uselocale (locale);
  if (!old) return 1;
  //
  char const *pattern[] = { "a", "a{2}" };
  regex_t regex;
  for ( int i = 0 ; i < 2 ; ++i ) {
    printf ("pattern=%s ...\n", pattern[i]);
    regcomp (&regex, pattern[i], REG_EXTENDED);
    printf ("re_nsub=%d\n", regex.re_nsub);
    regfree (&regex);
  };
  return 0;
};
% ./gugu
pattern=a ...
re_nsub=0
pattern=a{2} ...
Segmentation fault (core dumped)
% cat gugu.exe.stackdump
Exception: STATUS_ACCESS_VIOLATION at eip=610B764E
eax=00000000 ebx=0028CBB0 ecx=00000032 edx=00403065 esi=00000001 edi=00000000
ebp=00403068 esp=0028CB10 program=D:\Users\dexcoff1\dexcoff1\cygscf\gugu.exe, pid 22300, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame     Function  Args
00403068  610B764E (2073253D, 0A2E2E2E, 5F657200, 6275736E)
End of stack trace
% objdump -d /usr/bin/cygwin1.dll
...
610b7400 <_p_ere>:
...
610b762e: 66 90                 xchg   %ax,%ax
610b7630: 3c 7b                 cmp    $0x7b,%al
610b7632: 0f 85 08 fe ff ff     jne    610b7440 <_p_ere+0x40>
610b7638: 8d 42 01              lea    0x1(%edx),%eax
610b763b: 39 c5                 cmp    %eax,%ebp
610b763d: 0f 86 fd fd ff ff     jbe    610b7440 <_p_ere+0x40>
610b7643: e8 08 7c 09 00        call   6114f250 <___locale_ctype_ptr>
610b7648: 8b 13                 mov    (%ebx),%edx
610b764a: 0f b6 4a 01           movzbl 0x1(%edx),%ecx
610b764e: f6 44 08 01 04        testb  $0x4,0x1(%eax,%ecx,1)
610b7653: 0f 84 87 02 00 00     je     610b78e0 <_p_ere+0x4e0>
610b7659: 83 c2 01              add    $0x1,%edx
610b765c: 85 ff                 test   %edi,%edi
610b765e: 89 13                 mov    %edx,(%ebx)
610b7660: 0f 84 e8 00 00 00     je     610b774e <_p_ere+0x34e>
%


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