diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 67daa209c7..558dbec973 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -58,6 +58,7 @@ jobs: owner, repo, workflow_id: 938271, // ci-artifacts.yml + branch: 'main', status: 'success', per_page: 1 }) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 0d3a539de0..f0ed8020b3 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -37,7 +37,7 @@ jobs: sparse-checkout: | ui-tests - - uses: actions/cache/restore@v5 + - uses: actions/cache/restore@v6 id: restore-wt with: key: wt-${{ env.WT_VERSION }} @@ -46,12 +46,12 @@ jobs: working-directory: ui-tests run: | powershell -File setup-portable-wt.ps1 -WtVersion $env:WT_VERSION -DestDir $env:RUNNER_TEMP - - uses: actions/cache/save@v5 + - uses: actions/cache/save@v6 if: steps.restore-wt.outputs.cache-hit != 'true' with: key: wt-${{ env.WT_VERSION }} path: ${{ runner.temp }}/wt.zip - - uses: actions/cache/restore@v5 + - uses: actions/cache/restore@v6 id: restore-ahk with: key: ahk-${{ env.AUTOHOTKEY_VERSION }} @@ -62,7 +62,7 @@ jobs: run: | curl -L -o "$RUNNER_TEMP/ahk.zip" \ https://github.com/AutoHotkey/AutoHotkey/releases/download/v$AUTOHOTKEY_VERSION/AutoHotkey_$AUTOHOTKEY_VERSION.zip - - uses: actions/cache/save@v5 + - uses: actions/cache/save@v6 if: steps.restore-ahk.outputs.cache-hit != 'true' with: key: ahk-${{ env.AUTOHOTKEY_VERSION }} @@ -74,7 +74,7 @@ jobs: "$WINDIR/system32/tar.exe" -C "$RUNNER_TEMP/ahk" -xf "$RUNNER_TEMP/ahk.zip" && cygpath -aw "$RUNNER_TEMP/ahk" >>$GITHUB_PATH - uses: actions/setup-node@v6 # the hook uses node for the background process - - uses: actions/cache/restore@v5 + - uses: actions/cache/restore@v6 id: restore-win32-openssh with: key: win32-openssh-${{ env.WIN32_OPENSSH_VERSION }} @@ -85,7 +85,7 @@ jobs: run: | curl -fLo "$RUNNER_TEMP/win32-openssh.zip" \ https://github.com/PowerShell/Win32-OpenSSH/releases/download/v$WIN32_OPENSSH_VERSION/OpenSSH-Win64.zip - - uses: actions/cache/save@v5 + - uses: actions/cache/save@v6 if: steps.restore-win32-openssh.outputs.cache-hit != 'true' with: key: win32-openssh-${{ env.WIN32_OPENSSH_VERSION }} diff --git a/winsup/cygserver/cygserver-config b/winsup/cygserver/cygserver-config index 1f0603f68c..6fc3e06ae0 100755 --- a/winsup/cygserver/cygserver-config +++ b/winsup/cygserver/cygserver-config @@ -162,7 +162,7 @@ then exit 1 fi chmod 664 "${SYSCONFDIR}/cygserver.conf" - chown 18.544 "${SYSCONFDIR}/cygserver.conf" + chown 18:544 "${SYSCONFDIR}/cygserver.conf" fi # On NT ask if cygserver should be installed as service @@ -194,7 +194,7 @@ then echo "To start it, call \`net start ${service_name}' or \`cygrunsrv -S ${service_name}'." fi touch "${LOCALSTATEDIR}/log/cygserver.log" - chown 18.544 "${LOCALSTATEDIR}/log/cygserver.log" + chown 18:544 "${LOCALSTATEDIR}/log/cygserver.log" fi fi diff --git a/winsup/cygwin/fhandler/clipboard.cc b/winsup/cygwin/fhandler/clipboard.cc index 12691c7c16..116feb5994 100644 --- a/winsup/cygwin/fhandler/clipboard.cc +++ b/winsup/cygwin/fhandler/clipboard.cc @@ -25,11 +25,28 @@ details. */ static inline bool open_clipboard () { - const int max_retry = 10; + const int max_retry = 20; for (int i = 0; i < max_retry; i++) { + /* No appropriate HWND exists here. */ if (OpenClipboard (NULL)) - return true; + { + /* SetClipboardData() and GetClipboardData() occasionally + fail with ERROR_CLIPBOARD_NOT_OPEN, even though + OpenClipboard() succeeded if NULL HWND is used. + Retry until GetClipboardData() does not return + ERROR_CLIPBOARD_NOT_OPEN. */ + if (GetClipboardData (CF_UNICODETEXT)) + return true; + DWORD err = GetLastError (); + /* Here, ERROR_NOT_FOUND means the clipboard does not contains + valid CF_UNICODETEXT. OpenClipboard() must have succeeded. */ + if (err == ERROR_NOT_FOUND) + return true; + CloseClipboard (); + if (err != ERROR_CLIPBOARD_NOT_OPEN) + return false; + } Sleep (1); } return false; diff --git a/winsup/cygwin/fhandler/console.cc b/winsup/cygwin/fhandler/console.cc index 561c130e18..3de1bcadad 100644 --- a/winsup/cygwin/fhandler/console.cc +++ b/winsup/cygwin/fhandler/console.cc @@ -1401,9 +1401,21 @@ fhandler_console::process_input_message (size_t len) } else { - WCHAR second = unicode_char >= 0xd800 && unicode_char <= 0xdbff - && i + 1 < total_read ? - input_rec[i + 1].Event.KeyEvent.uChar.UnicodeChar : 0; + WCHAR second = 0; + DWORD second_pos = i; + if (unicode_char >= 0xd800 && unicode_char <= 0xdbff) + for (DWORD j = i + 1; j < total_read; j++) + { + /* Do not check bKeyDown. bKeyDown is 0 for surrogate + pair in legacy console */ + if (input_rec[j].EventType == KEY_EVENT && + input_rec[j].Event.KeyEvent.uChar.UnicodeChar) + { + second = input_rec[j].Event.KeyEvent.uChar.UnicodeChar; + second_pos = j; + break; + } + } if (second < 0xdc00 || second > 0xdfff) { @@ -1414,7 +1426,7 @@ fhandler_console::process_input_message (size_t len) /* handle surrogate pairs */ WCHAR pair[2] = { unicode_char, second }; nread = sys_wcstombs (tmp + 1, 59, pair, 2); - i++; + i = second_pos; } /* Determine if the keystroke is modified by META. The tricky diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h index 4d41d6f4b0..72aa76de1d 100644 --- a/winsup/cygwin/include/cygwin/version.h +++ b/winsup/cygwin/include/cygwin/version.h @@ -11,7 +11,7 @@ details. */ changes to the DLL and is mainly informative in nature. */ #define CYGWIN_VERSION_DLL_MAJOR 3006 -#define CYGWIN_VERSION_DLL_MINOR 9 +#define CYGWIN_VERSION_DLL_MINOR 10 /* CYGWIN_VERSION_DLL_COMBINED gives us a single number representing the combined DLL major and minor numbers. */ diff --git a/winsup/cygwin/release/3.6.10 b/winsup/cygwin/release/3.6.10 new file mode 100644 index 0000000000..825ed3a625 --- /dev/null +++ b/winsup/cygwin/release/3.6.10 @@ -0,0 +1,32 @@ +Fixes: +------ + +- Fix deadlock in console teardown that arises from pseudo console. + Addresses: https://github.com/msys2/msys2-runtime/issues/338 + +- Fix handling of surrogate pair in legacy console. + +- Fix behaviour with OPEN_MAX files open + Addresses: https://cygwin.com/pipermail/cygwin/2026-May/259664.html + +- Add workaround for clipboard access error. + Addresses: https://cygwin.com/pipermail/cygwin/2026-February/259438.html + +- Fix broken cursor position report resonse when a non-cygwin app starts. + Addresses: https://cygwin.com/pipermail/cygwin/2026-June/259776.html + +- Fix race issue between starting and exiting non-cygwin apps in pty. + +- Fix CR/NL conversion in accept_input() for pty. + +- Ensure the cons_master_thread runs only when it is really supposed to. + +- Fix NOFLSH behaviour in console a bit. + +- Fix typeahead input in console for bash. + +- Fix a pty race issue at startup of cygwin and non-cygwin processes + where the different pipe mode (nat or cyg) is required. + +- Fix non-cygwin inferior crash in gdb when it is launched repeatedly + in a pty. diff --git a/winsup/cygwin/release/3.6.8 b/winsup/cygwin/release/3.6.9 similarity index 100% rename from winsup/cygwin/release/3.6.8 rename to winsup/cygwin/release/3.6.9 diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 6a935aac63..3ad2039321 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1547,6 +1547,13 @@ open (const char *unix_path, int flags, ...) fh = fh_file; } + /* Reserve an fdtable entry here, before calling open_with_arch() below. + Otherwise there's a tiny chance of hitting OPEN_MAX further on which + could create a new file without any way for Cygwin to refer to it. */ + cygheap_fdnew fd; + if (fd < 0) + __leave; /* errno already set */ + if (fh->dev () == FH_PROCESSFD && fh->pc.follow_fd_symlink ()) { /* Reopen file by descriptor */ @@ -1573,14 +1580,6 @@ open (const char *unix_path, int flags, ...) try_to_bin (fh->pc, fh->get_handle (), DELETE, FILE_OPEN_FOR_BACKUP_INTENT); - cygheap_fdnew fd; - - if (fd < 0) - { - fh->close(); - __leave; /* errno already set */ - } - fd = fh; if (fd <= 2) set_std_handle (fd); diff --git a/winsup/utils/dumper.cc b/winsup/utils/dumper.cc index 994f9b683c..ac261d03c5 100644 --- a/winsup/utils/dumper.cc +++ b/winsup/utils/dumper.cc @@ -827,14 +827,14 @@ dumper::prepare_core_dump () p->section = new_section; int section_count = 1; - bfd_boolean filehdr = 0; - bfd_boolean phdrs = 0; + bool filehdr = false; + bool phdrs = false; bfd_vma at = 0; - bfd_boolean valid_at = 0; + bool valid_at = false; flagword flags = 0; - bfd_boolean valid_flags = 1; + bool valid_flags = true; if (p->type == pr_ent_memory) {