This is the mail archive of the cygwin mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12

> 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


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 ...
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:
Unsubscribe info:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]