public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12
@ 2016-08-24 10:05 Corinna Vinschen
  2016-08-24 17:27 ` Denis Excoffier
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2016-08-24 10:05 UTC (permalink / raw)
  To: cygwin

Hi folks,


I uploaded a new Cygwin test release 2.6.0-0.12.

Two interesting changes in this test release:

- Add missing POSIX function strerror_l.

- Add missing GNU extensions strptime_l and wcsftime_l.

- Add GNU extensions pthread_getname_np and pthread_setname_np.

=======================================================================

The 2.6.0 release is going to introducing the locale_t datatype, as well
as all functions related to locale_t locales and per-thread locales per
POSIX-1.2008.

So, rather than just providing a single, per-process locale, you can now
create new locales ("newlocale") and set it as locale for the current
thread ("uselocale") or use it directly with one of the new functions
taking a locale_t as parameter (i.e. isalpha_l).

Since this is brand-new code, this code *will* have bugs.

It would be very helpful if interested developers and Cygwin package
maintainers could give this new stuff some good testing.

Other than that:

=======================================================================

What's new:
-----------

- Support for POSIX-1.2008 locale objects and per-thread locales.

  New API per POSIX-1.2008: newlocale, freelocale, duplocale, uselocale,
  nl_langinfo_l, isalnum_l, isalpha_l, isblank_l, iscntrl_l, isdigit_l,
  isgraph_l, islower_l, isprint_l, ispunct_l, isspace_l, isupper_l, iswalnum_l,
  iswalpha_l, iswblank_l, iswcntrl_l, iswctype_l, iswdigit_l, iswgraph_l,
  iswlower_l, iswprint_l, iswpunct_l, iswspace_l, iswupper_l, iswxdigit_l,
  isxdigit_l, tolower_l, toupper_l, towctrans_l, towlower_l, towupper_l,
  wctrans_l, wctype_l, strcasecmp_l, strcoll_l, strerror_l, strfmon_l,
  strftime_l, strncasecmp_l, strxfrm_l, wcscasecmp_l, wcscoll_l,
  wcstrncasecmp_l, wcstrxfrm_l.

  New API, GNU extensions: isascii_l, toascii_l, strptime_l, strtod_l,
  strtof_l, strtol_l, strtold_l, strtoll_l, strtoul_l, strtoull_l, wcsftime_l,
  wcstod_l, wcstof_l, wcstol_l, wcstold_l, wcstoll_l, wcstoul_l, wcstoull_l.

- locale(1) now supports a -i/--input option to fetch the current input
  locale (this is basically equivalent to the current keyboard layout setting).

- New API: pthread_getname_np, pthread_setname_np.


What changed:
-------------

- Drop support for Windows XP and Windows Server 2003/2003 R2.

- Drop support for very old SUNWNFS filesystem.

- Further header file improvements in terms of feature test macros.

- Raise number of supported partitions per disk (for raw access) to 63.
  Addresses: https://cygwin.com/ml/cygwin/2016-06/msg00136.html

- Add a workaround for filesystems not supporting the FileAllInformation
  info class.
  Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00350.html

- Support AzureAD accounts.

- "nobody" account support for WinFSP.


Bug Fixes
---------

- Try to avoid spurious DENY ACEs when creating files in directories
  with non-POSIX-like (rather: Windows-like) permissions.
  Addresses: Report and reproducer on IRC.

- Make sure ldd(1) does not exit prematurely when enumerating DLLs.
  Addresses: https://cygwin.com/ml/cygwin/2016-05/msg00185.html

- Fix strace timer output in child process.
  Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00067.html

- Change blkcnt_t to signed type per POSIX.

- Fix definition of SSIZE_MAX on 32-bit systems.
  Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00179.html

- Fix transposing invalid chars in Windows filenames on relative paths.
  Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00193.html

- Don't raise SIGTTIN from select(2)/poll(2).
  Addresses: https://cygwin.com/ml/cygwin-developers/2016-07/msg00004.html

- Fix truncl which was using the wrong FPU rounding mode.
  Addresses: https://rt.perl.org/Public/Bug/Display.html?id=128665

- Fix a regression in ioctl(fd, FIONREAD, ...) introduced in Cygwin 2.5.0.
  This only affects 64 bit Cygwin.
  Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00001.html

- Handle "clear screen" escpae sequence in console window more reliable.
  Addresses: https://cygwin.com/ml/cygwin/2016-07/msg00310.html

- Allow kill(pid, <anysig>) on zombies to return successfully, rather than
  only kill(pid, 0), to align behaviour with POSIX requirements.
  Addresses: https://cygwin.com/ml/cygwin/2016-08/msg00188.html

=======================================================================


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--
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] 5+ messages in thread

* Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12
  2016-08-24 10:05 [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12 Corinna Vinschen
@ 2016-08-24 17:27 ` Denis Excoffier
  2016-08-24 17:30   ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Excoffier @ 2016-08-24 17:27 UTC (permalink / raw)
  To: The Cygwin Mailing List


> On 2016-08-23 18:56, Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> 
> I uploaded a new Cygwin test release 2.6.0-0.12.
> 
...
> The 2.6.0 release is going to introducing the locale_t datatype, as well
> as all functions related to locale_t locales and per-thread locales per
> POSIX-1.2008.
> 
> So, rather than just providing a single, per-process locale, you can now
> create new locales ("newlocale") and set it as locale for the current
> thread ("uselocale") or use it directly with one of the new functions
> taking a locale_t as parameter (i.e. isalpha_l).
> 
> Since this is brand-new code, this code *will* have bugs.
> 
> It would be very helpful if interested developers and Cygwin package
> maintainers could give this new stuff some good testing.
> 

Hello,

I have exercised the new locale-related code and think i found a problem
in the strtod_l function (see small test case in gugu.c below).

I use 2.6.0-0.12 under CYGWIN_NT-6.1-WOW.

Remarks:
- the value given in nptr (1.5) has no impact, even an integer value fails
- uncomment the first line in order to silence the warning at compile time
- the problem was originally found in coreutils-8.25: "seq -w 1 10" produces
the same segmentation fault. In order to reproduce this, you must have
coreutils compiled under a recent cygwin1.dll otherwise the strtod_l
part of the coreutils code is not selected.

Regards,

Denis Excoffier.

% cat gugu.c
//#define _GNU_SOURCE 1
#include <stdio.h>
#include <locale.h>
#include <stdlib.h>

//
int main() {
//
  locale_t locale = newlocale (LC_ALL_MASK, "C", (locale_t) 0);
  if (!locale) return 1;
  char const *nptr = "1.5";
  char **endptr;
  double r1 = strtod (nptr, endptr);
  fprintf (stderr, "r1=%f\n", r1);
  double r2 = strtod_l (nptr, endptr, locale);
  fprintf (stderr, "r2=%f\n", r2);
  return 0;
};
% gcc -O -o gugu gugu.c
gugu.c: In function 'main':
gugu.c:15:15: warning: implicit declaration of function 'strtod_l' [-Wimplicit-function-declaration]
   double r2 = strtod_l (nptr, endptr, locale);
               ^~~~~~~~
% ./gugu
r1=1.500000
Segmentation fault (core dumped)
% cat gugu.exe.stackdump
Exception: STATUS_ACCESS_VIOLATION at eip=6114F2E8
eax=61213530 ebx=6121B0C0 ecx=6121B0D0 edx=6121B040 esi=00000000 edi=61213440
ebp=0028CC88 esp=0028CB68 program=D:\Users\dexcoff1\dexcoff1\cygscf\gugu.exe, pid 61032, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame     Function  Args
0028CC88  6114F2E8 (00000001, 0028CCAC, 80010108, 61007B0A)
0028CD28  61007B6F (00000000, 0028CD84, 61006BA0, 00000000)
End of stack trace
% objdump -d /usr/bin/cygwin1.dll
...
6114f2d0 <___localeconv_l>:
6114f2d0: 53                    push   %ebx
6114f2d1: 8b 44 24 08           mov    0x8(%esp),%eax
6114f2d5: 8b 88 48 01 00 00     mov    0x148(%eax),%ecx
6114f2db: 8b 90 40 01 00 00     mov    0x140(%eax),%edx
6114f2e1: 05 f0 00 00 00        add    $0xf0,%eax
6114f2e6: 8b 19                 mov    (%ecx),%ebx
6114f2e8: 89 18                 mov    %ebx,(%eax)
6114f2ea: 8b 59 04              mov    0x4(%ecx),%ebx
6114f2ed: 8b 49 08              mov    0x8(%ecx),%ecx
6114f2f0: 89 58 04              mov    %ebx,0x4(%eax)
6114f2f3: 89 48 08              mov    %ecx,0x8(%eax)
...
%


--
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] 5+ messages in thread

* Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12
  2016-08-24 17:27 ` Denis Excoffier
@ 2016-08-24 17:30   ` Corinna Vinschen
  2016-08-25 12:45     ` Denis Excoffier
  0 siblings, 1 reply; 5+ messages in thread
From: Corinna Vinschen @ 2016-08-24 17:30 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 3006 bytes --]

Hi Denis,

On Aug 24 18:07, Denis Excoffier wrote:
> > On 2016-08-23 18:56, Corinna Vinschen <corinna-cygwin@cygwin.com> wrote:
> > 
> > I uploaded a new Cygwin test release 2.6.0-0.12.
> > 
> ...
> > The 2.6.0 release is going to introducing the locale_t datatype, as well
> > as all functions related to locale_t locales and per-thread locales per
> > POSIX-1.2008.
> > 
> > So, rather than just providing a single, per-process locale, you can now
> > create new locales ("newlocale") and set it as locale for the current
> > thread ("uselocale") or use it directly with one of the new functions
> > taking a locale_t as parameter (i.e. isalpha_l).
> > 
> > Since this is brand-new code, this code *will* have bugs.
> > 
> > It would be very helpful if interested developers and Cygwin package
> > maintainers could give this new stuff some good testing.
> > 
> 
> Hello,
> 
> I have exercised the new locale-related code and think i found a problem
> in the strtod_l function (see small test case in gugu.c below).
> [...]
> % cat gugu.c
> //#define _GNU_SOURCE 1
> #include <stdio.h>
> #include <locale.h>
> #include <stdlib.h>
> 
> //
> int main() {
> //
>   locale_t locale = newlocale (LC_ALL_MASK, "C", (locale_t) 0);
>   if (!locale) return 1;
>   char const *nptr = "1.5";
>   char **endptr;
>   double r1 = strtod (nptr, endptr);
>   fprintf (stderr, "r1=%f\n", r1);
>   double r2 = strtod_l (nptr, endptr, locale);
>   fprintf (stderr, "r2=%f\n", r2);
>   return 0;
> };

Uhm... your testcase has two problems:

- _GNU_SOURCE *must* be defined to get the declaration of strtod_l.  You
  can't just omit it.  The warning is serious.  By missing out on the
  declaration the compiler assumes all arguments are of type int.

- The usage of endptr is wrong.  Here's how you do it:

    char *endptr;
    strtod (nptr, &endptr);

  strtod and friends expect endptr to be a pointer to a char *
  which it changes to point to the end of the converted string.
  By giving an uninitialized char ** to strtod, it will write
  the result into a random location.

However, fixing that doesn't avoid the crash in Cygwin, of course.  I
see where the problem is.  The structure used for the "C" locale is
const.  On the other hand, the struct also contains the lconv struct
which gets overwritten by __localeconv_l.  So for the "C" locale this
tries to write into a R/O memory region.

However, since the "C" locale is fixed *and* its lconv is already
initialized, there's no reason at all for __localeconv_l to overwrite
it.

I'll apply a fix to __localeconv_l to just return its lconv without
attempting to write its values when using the "C" locale structure
and upload a -0.13 test release shortly.

Thanks for the report and especially for providing a testcase!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

* Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12
  2016-08-24 17:30   ` Corinna Vinschen
@ 2016-08-25 12:45     ` Denis Excoffier
  2016-08-25 13:16       ` Corinna Vinschen
  0 siblings, 1 reply; 5+ messages in thread
From: Denis Excoffier @ 2016-08-25 12:45 UTC (permalink / raw)
  To: cygwin


> 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

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

* Re: [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12
  2016-08-25 12:45     ` Denis Excoffier
@ 2016-08-25 13:16       ` Corinna Vinschen
  0 siblings, 0 replies; 5+ messages in thread
From: Corinna Vinschen @ 2016-08-25 13:16 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 925 bytes --]

Hi Denis,

On Aug 25 12:03, Denis Excoffier wrote:
> 
> > 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 just uploaded 2.6.0-0.13 with a fix.  The cause for the problem was
an unexpected NULL pointer in __C_locale.  I think the new solution
should not only fix this issue, but even be very slightly faster.

Thanks to Jon Turney for discussing the problem with me on the Freenode
IRC channel #cygwin-developers!

And thanks to you for testing this stuff!


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-08-25 12:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-24 10:05 [ANNOUNCEMENT] TEST RELEASE: Cygwin 2.6.0-0.12 Corinna Vinschen
2016-08-24 17:27 ` Denis Excoffier
2016-08-24 17:30   ` Corinna Vinschen
2016-08-25 12:45     ` Denis Excoffier
2016-08-25 13:16       ` Corinna Vinschen

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